public class DefaultShader extends BaseShader
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultShader.Config |
static class |
DefaultShader.Inputs |
static class |
DefaultShader.Setters |
BaseShader.GlobalSetter, BaseShader.LocalSetter, BaseShader.Setter, BaseShader.Uniform, BaseShader.Validator| Modifier and Type | Field and Description |
|---|---|
static int |
defaultCullFace
Deprecated.
Replaced by
DefaultShader.Config.defaultCullFace Set to 0 to disable culling |
static int |
defaultDepthFunc
Deprecated.
Replaced by
DefaultShader.Config.defaultDepthFunc Set to 0 to disable depth test |
int |
u_alphaTest |
int |
u_ambientTexture |
int |
u_ambientUVTransform |
int |
u_bones |
int |
u_cameraDirection |
int |
u_cameraNearFar |
int |
u_cameraPosition |
int |
u_cameraUp |
int |
u_diffuseColor |
int |
u_diffuseTexture |
int |
u_diffuseUVTransform |
int |
u_emissiveColor |
int |
u_emissiveTexture |
int |
u_emissiveUVTransform |
int |
u_normalMatrix |
int |
u_normalTexture |
int |
u_normalUVTransform |
int |
u_opacity |
int |
u_projTrans |
int |
u_projViewTrans |
int |
u_projViewWorldTrans |
int |
u_reflectionColor |
int |
u_reflectionTexture |
int |
u_reflectionUVTransform |
int |
u_shininess |
int |
u_specularColor |
int |
u_specularTexture |
int |
u_specularUVTransform |
int |
u_time |
int |
u_viewTrans |
int |
u_viewWorldTrans |
int |
u_worldTrans |
camera, 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,
String prefix) |
DefaultShader(Renderable renderable,
DefaultShader.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. |
int |
compareTo(Shader other)
Compare this shader against the other, used for sorting, light weight shaders are rendered first.
|
static 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(Object obj) |
int |
getDefaultCullFace() |
int |
getDefaultDepthFunc() |
static String |
getDefaultFragmentShader() |
static String |
getDefaultVertexShader() |
void |
init()
Initializes the Shader, must be called before the Shader can be used.
|
void |
render(Renderable renderable,
Attributes combinedAttributes) |
void |
setDefaultCullFace(int cullFace) |
void |
setDefaultDepthFunc(int depthFunc) |
@Deprecated public static int defaultCullFace
DefaultShader.Config.defaultCullFace Set to 0 to disable culling@Deprecated public static int defaultDepthFunc
DefaultShader.Config.defaultDepthFunc Set to 0 to disable depth testpublic 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_cameraNearFar
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_diffuseUVTransform
public final int u_specularColor
public final int u_specularTexture
public final int u_specularUVTransform
public final int u_emissiveColor
public final int u_emissiveTexture
public final int u_emissiveUVTransform
public final int u_reflectionColor
public final int u_reflectionTexture
public final int u_reflectionUVTransform
public final int u_normalTexture
public final int u_normalUVTransform
public final int u_ambientTexture
public final int u_ambientUVTransform
public final int u_alphaTest
public DefaultShader(Renderable renderable)
public DefaultShader(Renderable renderable, DefaultShader.Config config)
public DefaultShader(Renderable renderable, DefaultShader.Config config, String prefix)
public DefaultShader(Renderable renderable, DefaultShader.Config config, String prefix, String vertexShader, String fragmentShader)
public DefaultShader(Renderable renderable, DefaultShader.Config config, ShaderProgram shaderProgram)
public static String getDefaultVertexShader()
public static String getDefaultFragmentShader()
public void init()
ShaderShaderProgram,
fetches uniform locations and performs other preparations for usage of the Shader.public static String createPrefix(Renderable renderable, DefaultShader.Config config)
public boolean canRender(Renderable renderable)
ShaderRenderable. 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.renderable - The renderable to check against this shader.Renderable, false otherwise.public int compareTo(Shader other)
Shaderpublic boolean equals(DefaultShader obj)
public void begin(Camera camera, RenderContext context)
ShaderShader.render(Renderable) method to render a
Renderable. When done rendering the Shader.end() method must be called.begin in interface Shaderbegin in class BaseShadercamera - 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 render(Renderable renderable, Attributes combinedAttributes)
render in class BaseShaderpublic void end()
ShaderShader.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 Shaderend in class BaseShaderpublic void dispose()
Disposabledispose in interface Disposabledispose in class BaseShaderpublic int getDefaultCullFace()
public void setDefaultCullFace(int cullFace)
public int getDefaultDepthFunc()
public void setDefaultDepthFunc(int depthFunc)
Copyright © 2021. All rights reserved.