Jump to content

[1.8] Custom particles with custom and transparent textures


Quicksteve

Recommended Posts

Hello,

 

I've recently started modding again, and I'm having an issue: I need to create a custom particle with a texture that I can specify via the constructor.

 

So far, I've achieved some different results:

  • I had particles working with floating etc. however only textures with one color were displayed correctly. A texure with a gradient (black to red) was displayed as half-transparent dark gray and a texture with transparency did not display at all.
  • I then looked at how the footstep particle worked and adjusted my code, and voila, all particles were displayed; however only the one with only a single color was displayed without transparency. The one with transpaHello,
     
    I've recently started modding again, and I'm having an issue: I need to create a custom particle with a texture that I can specify via the constructor.
     
    So far, I've achieved some different results:
    • I had particles working with floating etc. however only textures with one color were displayed correctly. A texure with a gradient (black to red) was displayed as half-transparent dark gray and a texture with transparency did not display at all.
    • I then looked at how the footstep particle worked and adjusted my code, and voila, all particles were displayed; however only the one with only a single color was displayed without transparency. The one with transparency was displayed, but it also was half-transparent (it is not in the original texture). Additionally, the particles displayed like the footstep particle and were flat (they didn't face the player), which was probably a result of modelling my particle after the footstep one.

     

    I also have made some research, but most tutorials are outdated (<1.5) or only help with creating a particle with the shape of an existing one.

     

    I'd appreciate any help.

     

    Regards

    -Quicksteverency was displayed, but it also was half-transparent (it is not in the original texture). Additionally, the particles displayed like the footstep particle and were flat (they didn't face the player), which was probably a result of modelling my particle after the footstep one.

 

I also have made some research, but the tutorials I found were outdated (<1.5) or only helped with creating a particle with the shape of an existing one (by setting the RGB values).

 

I'd appreciate any help.

 

Regards

-Quicksteve

Link to comment
Share on other sites

  • 4 weeks later...

Since it's been so long without any replies, anything may be useful, so, I don't know if it changed in 1.8, but particle textures are masks, white is fully visible, black is fully transparent, and you apply color via the RGB values in the EntityFX derived class.  I don't know about the other stuff though, in 1.7.10 you could just put a ResourceLocation in the constructor arguments.

 

 

Maybe this will help?  1.7.10 EntityFX

Link to comment
Share on other sites

Since it's been so long without any replies, anything may be useful, so, I don't know if it changed in 1.8.

It didn't change much in 1.8. Some methods of Tessellator is moved to WorldRenderer. And GL11.blabla is replaced by GLStateManager.blabla.

getFXLayer is the key of custom particles. In order to use custom textures, it should return 3.

GLStateManager.enableAlpha makes textures transparent when rendered.

 

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • For the moment it seems fixed. I deleted the JEI Config file, the Journeymap Server Config file, and disabled both the mods (even while disabled, it would still crash until those config files were gone). They're useful mods and I'd hate to not use it, would just deleting and redownloading the mods work?
    • For hours I have been trying to just instal Mr. Crayfish's Refurbished Furniture Mod, but each step to fix the error codes, the more problems arise. The farthest I got through the steps was getting to the Forge Installer, but once I had selected the file, an error saying "The directory is missing a launcher profile. Please run the minecraft launcher first". At this point I don;'t know what more I can do. Please help.
    • I create my mod pack,yesterday my mod pack is fine but i add one mod and error. I'm delete this mmod but minecraft is still stop on CONFIG_LOAD then I tried to delete config and restart it but again. If you can pleace help me. https://imgur.com/ngZBzuv
    • game crashes before even opening (log:https://mclo.gs/M8xvX7c)
    • I have created a custom entity that extends "TamableAnimal", but I am wanting to have it spawn in the ocean. I have it spawning right now, but it spawns way too frequently even with weight set to 1. I am guessing it is because it is rolling in the spawn pool of land animals since TameableAnimal extends Animal and is different than WaterAnimal, and since no land animals spawn in the ocean it just fills every inch up with my custom entity. I have followed basic tutorials for spawning entities with Forge, but I feel like I am missing something about how to change what spawn pool this custom entity ends up in. Is it possible to change that or do I need to refactor it to be based off of WaterAnimal to get those spawn? My biome modifier JSON file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_ocean", "spawners": { "type": "darwinsmysticalmounts:water_animal", "weight": 20, "minCount": 1, "maxCount": 1 } } My client event: event.register(ModEntityTypes.WATER_ANIMAL.get(), SpawnPlacements.Type.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaterWyvernEntity::checkCustomWaterAnimalSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); And the actual custom spawn rule that makes it spawn in the water: public static boolean checkCustomWaterAnimalSpawnRules(EntityType<WaterAnimalEntity> pAnimal, LevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pPos.getY() > pLevel.getSeaLevel() - 16 && pLevel.getFluidState(pPos.below()).is(FluidTags.WATER); }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.