APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.shaders

public Class DefaultShader

extends BaseShader
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.graphics.g3d.shaders.DepthShader
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.Camera, .GL20, .VertexAttribute, .VertexAttributes.Usage, com.badlogic.gdx.graphics.g3d.Attribute, .Attributes, .Environment, .Renderable, .Shader, com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute, .ColorAttribute, .CubemapAttribute, .DepthTestAttribute, .DirectionalLightsAttribute, .FloatAttribute, .IntAttribute, .PointLightsAttribute, .SpotLightsAttribute, .TextureAttribute, com.badlogic.gdx.graphics.g3d.environment.AmbientCubemap, .DirectionalLight, .PointLight, .SpotLight, com.badlogic.gdx.graphics.g3d.utils.RenderContext, com.badlogic.gdx.graphics.glutils.ShaderProgram, com.badlogic.gdx.math.Matrix3, .Matrix4, .Vector3, com.badlogic.gdx.utils.Array, .GdxRuntimeException

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
protected final AmbientCubemap
protected final long
attributesMask

The attributes that this shader supports

private int[]
protected final DefaultShader.Config
public static int
defaultCullFace

Deprecated Replaced by Config#defaultCullFace Set to 0 to disable culling
public static int
defaultDepthFunc

Deprecated Replaced by Config#defaultDepthFunc Set to 0 to disable depth test
private static String
private static String
protected final DirectionalLight[]
protected int
protected int
protected int
protected int
protected final boolean
protected static long
protected final boolean
private boolean
private final Matrix3
private static final long
optionalAttributes

Attributes which are not required but always supported.

protected final PointLight[]
protected int
protected int
protected int
protected int
protected int
private Renderable
renderable

The renderable used to create this shader, invalid after the call to init

protected final boolean
protected final SpotLight[]
protected int
protected int
protected int
protected int
protected int
protected int
protected int
protected int
private final int
private float
private static final Attributes
private final Vector3
public final int
protected final int
public final int
public final int
public final int
public final int
public final int
public final int
public final int
public final int
public final int
public final int
protected final int
protected final int
protected final int
public final int
public final int
public final int
protected final int
protected final int
public final int
public final int
public final int
public final int
protected final int
protected final int
protected final int
protected final int
public final int
public final int
public final int
public final int
public final int
public final int
protected final int
protected final int
protected final int
public final int
public final int
public final int
public final int
protected final int
protected final int
protected final int
protected final int
protected final int
protected final int
protected final int
public final int
public final int
public final int
public final int
private final long
Inherited from com.badlogic.gdx.graphics.g3d.shaders.BaseShader:
cameracontextprogram

Constructor Summary

AccessConstructor and Description
public
DefaultShader(final Renderable renderable)

public
DefaultShader(final Renderable renderable, final DefaultShader.Config config)

public
DefaultShader(final Renderable renderable, final DefaultShader.Config config, final String prefix)

public
DefaultShader(final Renderable renderable, final DefaultShader.Config config, final String prefix, final String vertexShader, final String fragmentShader)

public
DefaultShader(final Renderable renderable, final DefaultShader.Config config, final ShaderProgram shaderProgram)

Method Summary

Modifier and TypeMethod and Description
private static final boolean
and(final long mask, final long flag)

public void
begin(final Camera camera, final RenderContext context)

Overrides com.badlogic.gdx.graphics.g3d.shaders.BaseShader.begin.

Implements com.badlogic.gdx.graphics.g3d.Shader.begin.

Initializes the context for exclusive rendering by this shader.

protected void
bindLights(final Renderable renderable, final Attributes attributes)

protected void
bindMaterial(final Attributes attributes)

public boolean
canRender(final Renderable renderable)

Implements com.badlogic.gdx.graphics.g3d.Shader.canRender.

Checks whether this shader is intended to render the Renderable.

private static final long
private static final Attributes
combineAttributes(final Renderable renderable)

public int
compareTo(Shader other)

Implements com.badlogic.gdx.graphics.g3d.Shader.compareTo.

Compare this shader against the other, used for sorting, light weight shaders are rendered first.

public static String
createPrefix(final Renderable renderable, final DefaultShader.Config config)

public void
public void
end()

Overrides com.badlogic.gdx.graphics.g3d.shaders.BaseShader.end.

Implements com.badlogic.gdx.graphics.g3d.Shader.end.

Cleanup the context so other shaders can render.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public boolean
public int
public int
public static String
public static String
public void
init()

Implements com.badlogic.gdx.graphics.g3d.Shader.init.

Initializes the Shader, must be called before the Shader can be used.

private static final boolean
or(final long mask, final long flag)

public void
public void
setDefaultCullFace(int cullFace)

public void
setDefaultDepthFunc(int depthFunc)

Inherited from com.badlogic.gdx.graphics.g3d.shaders.BaseShader:
getUniformAliasgetUniformIDhasinitlocregisterregisterregisterregisterregisterregisterrendersetsetsetsetsetsetsetsetsetsetsetsetsetsetset