Class DefaultIntShader
java.lang.Object
gaiasky.util.gdx.shader.BaseIntShader
gaiasky.util.gdx.shader.DefaultIntShader
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IntShader
- Direct Known Subclasses:
DepthIntShader, PBRShader, RelativisticShader
-
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 final recordstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Bitsprotected final DefaultIntShader.Configprotected final com.badlogic.gdx.graphics.g3d.environment.DirectionalLight[]protected intprotected intprotected intprotected intprotected final booleanprotected final com.badlogic.gdx.graphics.g3d.environment.PointLight[]protected intprotected intprotected intprotected intprotected intprotected final booleanfinal intprotected final intprotected final intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intfinal intint[]intint[]int[]final intprotected final intfinal intfinal intprotected final intprotected final intprotected final intfinal intfinal intfinal intfinal intfinal intprotected final intfinal intprotected final intprotected final intprotected final intprotected final intfinal intfinal intfinal intfinal intintintintintintintintprotected final intfinal intprotected final intfinal intprotected final intfinal intfinal intfinal intfinal intprotected final intprotected final intprotected final intprotected final intfinal intfinal intprotected final intfinal intprotected final intfinal intprotected final intprotected final intprotected final intprotected final intprotected final intfinal intfinal intfinal intprotected final intfinal intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intprotected final intfinal intprotected final intprotected final intintintfinal intprotected final intintintprotected final intintintprotected final intintintprotected final intintintintintfinal intfinal intfinal intFields inherited from class BaseIntShader
camera, context, programModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.Cameracom.badlogic.gdx.graphics.g3d.utils.RenderContext -
Constructor Summary
ConstructorsConstructorDescriptionDefaultIntShader(IntRenderable renderable) DefaultIntShader(IntRenderable renderable, DefaultIntShader.Config config) DefaultIntShader(IntRenderable renderable, DefaultIntShader.Config config, ExtShaderProgram shaderProgram) DefaultIntShader(IntRenderable renderable, DefaultIntShader.Config config, String prefix) DefaultIntShader(IntRenderable renderable, DefaultIntShader.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 voidbindLights(IntRenderable renderable, Attributes attributes) protected voidbindMaterial(Attributes attributes) 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, DefaultIntShader.Config config) voiddispose()voidend()Cleanup the context so other shaders can render.booleanequals(DefaultIntShader obj) booleanintintstatic Stringstatic Stringvoidinit()Initializes the IntShader, must be called before the IntShader can be used.voidrender(IntRenderable renderable, Attributes combinedAttributes) 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) Renders theIntRenderable, must be called betweenIntShader.begin(Camera, RenderContext)andIntShader.end().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
-
u_projTrans
public final int u_projTrans -
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_time
public final int u_time -
u_simuTime
public final int u_simuTime -
u_cameraPos
public final int u_cameraPos -
u_vrScale
public final int u_vrScale -
u_vrOffset
public final int u_vrOffset -
u_eclipseOutlines
public final int u_eclipseOutlines -
u_eclipsingBodyPos
public final int u_eclipsingBodyPos -
u_eclipsingBodyRadius
public final int u_eclipsingBodyRadius -
u_worldTrans
public final int u_worldTrans -
u_normalMatrix
public final int u_normalMatrix -
u_bones
public final int u_bones -
u_aoTexture
public final int u_aoTexture -
u_opacity
public final int u_opacity -
u_diffuseColor
public final int u_diffuseColor -
u_diffuseTexture
public final int u_diffuseTexture -
u_specularColor
public final int u_specularColor -
u_specularTexture
public final int u_specularTexture -
u_emissiveColor
public final int u_emissiveColor -
u_emissiveTexture
public final int u_emissiveTexture -
u_metallicColor
public final int u_metallicColor -
u_metallicTexture
public final int u_metallicTexture -
u_shininess
public final int u_shininess -
u_roughnessColor
public final int u_roughnessColor -
u_roughnessTexture
public final int u_roughnessTexture -
u_diffuseScatteringColor
public final int u_diffuseScatteringColor -
u_occlusionMetallicRoughnessTexture
public final int u_occlusionMetallicRoughnessTexture -
u_normalTexture
public final int u_normalTexture -
u_heightTexture
public final int u_heightTexture -
u_heightScale
public final int u_heightScale -
u_elevationMultiplier
public final int u_elevationMultiplier -
u_heightNoiseSize
public final int u_heightNoiseSize -
u_heightSize
public final int u_heightSize -
u_tessQuality
public final int u_tessQuality -
u_bodySize
public final int u_bodySize -
u_alphaTest
public final int u_alphaTest -
u_ior
public int u_ior -
u_iridescenceFactor
public int u_iridescenceFactor -
u_iridescenceIOR
public int u_iridescenceIOR -
u_iridescenceThicknessMin
public int u_iridescenceThicknessMin -
u_iridescenceThicknessMax
public int u_iridescenceThicknessMax -
u_iridescenceTexture
public int u_iridescenceTexture -
u_iridescenceThicknessTexture
public int u_iridescenceThicknessTexture -
u_thicknessTexture
public int u_thicknessTexture -
u_thicknessFactor
public int u_thicknessFactor -
u_volumeDistance
public int u_volumeDistance -
u_volumeColor
public int u_volumeColor -
u_volume0
protected final int u_volume0 -
u_volume1
protected final int u_volume1 -
u_volume2
protected final int u_volume2 -
u_volume3
protected final int u_volume3 -
u_volume0BoundsMin
public int u_volume0BoundsMin -
u_volume0BoundsMax
public int u_volume0BoundsMax -
u_volume1BoundsMin
public int u_volume1BoundsMin -
u_volume1BoundsMax
public int u_volume1BoundsMax -
u_volume2BoundsMin
public int u_volume2BoundsMin -
u_volume2BoundsMax
public int u_volume2BoundsMax -
u_volume3BoundsMin
public int u_volume3BoundsMin -
u_volume3BoundsMax
public int u_volume3BoundsMax -
u_reflectionCubemap
protected final int u_reflectionCubemap -
u_diffuseCubemap
protected final int u_diffuseCubemap -
u_normalCubemap
protected final int u_normalCubemap -
u_specularCubemap
protected final int u_specularCubemap -
u_emissiveCubemap
protected final int u_emissiveCubemap -
u_heightCubemap
protected final int u_heightCubemap -
u_roughnessCubemap
protected final int u_roughnessCubemap -
u_metallicCubemap
protected final int u_metallicCubemap -
u_aoCubemap
protected final int u_aoCubemap -
u_svtTileSize
protected final int u_svtTileSize -
u_svtResolution
protected final int u_svtResolution -
u_svtDepth
protected final int u_svtDepth -
u_svtId
protected final int u_svtId -
u_svtDetectionFactor
protected final int u_svtDetectionFactor -
u_svtBufferTexture
protected final int u_svtBufferTexture -
u_svtIndirectionDiffuseTexture
protected final int u_svtIndirectionDiffuseTexture -
u_svtIndirectionSpecularTexture
protected final int u_svtIndirectionSpecularTexture -
u_svtIndirectionNormalTexture
protected final int u_svtIndirectionNormalTexture -
u_svtIndirectionHeightTexture
protected final int u_svtIndirectionHeightTexture -
u_svtIndirectionEmissiveTexture
protected final int u_svtIndirectionEmissiveTexture -
u_svtIndirectionMetallicTexture
protected final int u_svtIndirectionMetallicTexture -
u_svtIndirectionRoughnessTexture
protected final int u_svtIndirectionRoughnessTexture -
u_svtIndirectionAoTexture
protected final int u_svtIndirectionAoTexture -
u_kmToU
protected final int u_kmToU -
u_generic1
protected final int u_generic1 -
u_generic2
protected final int u_generic2 -
u_texture0
protected final int u_texture0 -
u_texture1
protected final int u_texture1 -
u_csmTransforms
public int[] u_csmTransforms -
u_csmSamplers
public int[] u_csmSamplers -
u_csmClip
public int[] u_csmClip -
u_csmPCF
public int u_csmPCF -
u_ambientCubemap
protected final int u_ambientCubemap -
u_dirLights0color
protected final int u_dirLights0color -
u_dirLights0direction
protected final int u_dirLights0direction -
u_dirLights1color
protected final int u_dirLights1color -
u_pointLights0color
protected final int u_pointLights0color -
u_pointLights0position
protected final int u_pointLights0position -
u_pointLights0intensity
protected final int u_pointLights0intensity -
u_pointLights1color
protected final int u_pointLights1color -
u_fogColor
protected final int u_fogColor -
u_shadowMapProjViewTrans
protected final int u_shadowMapProjViewTrans -
u_shadowMapProjViewTransGlobal
protected final int u_shadowMapProjViewTransGlobal -
u_shadowTexture
protected final int u_shadowTexture -
u_shadowTextureGlobal
protected final int u_shadowTextureGlobal -
u_shadowPCFOffset
protected final int u_shadowPCFOffset -
lighting
protected final boolean lighting -
shadowMap
protected final boolean shadowMap -
directionalLights
protected final com.badlogic.gdx.graphics.g3d.environment.DirectionalLight[] directionalLights -
pointLights
protected final com.badlogic.gdx.graphics.g3d.environment.PointLight[] pointLights -
attributesMask
-
config
-
dirLightsLoc
protected int dirLightsLoc -
dirLightsColorOffset
protected int dirLightsColorOffset -
dirLightsDirectionOffset
protected int dirLightsDirectionOffset -
dirLightsSize
protected int dirLightsSize -
pointLightsLoc
protected int pointLightsLoc -
pointLightsColorOffset
protected int pointLightsColorOffset -
pointLightsPositionOffset
protected int pointLightsPositionOffset -
pointLightsIntensityOffset
protected int pointLightsIntensityOffset -
pointLightsSize
protected int pointLightsSize
-
-
Constructor Details
-
DefaultIntShader
-
DefaultIntShader
-
DefaultIntShader
-
DefaultIntShader
public DefaultIntShader(IntRenderable renderable, DefaultIntShader.Config config, String prefix, String vertexShader, String fragmentShader) -
DefaultIntShader
public DefaultIntShader(IntRenderable renderable, DefaultIntShader.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
-
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
- Overrides:
renderin classBaseIntShader
-
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
-
bindLights
-
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)
-