/** * Get the pre-shadows pass render state. * use it to adjust the RenderState parameters of the pre shadow pass. * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState * @return the pre shadow render state. */ public RenderState getPreShadowForcedRenderState() { return shadowRenderer.getPreShadowForcedRenderState(); }
/** * Set to true if you want back faces shadows on geometries. * Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting. * * Also note that setting this parameter will override this parameter for ALL materials in the scene. * You can alternatively change this parameter on a single material using {@link Material#setBoolean(String, boolean)} * * This also will automatically adjust the faceCullMode and the PolyOffset of the pre shadow pass. * You can modify them by using {@link #getPreShadowForcedRenderState()} * * @param renderBackFacesShadows true or false. */ public void setRenderBackFacesShadows(Boolean renderBackFacesShadows) { this.renderBackFacesShadows = renderBackFacesShadows; if(renderBackFacesShadows) { getPreShadowForcedRenderState().setPolyOffset(5, 3); getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Back); }else{ getPreShadowForcedRenderState().setPolyOffset(0, 0); getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Front); } }