Followers 0

# normal mapping gpu particles ?

## 1 post in this topic

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

0

##### Share on other sites

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
0

## Create an account

Register a new account

Followers 0

• 28
• 14
• 11
• 31
• 20