Question about transparency & blender

Hi,

In Blender, there is a “Show Backface” checkbox that can be used with alpha blend mode:

when it is checked the model looks :

when it is unchecked model looks:

otherwise, we must use the alpha discard threshold to fix it as we do in JME.

Just was curious if it is possible to do something similar to Blender’s “Show Backface” option in JME too?

1 Like

com.jme3.material.RenderState includes a cullMode parameter that determines which faces are rendered. For example:

material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
1 Like

Thanks

I am surprised that the flower stem renders fine in JME even without setting the alpha discard threshold or changing face cull mode.

FaceCullMode:Back
BlendMode:Alpha
AlphaDiscardThreshold:null

See the part of the flower stem I marked with red color, that part is behind the flower transparent petals mesh, I was thinking that part would not be rendered unless I set the alpha discard threshold. Probably I am missing something!?

Note that the whole model is a single mesh.

1 Like

I think it all depends on the result of the geometry sorting. Note that those can be different depending on the queue bucket.

In your case it could also make a difference if the petal is made of several single geometries or not, because it might have an effect on the decision which geometry is in front of another.

Note, in my case, the whole model is just a single geometry unless it somehow gets split inside GPU.

In that case you can eventually modify the index buffer and make two examples.

  1. Put the stem at the beginning
  2. Put the stem at the end

I am wondering if that has any effect on the final result.

1 Like

The order that the triangles render is all the difference… whether it’s because of JME sorting two objects back to front or because the mesh itself presorts them back to front.

For example, one common way to deal with double-sided transparent boxes is to double the faces and have the inside faces at the beginning of the buffer and the outside faces at the end. So the inside faces are always rendered first.

If your flower only has one material then it’s one mesh and it must be that the stem triangles are drawn first. If the stem also has transparent parts then you should be able to get them to obscure the petals by looking at the flower from different (low) angles.

If your flower has more than one material then it is two geometries and JME is just sorting them correctly.

3 Likes