Rendering meshes/faces two sided .obj


how do I render a mesh/face two sided? I set the two sided option in blender and exported it in an .obj file, but the mesh/face is not rendered two sided. It has a texture on it, which is visible from one side, but not from the other.

1 Like

You need to change the FaceCullMode of the object material :


default is Back

Really cool, but how do I get the material of a loaded .obj?


// Import the spatial.

Spatial ship = manuskriptManager.loadModel(“data/models/Ship.obj”);





ship is either a geometry or a node containig geometry

if(ship instanceof Geoemtry){

Geometry sgeom = (Geometry)ship;



pretty much the same for a node, except you then need to check the children of the node for the geometry.

[snippet id=“13”]


// Import the spatial.

Node ship = (Node) manuskriptManager.loadModel(“data/models/Ship.obj”);

for (Spatial child : ship.getChildren()) {

if (child instanceof Geometry) {

((Geometry) child).getMaterial().getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);

((Geometry) child).getMaterial().setBoolean(“m_UseAlpha”, true); // Use alpha from diffuse color.

((Geometry) child).getMaterial().getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

child.setQueueBucket(Bucket.Transparent); // enables back-to-front sorting







Now for the last one:

I want to have transparent textures on the geometries. What did I forget in my code?

That code should enable transparency. Do you have an alpha channel in your textures?