Class AtmosphereShader
java.lang.Object
gaiasky.util.gdx.shader.BaseIntShader
gaiasky.util.gdx.shader.AtmosphereShader
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IntShader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classNested classes/interfaces inherited from class BaseIntShader
BaseIntShader.GlobalSetter, BaseIntShader.LocalSetter, BaseIntShader.Setter, BaseIntShader.Uniform, BaseIntShader.ValidatorModifier and TypeClassDescriptionstatic classstatic classstatic interfacestatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BitsThe attributes that this shader supportsprotected final AtmosphereShader.Configfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intprotected static Bitsfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intFields inherited from class BaseIntShader
camera, context, programModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.Cameracom.badlogic.gdx.graphics.g3d.utils.RenderContext -
Constructor Summary
ConstructorsConstructorDescriptionAtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config) AtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config, ExtShaderProgram shaderProgram) AtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config, String prefix) AtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config, String prefix, String vertexShader, String fragmentShader) -
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.protected voidbindMaterial(IntRenderable renderable) booleancanRender(IntRenderable renderable) Checks whether this shader is intended to render theIntRenderable.intCompare this shader against the other, used for sorting, light weight shaders are rendered first.static StringcreatePrefix(IntRenderable renderable) voiddispose()voidend()Cleanup the context so other shaders can render.booleanequals(AtmosphereShader obj) booleanintintstatic Stringstatic StringinthashCode()voidinit()Initializes the IntShader, must be called before the IntShader can be used.voidrender(IntRenderable renderable) Renders theIntRenderable, must be called betweenIntShader.begin(Camera, RenderContext)andIntShader.end().voidsetDefaultCullFace(int cullFace) voidsetDefaultDepthFunc(int depthFunc) Methods inherited from class BaseIntShader
getUniformAlias, getUniformID, has, init, loc, register, register, register, register, register, register, render, renderMesh, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setModifier and TypeMethodDescriptiongetUniformAlias(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, 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
-
implementedFlags
-
u_projTrans
public final int u_projTrans -
u_viewTrans
public final int u_viewTrans -
u_projViewTrans
public final int u_projViewTrans -
u_cameraPosition
public final int u_cameraPosition -
u_cameraDirection
public final int u_cameraDirection -
u_cameraUp
public final int u_cameraUp -
u_cameraNearFar
public final int u_cameraNearFar -
u_cameraK
public final int u_cameraK -
u_worldTrans
public final int u_worldTrans -
u_viewWorldTrans
public final int u_viewWorldTrans -
u_projViewWorldTrans
public final int u_projViewWorldTrans -
u_normalMatrix
public final int u_normalMatrix -
fAlpha
public final int fAlpha -
fCameraHeight
public final int fCameraHeight -
fOuterRadius
public final int fOuterRadius -
fInnerRadius
public final int fInnerRadius -
fKrESun
public final int fKrESun -
fKmESun
public final int fKmESun -
fKr4PI
public final int fKr4PI -
fKm4PI
public final int fKm4PI -
fScale
public final int fScale -
fScaleDepth
public final int fScaleDepth -
fScaleOverScaleDepth
public final int fScaleOverScaleDepth -
nSamples
public final int nSamples -
g
public final int g -
v3PlanetPos
public final int v3PlanetPos -
v3LightPos
public final int v3LightPos -
v3CameraPos
public final int v3CameraPos -
v3InvWavelength
public final int v3InvWavelength -
u_eclipsingBodyPos
public final int u_eclipsingBodyPos -
u_eclipsingBodyRadius
public final int u_eclipsingBodyRadius -
u_vc
public final int u_vc -
u_velDir
public final int u_velDir -
u_hterms
public final int u_hterms -
u_gw
public final int u_gw -
u_gwmat3
public final int u_gwmat3 -
u_ts
public final int u_ts -
u_omgw
public final int u_omgw -
attributesMask
The attributes that this shader supports -
config
-
-
Constructor Details
-
AtmosphereShader
-
AtmosphereShader
-
AtmosphereShader
public AtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config, String prefix, String vertexShader, String fragmentShader) -
AtmosphereShader
public AtmosphereShader(IntRenderable renderable, AtmosphereShader.Config config, ExtShaderProgram shaderProgram)
-
-
Method Details
-
getDefaultVertexShader
-
getDefaultFragmentShader
-
createPrefix
-
init
public void init()Description copied from interface:IntShaderInitializes the IntShader, must be called before the IntShader can be used. This typically compiles aShaderProgram, fetches uniform locations and performs other preparations for usage of the IntShader. -
canRender
Description copied from interface:IntShaderChecks whether this shader is intended to render theIntRenderable. Use this to make sure a call to theIntShader.render(IntRenderable)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 IntShader 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
IntRenderable, false otherwise.
-
compareTo
-
equals
-
equals
-
hashCode
-
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- Overrides:
beginin classBaseIntShader- 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- Overrides:
renderin classBaseIntShader- Parameters:
renderable- The renderable to render, all required fields (e.g.IntRenderable.materialand others) must be set. TheIntRenderable.shaderfield will be ignored.
-
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.- Specified by:
endin interfaceIntShader- Overrides:
endin classBaseIntShader
-
bindMaterial
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classBaseIntShader
-
getDefaultCullFace
public int getDefaultCullFace() -
setDefaultCullFace
public void setDefaultCullFace(int cullFace) -
getDefaultDepthFunc
public int getDefaultDepthFunc() -
setDefaultDepthFunc
public void setDefaultDepthFunc(int depthFunc)
-