FaceCullMode: Make Backside of face Black instead of invisible?

Hello,

is there an easy way of making the backside of a face black instead of invisible? So a simple material color instead of a texture?

Thanks,

P.

http://hub.jmonkeyengine.org/javadoc/com/jme3/material/RenderState.html#setFaceCullMode(com.jme3.material.RenderState.FaceCullMode)

To have it be anything but the texture on the back, you’d need to write your own shader.

By the way, this question is in the FAQ, too:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:faq

Thanks for the quick reply: But maybe I did not ask my question clear enough :slight_smile: I do not need FaceCullMode.Back, I was looking for something, that makes the Backside “Black” instead of “transparent”. FaceCullMode makes the faces invisible from the backside, I would like them to be black.

An Ideas? Or maybe I got your answer wrong?

Maybe to describe my problem a bit more: I need a face to cast a shadow on itself, so that the downside of the face is dark. Setting the ShadowMode.CastAndReceive does not work, I assume, because a face can not cast a shadow to its backside? Is there maybe another solution?

@pspeed said: http://hub.jmonkeyengine.org/javadoc/com/jme3/material/RenderState.html#setFaceCullMode(com.jme3.material.RenderState.FaceCullMode)

To have it be anything but the texture on the back, you’d need to write your own shader.

Note the last bit.

@paulhoepner said: Maybe to describe my problem a bit more: I need a face to cast a shadow on itself, so that the downside of the face is dark. Setting the ShadowMode.CastAndReceive does not work, I assume, because a face can not cast a shadow to its backside? Is there maybe another solution?

The shadow behavior has nothing to do with the transparency of the back side.

Okay, thanks :slight_smile:
So is there a simple way to make the Backside receive shadow of its own?

@paulhoepner said: Okay, thanks :) So is there a simple way to make the Backside receive shadow of its own?

Don’t cull it. But how would a shadow be visible on a black surface? Anyway, if you want the inside of your models to look somehow different than their outside you either have to make your own shader (as was said) or have an actual inside surface with a small setoff from the outside surface. If you just want it to “reflect light” or “cast shadow” while the inner surface is not visible on the screen then you still misunderstand how shadows work in 3D rendering. Its not like this is raycasting where the shadow is actually caused by objects blocking the rays.

Hey Normen,

my fault, you are right. I forgot about the way shadow casting works. pretty self explanatory now, why my idea would not work :slight_smile: Thanks for that Hint!