Class DepthShader
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.shaders.BaseShader
-
- com.badlogic.gdx.graphics.g3d.shaders.DefaultShader
-
- com.badlogic.gdx.graphics.g3d.shaders.DepthShader
-
- All Implemented Interfaces:
Shader
,Disposable
public class DepthShader extends DefaultShader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DepthShader.Config
-
Nested classes/interfaces inherited from class com.badlogic.gdx.graphics.g3d.shaders.DefaultShader
DefaultShader.Inputs, DefaultShader.Setters
-
Nested classes/interfaces inherited from class com.badlogic.gdx.graphics.g3d.shaders.BaseShader
BaseShader.GlobalSetter, BaseShader.LocalSetter, BaseShader.Setter, BaseShader.Uniform, BaseShader.Validator
-
-
Field Summary
Fields Modifier and Type Field Description int
numBones
-
Fields inherited from class com.badlogic.gdx.graphics.g3d.shaders.DefaultShader
ambientCubemap, attributesMask, config, defaultCullFace, defaultDepthFunc, directionalLights, dirLightsColorOffset, dirLightsDirectionOffset, dirLightsLoc, dirLightsSize, environmentCubemap, implementedFlags, lighting, pointLights, pointLightsColorOffset, pointLightsIntensityOffset, pointLightsLoc, pointLightsPositionOffset, pointLightsSize, shadowMap, spotLights, spotLightsColorOffset, spotLightsCutoffAngleOffset, spotLightsDirectionOffset, spotLightsExponentOffset, spotLightsIntensityOffset, spotLightsLoc, spotLightsPositionOffset, spotLightsSize, u_alphaTest, u_ambientCubemap, u_ambientTexture, u_ambientUVTransform, u_bones, u_cameraDirection, u_cameraNearFar, u_cameraPosition, u_cameraUp, u_diffuseColor, u_diffuseTexture, u_diffuseUVTransform, u_dirLights0color, u_dirLights0direction, u_dirLights1color, u_emissiveColor, u_emissiveTexture, u_emissiveUVTransform, u_environmentCubemap, u_fogColor, u_normalMatrix, u_normalTexture, u_normalUVTransform, u_opacity, u_pointLights0color, u_pointLights0intensity, u_pointLights0position, u_pointLights1color, u_projTrans, u_projViewTrans, u_projViewWorldTrans, u_reflectionColor, u_reflectionTexture, u_reflectionUVTransform, u_shadowMapProjViewTrans, u_shadowPCFOffset, u_shadowTexture, u_shininess, u_specularColor, u_specularTexture, u_specularUVTransform, u_spotLights0color, u_spotLights0cutoffAngle, u_spotLights0direction, u_spotLights0exponent, u_spotLights0intensity, u_spotLights0position, u_spotLights1color, u_time, u_viewTrans, u_viewWorldTrans, u_worldTrans
-
Fields inherited from class com.badlogic.gdx.graphics.g3d.shaders.BaseShader
camera, context, program
-
-
Constructor Summary
Constructors Constructor Description DepthShader(Renderable renderable)
DepthShader(Renderable renderable, DepthShader.Config config)
DepthShader(Renderable renderable, DepthShader.Config config, ShaderProgram shaderProgram)
DepthShader(Renderable renderable, DepthShader.Config config, java.lang.String prefix)
DepthShader(Renderable renderable, DepthShader.Config config, java.lang.String prefix, java.lang.String vertexShader, java.lang.String fragmentShader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin(Camera camera, RenderContext context)
Initializes the context for exclusive rendering by this shader.boolean
canRender(Renderable renderable)
Checks whether this shader is intended to render theRenderable
.static java.lang.String
createPrefix(Renderable renderable, DepthShader.Config config)
void
end()
Cleanup the context so other shaders can render.static java.lang.String
getDefaultFragmentShader()
static java.lang.String
getDefaultVertexShader()
void
render(Renderable renderable, Attributes combinedAttributes)
-
Methods inherited from class com.badlogic.gdx.graphics.g3d.shaders.DefaultShader
bindLights, bindMaterial, compareTo, createPrefix, dispose, equals, equals, getDefaultCullFace, getDefaultDepthFunc, init, setDefaultCullFace, setDefaultDepthFunc
-
-
-
-
Constructor Detail
-
DepthShader
public DepthShader(Renderable renderable)
-
DepthShader
public DepthShader(Renderable renderable, DepthShader.Config config)
-
DepthShader
public DepthShader(Renderable renderable, DepthShader.Config config, java.lang.String prefix)
-
DepthShader
public DepthShader(Renderable renderable, DepthShader.Config config, java.lang.String prefix, java.lang.String vertexShader, java.lang.String fragmentShader)
-
DepthShader
public DepthShader(Renderable renderable, DepthShader.Config config, ShaderProgram shaderProgram)
-
-
Method Detail
-
getDefaultVertexShader
public static final java.lang.String getDefaultVertexShader()
-
getDefaultFragmentShader
public static final java.lang.String getDefaultFragmentShader()
-
createPrefix
public static java.lang.String createPrefix(Renderable renderable, DepthShader.Config config)
-
begin
public void begin(Camera camera, RenderContext context)
Description copied from interface:Shader
Initializes the context for exclusive rendering by this shader. Use theShader.render(Renderable)
method to render aRenderable
. When done rendering theShader.end()
method must be called.- Specified by:
begin
in interfaceShader
- Overrides:
begin
in classDefaultShader
- Parameters:
camera
- The camera to use when renderingcontext
- The context to be used, which must be exclusive available for the shader until the call to theShader.end()
method.
-
end
public void end()
Description copied from interface:Shader
Cleanup the context so other shaders can render. Must be called when done rendering using theShader.render(Renderable)
method, which must be preceded by a call toShader.begin(Camera, RenderContext)
. After a call to this method an call to theShader.render(Renderable)
method will fail until theShader.begin(Camera, RenderContext)
is called.- Specified by:
end
in interfaceShader
- Overrides:
end
in classDefaultShader
-
canRender
public boolean canRender(Renderable renderable)
Description copied from interface:Shader
Checks whether this shader is intended to render theRenderable
. Use this to make sure a call to theShader.render(Renderable)
method will succeed. This is expected to be a fast, non-blocking method. Note that this method will only return true if it is intended to be used. Even when it returns false the Shader might still be capable of rendering, but it's not preferred to do so.- Specified by:
canRender
in interfaceShader
- Overrides:
canRender
in classDefaultShader
- Parameters:
renderable
- The renderable to check against this shader.- Returns:
- true if this shader is intended to render the
Renderable
, false otherwise.
-
render
public void render(Renderable renderable, Attributes combinedAttributes)
- Overrides:
render
in classDefaultShader
-
-