public class DepthShader extends DefaultShader
Modifier and Type | Class and Description |
---|---|
static class |
DepthShader.Config |
DefaultShader.Inputs, DefaultShader.Setters
BaseShader.GlobalSetter, BaseShader.LocalSetter, BaseShader.Setter, BaseShader.Uniform, BaseShader.Validator
Modifier and Type | Field and Description |
---|---|
int |
numBones |
int |
weights |
defaultCullFace, defaultDepthFunc, u_alphaTest, u_ambientTexture, u_ambientUVTransform, u_bones, u_cameraDirection, u_cameraPosition, u_cameraUp, u_diffuseColor, u_diffuseTexture, u_diffuseUVTransform, u_emissiveColor, u_emissiveTexture, u_emissiveUVTransform, u_normalMatrix, u_normalTexture, u_normalUVTransform, u_opacity, u_projTrans, u_projViewTrans, u_projViewWorldTrans, u_reflectionColor, u_reflectionTexture, u_reflectionUVTransform, u_shininess, u_specularColor, u_specularTexture, u_specularUVTransform, u_time, u_viewTrans, u_viewWorldTrans, u_worldTrans
context, program
Constructor and Description |
---|
DepthShader(Renderable renderable) |
DepthShader(Renderable renderable,
DepthShader.Config config) |
DepthShader(Renderable renderable,
DepthShader.Config config,
ShaderProgram shaderProgram) |
DepthShader(Renderable renderable,
DepthShader.Config config,
String prefix) |
DepthShader(Renderable renderable,
DepthShader.Config config,
String prefix,
String vertexShader,
String fragmentShader) |
Modifier and Type | Method and 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 the
Renderable . |
static String |
createPrefix(Renderable renderable,
DepthShader.Config config) |
void |
end()
Cleanup the context so other shaders can render.
|
static String |
getDefaultFragmentShader() |
static String |
getDefaultVertexShader() |
void |
render(Renderable renderable,
Attributes combinedAttributes) |
compareTo, createPrefix, dispose, equals, equals, getDefaultCullFace, getDefaultDepthFunc, init, setDefaultCullFace, setDefaultDepthFunc
public DepthShader(Renderable renderable)
public DepthShader(Renderable renderable, DepthShader.Config config)
public DepthShader(Renderable renderable, DepthShader.Config config, String prefix)
public DepthShader(Renderable renderable, DepthShader.Config config, String prefix, String vertexShader, String fragmentShader)
public DepthShader(Renderable renderable, DepthShader.Config config, ShaderProgram shaderProgram)
public static final String getDefaultVertexShader()
public static final String getDefaultFragmentShader()
public static String createPrefix(Renderable renderable, DepthShader.Config config)
public void begin(Camera camera, RenderContext context)
Shader
Shader.render(Renderable)
method to render a
Renderable
. When done rendering the Shader.end()
method must be called.begin
in interface Shader
begin
in class DefaultShader
camera
- The camera to use when renderingcontext
- The context to be used, which must be exclusive available for the shader until the call to the Shader.end()
method.public void end()
Shader
Shader.render(Renderable)
method, which must be preceded by a call to Shader.begin(Camera, RenderContext)
. After a call to this method an call to
the Shader.render(Renderable)
method will fail until the Shader.begin(Camera, RenderContext)
is called.end
in interface Shader
end
in class DefaultShader
public boolean canRender(Renderable renderable)
Shader
Renderable
. Use this to make sure a call to the
Shader.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.canRender
in interface Shader
canRender
in class DefaultShader
renderable
- The renderable to check against this shader.Renderable
, false otherwise.public void render(Renderable renderable, Attributes combinedAttributes)
render
in class DefaultShader
Copyright © 2015. All rights reserved.