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

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

Introduction

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

Prototype

public void setUniform1fv(int location, float[] values, int offset, int length) 

Source Link

Usage

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

License:Open Source License

public void applyDynamicLights(ShaderProgram shader) {
    if (maxLightsPerModel == 0)
        return;/*from   w w w  . j a  va  2 s  . co  m*/
    shader.setUniform3fv("u_light_positions", positions, 0, maxLightsPerModel * 3);
    shader.setUniform3fv("u_light_colours", colors, 0, maxLightsPerModel * 3);
    shader.setUniform1fv("u_light_attenuations", attenuations, 0, maxLightsPerModel);
    shader.setUniform1fv("u_light_powers", powers, 0, maxLightsPerModel);
}

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

License:Apache License

/** Apply lights GLES2.0, call calculateLights before aplying */
public void applyLights(ShaderProgram shader) {
    shader.setUniform3fv("lightsPos", positions, 0, maxLightsPerModel * 3);
    shader.setUniform3fv("lightsCol", colors, 0, maxLightsPerModel * 3);
    shader.setUniform1fv("lightsInt", intensities, 0, maxLightsPerModel);
}