normal mapping gpu particles ?

Started by
0 comments, last by Helo7777 11 years, 1 month ago

can some one point me in the direction so that i can use normal mapping on gpu particles please

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);).

This topic is closed to new replies.

Advertisement