public final boolean set (final int uniform, final Matrix4 value) { if (locations[uniform] < 0) return false; program.setUniformMatrix(locations[uniform], value); return true; }
public final boolean set (final int uniform, final Matrix3 value) { if (locations[uniform] < 0) return false; program.setUniformMatrix(locations[uniform], value); return true; }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix */ public void setUniformMatrix (String name, Matrix4 matrix) { setUniformMatrix(name, matrix, false); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix */ public void setUniformMatrix (String name, Matrix4 matrix) { setUniformMatrix(name, matrix, false); }
public final boolean set (final int uniform, final Matrix3 value) { if (locations[uniform] < 0) return false; program.setUniformMatrix(locations[uniform], value); return true; }
public final boolean set (final int uniform, final Matrix4 value) { if (locations[uniform] < 0) return false; program.setUniformMatrix(locations[uniform], value); return true; }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix */ public void setUniformMatrix (String name, Matrix3 matrix) { setUniformMatrix(name, matrix, false); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix */ public void setUniformMatrix (String name, Matrix3 matrix) { setUniformMatrix(name, matrix, false); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix (String name, Matrix3 matrix, boolean transpose) { setUniformMatrix(fetchUniformLocation(name), matrix, transpose); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix * @param transpose whether the matrix should be transposed */ public void setUniformMatrix (String name, Matrix4 matrix, boolean transpose) { setUniformMatrix(fetchUniformLocation(name), matrix, transpose); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix * @param transpose whether the matrix should be transposed */ public void setUniformMatrix (String name, Matrix4 matrix, boolean transpose) { setUniformMatrix(fetchUniformLocation(name), matrix, transpose); }
/** Sets the uniform matrix with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param matrix the matrix * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix (String name, Matrix3 matrix, boolean transpose) { setUniformMatrix(fetchUniformLocation(name), matrix, transpose); }
private void renderMesh (ShaderProgram shader, Matrix4 cam, Matrix4 projector, Matrix4 model, Mesh mesh, Color color) { position.set(this.projector.position); modelNormal.set(model).toNormalMatrix(); shader.setUniformMatrix("u_camera", cam); shader.setUniformMatrix("u_projector", projector); shader.setUniformf("u_projectorPos", position.x, position.y, position.z); shader.setUniformMatrix("u_model", model); shader.setUniformMatrix("u_modelNormal", modelNormal); shader.setUniformf("u_color", color.r, color.g, color.b); shader.setUniformi("u_texture", 0); mesh.render(shader, GL20.GL_TRIANGLES); }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
@Override public void beforeGroups () { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); shader.begin(); shader.setUniformMatrix("u_projectionViewMatrix", camera.combined); shader.setUniformi("u_texture", 0); }
@Override public void begin (Camera camera, RenderContext context) { this.context = context; shaderProgram.begin(); shaderProgram.setUniformMatrix("u_projViewTrans", camera.combined); context.setDepthTest(GL20.GL_LEQUAL); context.setCullFace(GL20.GL_BACK); }
@Override public void beforeGroups () { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); shader.begin(); shader.setUniformMatrix("u_projectionViewMatrix", camera.combined); shader.setUniformi("u_texture", 0); }