public void restore(final Renderable renderable) { if (renderable instanceof Mesh) { final Mesh mesh = (Mesh) renderable; mesh.setVisible(isVisible); if (cullState != null) { cullState.setCullFace(cullFace); } } } };
/** * Creates a new WaterRenderPass * * @param cam * main rendercam to use for reflection settings etc * @param renderScale * how many times smaller the reflection/refraction textures should be compared to the main display * @param useProjectedShader * true - use the projected setup for variable height water meshes, false - use the flast shader setup * @param useRefraction * enable/disable rendering of refraction textures */ public WaterNode(final Camera cam, final int renderScale, final boolean useProjectedShader, final boolean useRefraction) { this.cam = cam; this.useProjectedShader = useProjectedShader; this.useRefraction = useRefraction; this.renderScale = renderScale; fullScreenQuad = Quad.newFullScreenQuad(); resetParameters(); cullBackFace = new CullState(); cullBackFace.setEnabled(true); cullBackFace.setCullFace(CullState.Face.None); }
/** * Creates a new WaterRenderPass * * @param cam * main rendercam to use for reflection settings etc * @param renderScale * how many times smaller the reflection/refraction textures should be compared to the main display * @param useProjectedShader * true - use the projected setup for variable height water meshes, false - use the flast shader setup * @param useRefraction * enable/disable rendering of refraction textures */ public WaterNode(final Camera cam, final int renderScale, final boolean useProjectedShader, final boolean useRefraction) { this.cam = cam; this.useProjectedShader = useProjectedShader; this.useRefraction = useRefraction; this.renderScale = renderScale; resetParameters(); waterShader = new GLSLShaderObjectsState(); blurShaderVertical = new GLSLShaderObjectsState(); cullBackFace = new CullState(); cullBackFace.setEnabled(true); cullBackFace.setCullFace(CullState.Face.None); }
public void apply(final Renderable renderable) { if (renderable instanceof Mesh) { final Mesh mesh = (Mesh) renderable; isVisible = mesh.isVisible(); if (!mesh.getSceneHints().isCastsShadows()) { mesh.setVisible(false); } cullState = (CullState) mesh.getWorldRenderState(StateType.Cull); if (cullState != null) { cullFace = cullState.getCullFace(); if (cullFace != Face.None) { cullState.setCullFace(Face.Front); } } } }
public OutlinePass(final boolean antialiased) { _wireframeState = new WireframeState(); _wireframeState.setFace(WireframeState.Face.FrontAndBack); _wireframeState.setLineWidth(DEFAULT_LINE_WIDTH); _wireframeState.setEnabled(true); _frontCull = new CullState(); _frontCull.setCullFace(Face.Front); _backCull = new CullState(); _backCull.setCullFace(Face.Back); _wireframeState.setAntialiased(antialiased); _noLights = new LightState(); _noLights.setGlobalAmbient(DEFAULT_OUTLINE_COLOR); _noLights.setEnabled(true); _noTexture = new TextureState(); _noTexture.setEnabled(true); _blendState = new BlendState(); _blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _blendState.setBlendEnabled(true); _blendState.setEnabled(true); }
final CullState cs = new CullState(); cs.setEnabled(true); cs.setCullFace(CullState.Face.Back); setRenderState(cs);
_tranparentCull.setCullFace(CullState.Face.Front); mesh.draw(renderer); _tranparentCull.setCullFace(CullState.Face.Back); mesh.draw(renderer);
_tranparentCull.setCullFace(CullState.Face.Front); mesh.draw(renderer); _tranparentCull.setCullFace(CullState.Face.Back); mesh.draw(renderer);
final CullState cs = new CullState(); cs.setEnabled(true); cs.setCullFace(CullState.Face.Back); setRenderState(cs);
_cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front); _noLights = new LightState(); _noLights.setEnabled(false);
_cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front); _noLights = new LightState(); _noLights.setEnabled(false);