Search in sources :

Example 1 with IQuadRenderable

use of gaiasky.render.IQuadRenderable in project gaiasky by langurmonkey.

the class BillboardSpriteRenderSystem method renderStud.

@Override
public void renderStud(Array<IRenderable> renderables, ICamera camera, double t) {
    if ((ctIndex < 0 || alphas[ctIndex] != 0)) {
        renderables.sort(comp);
        ExtShaderProgram shaderProgram = getShaderProgram();
        shaderProgram.begin();
        // Global uniforms
        shaderProgram.setUniformMatrix("u_projView", camera.getCamera().combined);
        shaderProgram.setUniformf("u_time", (float) t);
        // Rel, grav, z-buffer
        addEffectsUniforms(shaderProgram, camera);
        // Render each sprite
        renderables.forEach(r -> {
            IQuadRenderable s = (IQuadRenderable) r;
            s.render(shaderProgram, getAlpha(s), mesh, camera);
        });
        shaderProgram.end();
    }
}
Also used : IQuadRenderable(gaiasky.render.IQuadRenderable) ExtShaderProgram(gaiasky.util.gdx.shader.ExtShaderProgram)

Example 2 with IQuadRenderable

use of gaiasky.render.IQuadRenderable in project gaiasky by langurmonkey.

the class BillboardStarRenderSystem method renderStud.

@Override
public void renderStud(Array<IRenderable> renderables, ICamera camera, double t) {
    if ((ctIndex < 0 || alphas[ctIndex] != 0)) {
        renderables.sort(comp);
        ExtShaderProgram shaderProgram = getShaderProgram();
        shaderProgram.begin();
        if (texture0 != null) {
            texture0.bind(0);
            shaderProgram.setUniformi("u_texture0", 0);
        }
        // General uniforms
        shaderProgram.setUniformMatrix("u_projView", camera.getCamera().combined);
        // Rel, grav, z-buffer
        addEffectsUniforms(shaderProgram, camera);
        // Global uniforms
        shaderProgram.setUniformf("u_time", (float) t);
        renderables.forEach(r -> {
            IQuadRenderable s = (IQuadRenderable) r;
            s.render(shaderProgram, getAlpha(s), mesh, camera);
        });
        shaderProgram.end();
    }
}
Also used : IQuadRenderable(gaiasky.render.IQuadRenderable) ExtShaderProgram(gaiasky.util.gdx.shader.ExtShaderProgram)

Aggregations

IQuadRenderable (gaiasky.render.IQuadRenderable)2 ExtShaderProgram (gaiasky.util.gdx.shader.ExtShaderProgram)2