Archived

This topic is now archived and is closed to further replies.

Supernat02

Point Sprite Light

Recommended Posts

I have a point sprite that I want to be affected by light, but I also want it to be affected by diffuse color. Do I have to use 2 texture stages for this or is it even possible? i.e. 1) No light, no point sprite. 2) Full Light: A) Black diffuse color, then no point sprite visible B) White diffuse color, full sprite visible C) Pure Green diffuse color, only green sprite visible. I want my scene to be able to be dark, but I want the point sprites to be dark during this time as well. The other thing is, with a light on the point sprite, which has no normals, nothing is reflected. What are my options there? Can I make point sprites with normals? Seems kind of strange since they always face the view...but I don''t even know if you are allowed to put that into the structure. Thanks, Chris

Share this post


Link to post
Share on other sites
You could try using camera aligned quads instead of point sprites. This way, you can calculate lighting the same as any other triangle. You could also try to perform a kind of manual lighting hack in a vertex shader, but I''m not sure if you can use vertex shaders with point sprites.

---------------------------------------

Let''s struggle for our dream of Game!

http://andrewporritt.4t.com

Share this post


Link to post
Share on other sites
I determine which way is supported, point sprites, shader, or lastly quads. Then I use that method for all particles.

I''m trying to stay away from quads because of the performance issues, and the particle system will be mostly used for small, large amounts of particles. My shader is a good in-between to the quads and the point sprites, but the point sprites are by far the fastest and probably more supported by vid cards.

I figured it out with the shader and quads, but the point sprites don''t do what I''d expect. I guess next time I work on it, I''m going to try to put normals in the point sprite structure and see what happens! I''ll post if it works. Feel free to post if it won''t, so I don''t waste my time. And all other suggestions are appreciated.

Thanks!
Chris

Share this post


Link to post
Share on other sites