• Advertisement
Sign in to follow this  

normal mapping gpu particles ?

This topic is 1775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

Have you got textured particles working first? I'll assume you have....

 

If you haven't already tried normal mapping, a quick google search for "normal map directx" will turn up alot of working normal mapping example to get you started on normal mapping a regular mesh.

 

After that, creating normal mapped particles is a simple extension of this. Your particle vertices and texture coordinates are made up from something similar to:

float2 textureCoords[4] = {float2(0.0, 0.0), float2(1.0, 0.0), float2(1.0, 1.0), float2(0.0, 1.0)};
float2 cornerPosition[4] = {float2(-0.5, 0.5), float2(0.5, 0.5), float2(0.5, -0.5), float2(-0.5, -0.5)};

 

You would transform each particles cornerPosition into world space.Tangents (for normal mapping) for your vertices can be created using the tutorial here. The surface normal for each particle will always need to be in the direction of the light source I think (surfaceNormal = normalize(lightPos - particlePos);). 

Edited by Nyssa

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement