List of usage examples for com.badlogic.gdx.graphics.glutils ShaderProgram setUniform3fv
public void setUniform3fv(int location, float[] values, int offset, int length)
From source file:com.lyeeedar.Roguelike3D.Graphics.Lights.LightManager.java
License:Open Source License
public void applyDynamicLights(ShaderProgram shader) { if (maxLightsPerModel == 0) return;// w w w . java 2 s. c om 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); }
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 w w w. jav a2s.c o m */ 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(); }