Jump to content

LE2.5x - Particle Verts


Flexman
 Share

Recommended Posts

I'm guessing Josh knows the answer to this and probably pretty busy atm, but I'll throw this out here in case someone can tell me.

 

Modifying particles.vert to create an emitter commonly used for clouds and smoke trails.

 

 

Trying to determine a lighting normal based on the vertex position so a particle quad on the opposite side to a light source (the sun) is darker. I'm computing the lighting normal in particles.vert using the following....

 

float Lnorm = dot(normalize(-LightSource.xyz), normalize(- vertpos.xyz)); // compute lighting normal
...
...
gl_FrontColor.xyz = mix( outcolor.xyz , vec3(0.0) , Lnorm); // finally set the vertex color

 

I'm missing something in the way the verts in an emitter object are constructed. Or my math is just plain wrong. Or both. But I think I'm having trouble because the verts are computed in camera space, not model space (as particles are just points).

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...