public class DefaultShader extends BaseShader
Modifier and Type | Class and Description |
---|---|
static class |
DefaultShader.Config |
static class |
DefaultShader.Inputs |
static class |
DefaultShader.Setters |
BaseShader.Setter, BaseShader.Uniform, BaseShader.Validator
context, program
Constructor and Description |
---|
DefaultShader(Renderable renderable) |
DefaultShader(Renderable renderable,
DefaultShader.Config config) |
DefaultShader(Renderable renderable,
DefaultShader.Config config,
ShaderProgram shaderProgram) |
DefaultShader(Renderable renderable,
DefaultShader.Config config,
java.lang.String prefix) |
DefaultShader(Renderable renderable,
DefaultShader.Config config,
java.lang.String prefix,
java.lang.String vertexShader,
java.lang.String fragmentShader) |
Modifier and Type | Method and Description |
---|---|
void |
begin(Camera camera,
RenderContext context)
Initializes the context for exclusive rendering by this shader
|
protected void |
bindLights(Renderable renderable) |
protected void |
bindMaterial(Renderable renderable) |
boolean |
canRender(Renderable renderable)
Whether this shader is intended to render the
Renderable |
int |
compareTo(Shader other)
Compare this shader against the other, used for sorting, light weight shaders are rendered first.
|
static java.lang.String |
createPrefix(Renderable renderable,
DefaultShader.Config config) |
void |
dispose()
Releases all resources of this object.
|
void |
end()
Cleanup the context so other shaders can render
|
boolean |
equals(DefaultShader obj) |
boolean |
equals(java.lang.Object obj) |
static java.lang.String |
getDefaultFragmentShader() |
static java.lang.String |
getDefaultVertexShader() |
void |
init()
Initializes the Shader, must be called before the Shader can be used
|
void |
render(Renderable renderable)
|
protected static long implementedFlags
public static boolean ignoreUnimplemented
public static int defaultCullFace
public static int defaultDepthFunc
public final int u_projTrans
public final int u_viewTrans
public final int u_projViewTrans
public final int u_cameraPosition
public final int u_cameraDirection
public final int u_cameraUp
public final int u_time
public final int u_worldTrans
public final int u_viewWorldTrans
public final int u_projViewWorldTrans
public final int u_normalMatrix
public final int u_bones
public final int u_shininess
public final int u_opacity
public final int u_diffuseColor
public final int u_diffuseTexture
public final int u_specularColor
public final int u_specularTexture
public final int u_emissiveColor
public final int u_reflectionColor
public final int u_normalTexture
public final int u_alphaTest
protected final int u_ambientCubemap
protected final int u_environmentCubemap
protected final int u_dirLights0color
protected final int u_dirLights0direction
protected final int u_dirLights1color
protected final int u_pointLights0color
protected final int u_pointLights0position
protected final int u_pointLights0intensity
protected final int u_pointLights1color
protected final int u_fogColor
protected final int u_shadowMapProjViewTrans
protected final int u_shadowTexture
protected final int u_shadowPCFOffset
protected int dirLightsLoc
protected int dirLightsColorOffset
protected int dirLightsDirectionOffset
protected int dirLightsSize
protected int pointLightsLoc
protected int pointLightsColorOffset
protected int pointLightsPositionOffset
protected int pointLightsIntensityOffset
protected int pointLightsSize
protected final boolean lighting
protected final boolean environmentCubemap
protected final boolean shadowMap
protected final boolean fog
protected final AmbientCubemap ambientCubemap
protected final DirectionalLight[] directionalLights
protected final PointLight[] pointLights
public DefaultShader(Renderable renderable)
public DefaultShader(Renderable renderable, DefaultShader.Config config)
public DefaultShader(Renderable renderable, DefaultShader.Config config, java.lang.String prefix)
public DefaultShader(Renderable renderable, DefaultShader.Config config, java.lang.String prefix, java.lang.String vertexShader, java.lang.String fragmentShader)
public DefaultShader(Renderable renderable, DefaultShader.Config config, ShaderProgram shaderProgram)
public static java.lang.String getDefaultVertexShader()
public static java.lang.String getDefaultFragmentShader()
public void init()
Shader
public static java.lang.String createPrefix(Renderable renderable, DefaultShader.Config config)
public boolean canRender(Renderable renderable)
Shader
Renderable
public int compareTo(Shader other)
Shader
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equals(DefaultShader obj)
public void begin(Camera camera, RenderContext context)
Shader
begin
in interface Shader
begin
in class BaseShader
public void render(Renderable renderable)
Shader
render
in interface Shader
render
in class BaseShader
public void end()
Shader
end
in interface Shader
end
in class BaseShader
protected final void bindMaterial(Renderable renderable)
protected final void bindLights(Renderable renderable)
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class BaseShader