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, RelativisticShader

public class DefaultIntShader extends BaseIntShader
  • Field Details

    • implementedFlags

      protected static long implementedFlags
    • defaultCullFace

      @Deprecated public static int defaultCullFace
      Deprecated.
      Replaced by DefaultIntShader.Config.defaultCullFace Set to 0 to disable culling
    • defaultDepthFunc

      @Deprecated public static int defaultDepthFunc
      Deprecated.
      Replaced by DefaultIntShader.Config.defaultDepthFunc Set to 0 to disable depth test
    • 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_time

      public final int u_time
    • u_prevProjView

      public final int u_prevProjView
    • u_dCamPos

      public final int u_dCamPos
    • u_vrScale

      public final int u_vrScale
    • 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
    • u_bones

      public final int u_bones
    • u_shininess

      public final int u_shininess
    • 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_nightTexture

      public final int u_nightTexture
    • u_reflectionColor

      public final int u_reflectionColor
    • u_reflectionTexture

      public final int u_reflectionTexture
    • u_normalTexture

      public final int u_normalTexture
    • u_ambientTexture

      public final int u_ambientTexture
    • u_heightTexture

      public final int u_heightTexture
    • u_heightScale

      public final int u_heightScale
    • u_heightNoiseSize

      public final int u_heightNoiseSize
    • u_heightSize

      public final int u_heightSize
    • u_tessQuality

      public final int u_tessQuality
    • u_alphaTest

      public final int u_alphaTest
    • u_ambientCubemap

      protected final int u_ambientCubemap
    • u_environmentCubemap

      protected final int u_environmentCubemap
    • 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_spotLights0color

      protected final int u_spotLights0color
    • u_spotLights0position

      protected final int u_spotLights0position
    • u_spotLights0intensity

      protected final int u_spotLights0intensity
    • u_spotLights0direction

      protected final int u_spotLights0direction
    • u_spotLights0cutoffAngle

      protected final int u_spotLights0cutoffAngle
    • u_spotLights0exponent

      protected final int u_spotLights0exponent
    • u_spotLights1color

      protected final int u_spotLights1color
    • u_fogColor

      protected final int u_fogColor
    • u_shadowMapProjViewTrans

      protected final int u_shadowMapProjViewTrans
    • u_shadowTexture

      protected final int u_shadowTexture
    • u_shadowPCFOffset

      protected final int u_shadowPCFOffset
    • 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
    • spotLightsLoc

      protected int spotLightsLoc
    • spotLightsColorOffset

      protected int spotLightsColorOffset
    • spotLightsPositionOffset

      protected int spotLightsPositionOffset
    • spotLightsDirectionOffset

      protected int spotLightsDirectionOffset
    • spotLightsIntensityOffset

      protected int spotLightsIntensityOffset
    • spotLightsCutoffAngleOffset

      protected int spotLightsCutoffAngleOffset
    • spotLightsExponentOffset

      protected int spotLightsExponentOffset
    • spotLightsSize

      protected int spotLightsSize
    • lighting

      protected final boolean lighting
    • environmentCubemap

      protected final boolean environmentCubemap
    • shadowMap

      protected final boolean shadowMap
    • ambientCubemap

      protected final com.badlogic.gdx.graphics.g3d.environment.AmbientCubemap ambientCubemap
    • directionalLights

      protected final com.badlogic.gdx.graphics.g3d.environment.DirectionalLight[] directionalLights
    • pointLights

      protected final com.badlogic.gdx.graphics.g3d.environment.PointLight[] pointLights
    • spotLights

      protected final com.badlogic.gdx.graphics.g3d.environment.SpotLight[] spotLights
    • attributesMask

      protected final long attributesMask
      The attributes that this shader supports
    • config

      protected final DefaultIntShader.Config config
  • Constructor Details

  • Method Details

    • getDefaultVertexShader

      public static String getDefaultVertexShader()
    • getDefaultFragmentShader

      public static String getDefaultFragmentShader()
    • init

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

      public static String createPrefix(IntRenderable renderable, DefaultIntShader.Config config)
    • canRender

      public boolean canRender(IntRenderable renderable)
      Description copied from interface: IntShader
      Checks whether this shader is intended to render the IntRenderable. Use this to make sure a call to the IntShader.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

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(DefaultIntShader obj)
    • begin

      public void begin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context)
      Description copied from interface: IntShader
      Initializes the context for exclusive rendering by this shader. Use the IntShader.render(IntRenderable) method to render a IntRenderable. When done rendering the IntShader.end() method must be called.
      Specified by:
      begin in interface IntShader
      Overrides:
      begin in class BaseIntShader
      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 IntShader.end() method.
    • render

      public void render(IntRenderable renderable, com.badlogic.gdx.graphics.g3d.Attributes combinedAttributes)
      Overrides:
      render in class BaseIntShader
    • end

      public void end()
      Description copied from interface: IntShader
      Cleanup the context so other shaders can render. Must be called when done rendering using the IntShader.render(IntRenderable) method, which must be preceded by a call to IntShader.begin(Camera, RenderContext). After a call to this method an call to the IntShader.render(IntRenderable) method will fail until the IntShader.begin(Camera, RenderContext) is called.
      Specified by:
      end in interface IntShader
      Overrides:
      end in class BaseIntShader
    • bindMaterial

      protected void bindMaterial(com.badlogic.gdx.graphics.g3d.Attributes attributes)
    • bindLights

      protected void bindLights(IntRenderable renderable, com.badlogic.gdx.graphics.g3d.Attributes attributes)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class BaseIntShader
    • getDefaultCullFace

      public int getDefaultCullFace()
    • setDefaultCullFace

      public void setDefaultCullFace(int cullFace)
    • getDefaultDepthFunc

      public int getDefaultDepthFunc()
    • setDefaultDepthFunc

      public void setDefaultDepthFunc(int depthFunc)