Sign in to follow this  
Deathscythe

Can I use GLSL to achieve billboarded particles?

Recommended Posts

Deathscythe    139
Hi, I'm trying to write a particle engine for my game project. I've been having trouble achieving good spherical billboarding for the particles. I've been calculating a billboarding matrix and then using that as one of the transformations. The results have not been very accurate. My game also makes use of GLSL shaders. I was wondering if there was a why to leverage the vertex shaders to achieve spherical billboarding. I was thinking something along the lines of: gl_Position = gl_ProjectionMatrix * gl_ModelMatirx * gl_Vertex; The theory is to remove the View Matrix for the transformations. Would this work? Is there something else anyone could suggest? Thanks in advance

Share this post


Link to post
Share on other sites
JavaCoolDude    670
I have done something like that in the past where I for every particle quad in my emitter, I assigned 3 texture coordinates uvw instead of uv where w holds the index of some constant coefficitents that multiplied the right and up vector of the current view matrix to achieve billboarding.
Didn't offer any performance boosts sadly :/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this