Example usage for com.badlogic.gdx.graphics.glutils ShaderProgram setUniformf

List of usage examples for com.badlogic.gdx.graphics.glutils ShaderProgram setUniformf

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ShaderProgram setUniformf.

Prototype

public void setUniformf(int location, float value1, float value2, float value3) 

Source Link

Usage

From source file:com.lyeeedar.Roguelike3D.Graphics.Lights.LightManager.java

License:Open Source License

public void applyAmbient(ShaderProgram shader) {
    shader.setUniformf("u_colour", ambientLight.r, ambientLight.g, ambientLight.b);
}

From source file:com.lyeeedar.Roguelike3D.Graphics.Materials.ColorAttribute.java

License:Open Source License

@Override
public void bind(ShaderProgram program, LightManager lights) {
    program.setUniformf(name, color.r, color.g, color.b);
}

From source file:de.redlion.badminton.render.LightManager.java

License:Apache License

public void applyGlobalLights(ShaderProgram shader) {
    shader.setUniformf("ambient", ambientLight.r, ambientLight.g, ambientLight.b);
    if (dirLight != null) {
        final Vector3 v = dirLight.direction;
        final Color c = dirLight.color;
        shader.setUniformf("dirLightDir", v.x, v.y, v.z);
        shader.setUniformf("dirLightCol", c.r, c.g, c.b);
    }/*from   w  w w.j  a  v a 2  s  .c o m*/
}

From source file:seventh.client.gfx.effects.ExplosionEffect.java

License:Open Source License

@Override
public void update(TimeStep timeStep) {

    /* Always clear out the data, this will get
     * overridden by the next loop if the explosion 
     * is active/*from  www  .  ja v  a  2 s. c  om*/
     */
    for (int i = 0; i < this.instances.length; i++) {
        this.shaderData[i] = -0.1f;
        this.shaderData[i + 1] = -0.1f;
        this.shaderData[i + 2] = 0;
    }

    int activeCount = 0;
    for (int i = 0; i < this.instances.length; i++) {
        this.instances[i].update(timeStep);

        if (this.instances[i].isActive()) {
            this.instances[i].set(shaderData, activeCount++);
        }
    }

    ShaderProgram shader = ExplosionEffectShader.getInstance().getShader();
    shader.begin();
    shader.setUniform3fv("shockData", this.shaderData, 0, this.shaderData.length);
    shader.setUniformf("shockParams", 10.0f, 0.08f, 0.1f);
    shader.end();

}