Search in sources :

Example 1 with ParticleDataSpriteComponent

use of org.terasology.engine.particles.components.ParticleDataSpriteComponent in project Terasology by MovingBlocks.

the class SpriteParticleRenderer method drawParticles.

public void drawParticles(Material material, ParticleRenderingData<ParticleDataSpriteComponent> particleSystem) {
    ParticleDataSpriteComponent particleData = particleSystem.particleData;
    if (particleSystem.particleData.texture != null) {
        material.setBoolean("use_texture", true);
        material.setFloat2("texture_size", particleData.textureSize);
        material.setInt("texture_sampler", 0);
        GL13.glActiveTexture(GL13.GL_TEXTURE0);
        glBindTexture(GL11.GL_TEXTURE_2D, particleData.texture.getId());
    }
    particleSystem.particlePool.draw();
}
Also used : ParticleDataSpriteComponent(org.terasology.engine.particles.components.ParticleDataSpriteComponent)

Aggregations

ParticleDataSpriteComponent (org.terasology.engine.particles.components.ParticleDataSpriteComponent)1