@Override public boolean processExtra(final Element extra, final Object[] params) { if (params.length > 0 && params[0] instanceof Mesh) { final Mesh mesh = (Mesh) params[0]; // should have a child: <technique profile="GOOGLEEARTH"> final Element technique = extra.getChild("technique"); if (technique != null) { final Attribute profile = technique.getAttribute("profile"); if (profile != null && "GOOGLEEARTH".equalsIgnoreCase(profile.getValue())) { for (final Element child : technique.getChildren()) { // disable back face culling if it's been enabled. if ("double_sided".equalsIgnoreCase(child.getName()) && "1".equals(child.getTextTrim())) { final CullState cs = new CullState(); cs.setEnabled(false); mesh.setRenderState(cs); } } return true; } } } return false; } }
/** * 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); }
cs.setEnabled(true); cs.setCullFace(CullState.Face.Back); setRenderState(cs);
cs.setEnabled(true); cs.setCullFace(CullState.Face.Back); setRenderState(cs);
public BasicText(final String name, final String text, final BMFont font, final double fontSize) { super(name, text, font); getSceneHints().setRenderBucketType(RenderBucketType.Ortho); setFontScale(fontSize); setAutoFade(AutoFade.Off); setAutoScale(AutoScale.Off); setAutoRotate(false); setRotation(new Matrix3().fromAngles(-MathUtils.HALF_PI, 0, 0)); final ZBufferState zState = new ZBufferState(); zState.setEnabled(false); zState.setWritable(false); setRenderState(zState); final CullState cState = new CullState(); cState.setEnabled(false); setRenderState(cState); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blend.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blend.setTestEnabled(true); blend.setReference(0f); blend.setTestFunction(BlendState.TestFunction.GreaterThan); setRenderState(blend); getSceneHints().setLightCombineMode(LightCombineMode.Off); getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); updateModelBound(); }
public BasicText(final String name, final String text, final BMFont font, final double fontSize) { super(name, text, font); setFontScale(fontSize); setAutoFade(AutoFade.Off); setAutoScale(AutoScale.Off); setAutoRotate(false); setRotation(new Matrix3().fromAngles(-MathUtils.HALF_PI, 0, 0)); final ZBufferState zState = new ZBufferState(); zState.setEnabled(false); zState.setWritable(false); setRenderState(zState); final CullState cState = new CullState(); cState.setEnabled(false); setRenderState(cState); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blend.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blend.setTestEnabled(true); blend.setReference(0f); blend.setTestFunction(BlendState.TestFunction.GreaterThan); setRenderState(blend); getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); getSceneHints().setCullHint(CullHint.Never); getSceneHints().setLightCombineMode(LightCombineMode.Off); getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); updateModelBound(); }
_colorDisabled.setAll(false); _cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front); _noLights = new LightState();
_colorDisabled.setAll(false); _cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front); _noLights = new LightState();