Class ParticleShader

  • All Implemented Interfaces:
    Shader, Disposable

    public class ParticleShader
    extends BaseShader
    This is a custom shader to render the particles. Usually is not required, because the DefaultShader will be used instead. This shader will be used when dealing with billboards using GPU mode or point sprites.
    • Field Detail

      • implementedFlags

        protected static long implementedFlags
    • Method Detail

      • getDefaultVertexShader

        public static java.lang.String getDefaultVertexShader()
      • getDefaultFragmentShader

        public static java.lang.String getDefaultFragmentShader()
      • init

        public void init()
        Description copied from interface: Shader
        Initializes the Shader, must be called before the Shader can be used. This typically compiles a ShaderProgram, fetches uniform locations and performs other preparations for usage of the Shader.
      • canRender

        public boolean canRender​(Renderable renderable)
        Description copied from interface: Shader
        Checks whether this shader is intended to render the 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.
        Parameters:
        renderable - The renderable to check against this shader.
        Returns:
        true if this shader is intended to render the Renderable, false otherwise.
      • compareTo

        public int compareTo​(Shader other)
        Description copied from interface: Shader
        Compare this shader against the other, used for sorting, light weight shaders are rendered first.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • begin

        public void begin​(Camera camera,
                          RenderContext context)
        Description copied from interface: Shader
        Initializes the context for exclusive rendering by this shader. Use the Shader.render(Renderable) method to render a Renderable. When done rendering the Shader.end() method must be called.
        Specified by:
        begin in interface Shader
        Overrides:
        begin in class BaseShader
        Parameters:
        camera - The camera to use when rendering
        context - The context to be used, which must be exclusive available for the shader until the call to the Shader.end() method.
      • bindMaterial

        protected void bindMaterial​(Renderable renderable)
      • getDefaultCullFace

        public int getDefaultCullFace()
      • setDefaultCullFace

        public void setDefaultCullFace​(int cullFace)
      • getDefaultDepthFunc

        public int getDefaultDepthFunc()
      • setDefaultDepthFunc

        public void setDefaultDepthFunc​(int depthFunc)