public class ParticleShader extends BaseShader
DefaultShader will be used
instead. This shader will be used when dealing with billboards using GPU mode or point sprites.| Modifier and Type | Class and Description |
|---|---|
static class |
ParticleShader.AlignMode |
static class |
ParticleShader.Config |
static class |
ParticleShader.Inputs |
static class |
ParticleShader.ParticleType |
static class |
ParticleShader.Setters |
BaseShader.GlobalSetter, BaseShader.LocalSetter, BaseShader.Setter, BaseShader.Uniform, BaseShader.Validator| Modifier and Type | Field and Description |
|---|---|
protected ParticleShader.Config |
config |
protected static long |
implementedFlags |
camera, context, program| Constructor and Description |
|---|
ParticleShader(Renderable renderable) |
ParticleShader(Renderable renderable,
ParticleShader.Config config) |
ParticleShader(Renderable renderable,
ParticleShader.Config config,
ShaderProgram shaderProgram) |
ParticleShader(Renderable renderable,
ParticleShader.Config config,
java.lang.String prefix) |
ParticleShader(Renderable renderable,
ParticleShader.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 |
bindMaterial(Renderable renderable) |
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 java.lang.String |
createPrefix(Renderable renderable,
ParticleShader.Config config) |
void |
dispose()
Releases all resources of this object.
|
void |
end()
Cleanup the context so other shaders can render.
|
boolean |
equals(java.lang.Object obj) |
boolean |
equals(ParticleShader obj) |
int |
getDefaultCullFace() |
int |
getDefaultDepthFunc() |
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)
Renders the
Renderable, must be called between Shader.begin(Camera, RenderContext) and Shader.end(). |
void |
setDefaultCullFace(int cullFace) |
void |
setDefaultDepthFunc(int depthFunc) |
protected static long implementedFlags
protected final ParticleShader.Config config
public ParticleShader(Renderable renderable)
public ParticleShader(Renderable renderable, ParticleShader.Config config)
public ParticleShader(Renderable renderable, ParticleShader.Config config, java.lang.String prefix)
public ParticleShader(Renderable renderable, ParticleShader.Config config, java.lang.String prefix, java.lang.String vertexShader, java.lang.String fragmentShader)
public ParticleShader(Renderable renderable, ParticleShader.Config config, ShaderProgram shaderProgram)
public static java.lang.String getDefaultVertexShader()
public static java.lang.String getDefaultFragmentShader()
public void init()
ShaderShaderProgram,
fetches uniform locations and performs other preparations for usage of the Shader.public static java.lang.String createPrefix(Renderable renderable, ParticleShader.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(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean equals(ParticleShader 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)
ShaderRenderable, must be called between Shader.begin(Camera, RenderContext) and Shader.end(). The Shader
instance might not be able to render every type of Renderables. Use the Shader.canRender(Renderable) method to
check if the Shader is capable of rendering a specific Renderable.render in interface Shaderrender in class BaseShaderrenderable - The renderable to render, all required fields (e.g. Renderable.material and others) must be set.
The Renderable.shader field will be ignored.public 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 BaseShaderprotected void bindMaterial(Renderable renderable)
public void dispose()
Disposabledispose in interface Disposabledispose in class BaseShaderpublic int getDefaultCullFace()
public void setDefaultCullFace(int cullFace)
public int getDefaultDepthFunc()
public void setDefaultDepthFunc(int depthFunc)