@Override public void begin (Camera camera, RenderContext context) { this.context = context; shaderProgram.begin(); shaderProgram.setUniformMatrix("u_projViewTrans", camera.combined); context.setDepthTest(GL20.GL_LEQUAL); context.setCullFace(GL20.GL_BACK); }
protected void bindMaterial (final Renderable renderable) { if (currentMaterial == renderable.material) return; int cullFace = config.defaultCullFace == -1 ? GL20.GL_BACK : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? GL20.GL_LEQUAL : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; currentMaterial = renderable.material; for (final Attribute attr : currentMaterial) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); } else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
protected void bindMaterial (final Renderable renderable) { if (currentMaterial == renderable.material) return; int cullFace = config.defaultCullFace == -1 ? GL20.GL_BACK : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? GL20.GL_LEQUAL : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; currentMaterial = renderable.material; for (final Attribute attr : currentMaterial) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); } else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
protected void bindMaterial (final Attributes attributes) { int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; for (final Attribute attr : attributes) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); set(u_opacity, ((BlendingAttribute)attr).opacity); } else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace) cullFace = ((IntAttribute)attr).value; else if ((t & FloatAttribute.AlphaTest) == FloatAttribute.AlphaTest) set(u_alphaTest, ((FloatAttribute)attr).value); else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
protected void bindMaterial (final Attributes attributes) { int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; for (final Attribute attr : attributes) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); set(u_opacity, ((BlendingAttribute)attr).opacity); } else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace) cullFace = ((IntAttribute)attr).value; else if ((t & FloatAttribute.AlphaTest) == FloatAttribute.AlphaTest) set(u_alphaTest, ((FloatAttribute)attr).value); else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
@Override public void begin(Camera camera, RenderContext context) { this.context = context; this.context.setCullFace(GL20.GL_BACK); this.context.setDepthTest(GL20.GL_LEQUAL, 0f, 1f); this.context.setDepthMask(true); program.begin(); set(UNIFORM_PROJ_VIEW_MATRIX, camera.combined); }
@Override public void begin(Camera camera, RenderContext context) { this.context = context; context.begin(); this.context.setCullFace(GL20.GL_BACK); this.context.setDepthTest(GL20.GL_LEQUAL, 0f, 1f); this.context.setDepthMask(true); program.begin(); set(UNIFORM_PROJ_VIEW_MATRIX, camera.combined); set(UNIFORM_CAM_POS, camera.position); }
@Override public void begin(Camera camera, RenderContext context) { this.context = context; context.begin(); context.setCullFace(GL20.GL_BACK); this.context.setDepthTest(GL20.GL_LEQUAL, 0f, 1f); this.context.setDepthMask(true); program.begin(); set(UNIFORM_PROJ_VIEW_MATRIX, camera.combined); set(UNIFORM_CAM_POS, camera.position); }
protected void bindMaterial (final Renderable renderable) { if (currentMaterial == renderable.material) return; int cullFace = config.defaultCullFace == -1 ? GL20.GL_BACK : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? GL20.GL_LEQUAL : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; currentMaterial = renderable.material; for (final Attribute attr : currentMaterial) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); } else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
protected void bindMaterial(final Renderable renderable) { if (currentMaterial == renderable.material) return; int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; currentMaterial = renderable.material; for (final Attribute attr : currentMaterial) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute) attr).sourceFunction, ((BlendingAttribute) attr).destFunction); } else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace) cullFace = ((IntAttribute) attr).value; else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute) attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }
protected void bindMaterial (final Attributes attributes) { int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace; int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc; float depthRangeNear = 0f; float depthRangeFar = 1f; boolean depthMask = true; for (final Attribute attr : attributes) { final long t = attr.type; if (BlendingAttribute.is(t)) { context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction); set(u_opacity, ((BlendingAttribute)attr).opacity); } else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace) cullFace = ((IntAttribute)attr).value; else if ((t & FloatAttribute.AlphaTest) == FloatAttribute.AlphaTest) set(u_alphaTest, ((FloatAttribute)attr).value); else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) { DepthTestAttribute dta = (DepthTestAttribute)attr; depthFunc = dta.depthFunc; depthRangeNear = dta.depthRangeNear; depthRangeFar = dta.depthRangeFar; depthMask = dta.depthMask; } else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString()); } context.setCullFace(cullFace); context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar); context.setDepthMask(depthMask); }