Flexman Posted January 8, 2014 Share Posted January 8, 2014 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). Quote 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 More sharing options...
Recommended Posts
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.