public TransparentRenderBucket() { super(); _tranparentCull = new CullState(); _transparentZBuff = new ZBufferState(); _transparentZBuff.setWritable(false); _transparentZBuff.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo); _comparator = new TransparentComparator(); }
public TransparentRenderBucket() { super(); _tranparentCull = new CullState(); _transparentZBuff = new ZBufferState(); _transparentZBuff.setWritable(false); _transparentZBuff.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo); _comparator = new TransparentComparator(); }
@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); }
public static RenderState createState(final StateType type) { switch (type) { case Blend: return new BlendState(); case ColorMask: return new ColorMaskState(); case Cull: return new CullState(); case Light: return new LightState(); case Offset: return new OffsetState(); case Stencil: return new StencilState(); case Texture: return new TextureState(); case Wireframe: return new WireframeState(); case ZBuffer: return new ZBufferState(); } throw new IllegalArgumentException("Unknown state type: " + type); } }
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);
return new ColorMaskState(); case Cull: return new CullState(); case Fog: return new FogState();
final CullState cs = new CullState(); cs.setEnabled(true); cs.setCullFace(CullState.Face.Back);
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 = new ColorMaskState(); _colorDisabled.setAll(false); _cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front);
_colorDisabled = new ColorMaskState(); _colorDisabled.setAll(false); _cullFrontFace = new CullState(); _cullFrontFace.setEnabled(true); _cullFrontFace.setCullFace(CullState.Face.Front);