List of usage examples for com.badlogic.gdx.graphics.g3d.attributes DepthTestAttribute Type
long Type
To view the source code for com.badlogic.gdx.graphics.g3d.attributes DepthTestAttribute Type.
Click Source Link
From source file:gaia.cu9.ari.gaiaorbit.util.override.AtmosphereShader.java
License:Apache License
protected void bindMaterial(final Renderable renderable) { if (currentMaterial == renderable.material) return;// w ww. ja v a 2 s.com 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); }