Class BaseIntShader
java.lang.Object
gaiasky.util.gdx.shader.BaseIntShader
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IntShader
- Direct Known Subclasses:
AtmosphereShader, DefaultIntShader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfacestatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.Cameracom.badlogic.gdx.graphics.g3d.utils.RenderContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context) Initializes the context for exclusive rendering by this shader.voiddispose()voidend()Cleanup the context so other shaders can render.getUniformAlias(int id) intgetUniformID(String alias) final booleanhas(int inputID) Whether this IntShader instance implements the specified uniform, only valid after a call to init().voidinit(ExtShaderProgram program, IntRenderable renderable) Initialize this shader, causing all registered uniforms/attributes to be fetched.final intloc(int inputID) intregister(BaseIntShader.Uniform uniform) intregister(BaseIntShader.Uniform uniform, BaseIntShader.Setter setter) intintregister(String alias, BaseIntShader.Setter setter) intregister(String alias, BaseIntShader.Validator validator) intregister(String alias, BaseIntShader.Validator validator, BaseIntShader.Setter setter) Register an uniform which might be used by this shader.voidrender(IntRenderable renderable) Renders theIntRenderable, must be called betweenIntShader.begin(Camera, RenderContext)andIntShader.end().voidrender(IntRenderable renderable, Attributes combinedAttributes) voidrenderMesh(ExtShaderProgram program, IntMeshPart meshPart) If necessary, override.final booleanset(int uniform, float value) final booleanset(int uniform, float v1, float v2) final booleanset(int uniform, float v1, float v2, float v3) final booleanset(int uniform, float v1, float v2, float v3, float v4) final booleanset(int uniform, int value) final booleanset(int uniform, int v1, int v2) final booleanset(int uniform, int v1, int v2, int v3) final booleanset(int uniform, int v1, int v2, int v3, int v4) final booleanset(int uniform, com.badlogic.gdx.graphics.Color value) final booleanset(int uniform, com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor textureDesc) final booleanset(int uniform, com.badlogic.gdx.graphics.GLTexture texture) final booleanset(int uniform, com.badlogic.gdx.math.Matrix3 value) final booleanset(int uniform, com.badlogic.gdx.math.Matrix4 value) final booleanset(int uniform, com.badlogic.gdx.math.Vector2 value) final booleanset(int uniform, com.badlogic.gdx.math.Vector3 value)
-
Field Details
-
program
-
context
public com.badlogic.gdx.graphics.g3d.utils.RenderContext context -
camera
public com.badlogic.gdx.graphics.Camera camera
-
-
Constructor Details
-
BaseIntShader
public BaseIntShader()
-
-
Method Details
-
register
Register an uniform which might be used by this shader. Only possible prior to the call to init().- Returns:
- The ID of the uniform to use in this shader.
-
register
-
register
-
register
-
register
-
register
-
getUniformID
- Returns:
- the ID of the input or negative if not available.
-
getUniformAlias
- Returns:
- The input at the specified id.
-
init
Initialize this shader, causing all registered uniforms/attributes to be fetched. -
begin
public void begin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context) Description copied from interface:IntShaderInitializes the context for exclusive rendering by this shader. Use theIntShader.render(IntRenderable)method to render aIntRenderable. When done rendering theIntShader.end()method must be called.- Specified by:
beginin interfaceIntShader- Parameters:
camera- The camera to use when renderingcontext- The context to be used, which must be exclusive available for the shader until the call to theIntShader.end()method.
-
render
Description copied from interface:IntShaderRenders theIntRenderable, must be called betweenIntShader.begin(Camera, RenderContext)andIntShader.end(). The IntShader instance might not be able to render every type ofIntRenderables. Use theIntShader.canRender(IntRenderable)method to check if the IntShader is capable of rendering a specificIntRenderable.- Specified by:
renderin interfaceIntShader- Parameters:
renderable- The renderable to render, all required fields (e.g.IntRenderable.materialand others) must be set. TheIntRenderable.shaderfield will be ignored.
-
render
-
renderMesh
If necessary, override.- Parameters:
program- The shader program.meshPart- The mesh part.
-
end
public void end()Description copied from interface:IntShaderCleanup the context so other shaders can render. Must be called when done rendering using theIntShader.render(IntRenderable)method, which must be preceded by a call toIntShader.begin(Camera, RenderContext). After a call to this method an call to theIntShader.render(IntRenderable)method will fail until theIntShader.begin(Camera, RenderContext)is called. -
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
has
public final boolean has(int inputID) Whether this IntShader instance implements the specified uniform, only valid after a call to init(). -
loc
public final int loc(int inputID) -
set
public final boolean set(int uniform, com.badlogic.gdx.math.Matrix4 value) -
set
public final boolean set(int uniform, com.badlogic.gdx.math.Matrix3 value) -
set
public final boolean set(int uniform, com.badlogic.gdx.math.Vector3 value) -
set
public final boolean set(int uniform, com.badlogic.gdx.math.Vector2 value) -
set
public final boolean set(int uniform, com.badlogic.gdx.graphics.Color value) -
set
public final boolean set(int uniform, float value) -
set
public final boolean set(int uniform, float v1, float v2) -
set
public final boolean set(int uniform, float v1, float v2, float v3) -
set
public final boolean set(int uniform, float v1, float v2, float v3, float v4) -
set
public final boolean set(int uniform, int value) -
set
public final boolean set(int uniform, int v1, int v2) -
set
public final boolean set(int uniform, int v1, int v2, int v3) -
set
public final boolean set(int uniform, int v1, int v2, int v3, int v4) -
set
public final boolean set(int uniform, com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor textureDesc) -
set
public final boolean set(int uniform, com.badlogic.gdx.graphics.GLTexture texture)
-