Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

normal mapping gpu particles ?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 the dodger uk   Members   

148
Like
0Likes
Like

Posted 15 March 2013 - 03:33 PM

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



#2 Nyssa   GDNet+   

691
Like
0Likes
Like

Posted 15 March 2013 - 07:06 PM

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, 15 March 2013 - 07:19 PM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.