I’ve followed the shader tutorial as closely as I could, but I had to get a bit creative since the main links for the fakeparticleblow are broken. I found the test classes and used the code from one of them.
This is how they should look from most angles:
But as soon as the camera tilts, problems appear:
This gets really bad when looking from the rear, which is especially bad for me since that’s where the player will be looking from mostly.
The front looks pretty glitchy too.
Code used:
final Spatial fire = CPU.game.getAssetManager().loadModel("assets/shaders/models/FakeParticleBlow.j3o");
fire.setLocalScale(2f);
final Material mat = CPU.game.getAssetManager().loadMaterial("assets/shaders/materials/FakeParticleBlow_2.j3m");
mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
mat.getAdditionalRenderState().setDepthTest(true);
mat.getAdditionalRenderState().setDepthWrite(true);
fire.setMaterial(mat);
TangentBinormalGenerator.generate(fire);
fire.setQueueBucket(Bucket.Transparent);
fire.lookAt(Vector3f.UNIT_Y,Vector3f.UNIT_Y);
I have corrected the paths in all of the reqired files since my file structure is a bit different, but I didn’t touch anything else. I used the provided test material, model and textures. Note that I am not rotating the particles on the long axis since that is pretty much the point of using so many quads for each right?
Making the particles rotate so they always face the camera along the long axis removes the problems from picture 2,3 and 4 but the front and back still stay the same.
Any ideas? I’m sure a lot of you do this stuff on a daily basis.