Hi guys,
Still working on getting a modified “forester” inside my project. I made some steps, I can now use the density maps and planting algorithm. I’m slowly getting there…
I have an issue very similar to the one described here:
http://hub.jmonkeyengine.org/forum/topic/quad-with-alpha-texture-overlapping-shadows/#post-190974
…but it’s not quite the same.
I have transparent quads that display plants and shadows. I want the shadows to be displayed on the quad but only on the opaque area of the quad.
If I set up my material like so:
Material vegeMat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
vegeMat.setTexture("DiffuseMap", getAssetManager().loadTexture("Textures/Vegetation/grass.png"));
vegeMat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
If I follow the answer of the topic I mentioned:
Material vegeMat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
vegeMat.setTexture("DiffuseMap", getAssetManager().loadTexture("Textures/Vegetation/grass.png"));
vegeMat.setFloat("AlphaDiscardThreshold", 0.1f);
vegeMat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
What am I missing? :-?
I toyed with other material properties like UseAlpha, setAlphaTest, setAlphaFallOff, etc. I also searched the forum and documentation, but I can’t find an answer. Is that something that was done before? Do I have to modify the lighting mat shaders for this to work (Phew,I hope not…).
Thanks a lot for your help.