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
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,
String prefix) |
ParticleShader(Renderable renderable,
ParticleShader.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,
ParticleShader.Config config) |
void |
dispose()
Releases all resources of this object.
|
void |
end()
Cleanup the context so other shaders can render.
|
boolean |
equals(Object obj) |
boolean |
equals(ParticleShader 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)
Renders the
Renderable , must be called between Shader.begin(Camera, RenderContext) and Shader.end() . |
void |
setDefaultCullFace(int cullFace) |
void |
setDefaultDepthFunc(int depthFunc) |
public ParticleShader(Renderable renderable)
public ParticleShader(Renderable renderable, ParticleShader.Config config)
public ParticleShader(Renderable renderable, ParticleShader.Config config, String prefix)
public ParticleShader(Renderable renderable, ParticleShader.Config config, String prefix, String vertexShader, String fragmentShader)
public ParticleShader(Renderable renderable, ParticleShader.Config config, ShaderProgram shaderProgram)
public static String getDefaultVertexShader()
public static String getDefaultFragmentShader()
public void init()
Shader
ShaderProgram
,
fetches uniform locations and performs other preparations for usage of the Shader.public static String createPrefix(Renderable renderable, ParticleShader.Config config)
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.renderable
- The renderable to check against this shader.Renderable
, false otherwise.public int compareTo(Shader other)
Shader
public boolean equals(ParticleShader obj)
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 BaseShader
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 render(Renderable renderable)
Shader
Renderable
, must be called between Shader.begin(Camera, RenderContext)
and Shader.end()
. The Shader
instance might not be able to render every type of Renderable
s. Use the Shader.canRender(Renderable)
method to
check if the Shader is capable of rendering a specific Renderable
.render
in interface Shader
render
in class BaseShader
renderable
- The renderable to render, all required fields (e.g. Renderable.mesh
, Renderable.material
and others) must be set. The Renderable.shader
field will be ignored.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 BaseShader
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class BaseShader
public int getDefaultCullFace()
public void setDefaultCullFace(int cullFace)
public int getDefaultDepthFunc()
public void setDefaultDepthFunc(int depthFunc)
Copyright © 2015. All rights reserved.