Hi, i am trying to test grass rendering in JME, but i find a small problem. For first, i test grass which is made with 3 quad in star formation (my english is so bad ). Quads use a blend state for transparency.
From front view (front face) everything are perfect. Quads are transparent - no problem. But in back view (back face) the transparency of quads is like from front view - so one quads repaint other. It like the back face transparency of quad is same as front face transparency.
See images for understanding.
Font good view:
Back ugly view:
Quad creation:
Quad grass1 = new Quad("Grass quad", 30f, 30f);
grass1.setLocalTranslation(50f, terrain.getHeight(50f, 50f)
+ (grass1.getHeight() / 2), 50f);
TextureState ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
Texture t0 = TextureManager.loadTexture(Game.class.getClassLoader()
.getResource("media/textures/grass.png"),
MinificationFilter.Trilinear, MagnificationFilter.Bilinear);
ts.setTexture(t0, 0);
grass1.setRenderState(ts);
BlendState bs = display.getRenderer().createBlendState();
bs.setBlendEnabled(true);
bs.setSourceFunctionAlpha(BlendState.SourceFunction.SourceAlpha);
bs.setDestinationFunctionAlpha(BlendState.DestinationFunction.One);
bs.setBlendEquation(BlendState.BlendEquation.Add);
bs.setTestEnabled(true);
bs.setEnabled(true);
grass1.setRenderState(bs);
grass1.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
grass1.updateRenderState();