Sign in to follow this  

Point sprites + lighting = Good idea?

This topic is 4730 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

I'm developing a particle engine and I was wondering what kind of performance I would get if I lit particles using DirectX lighting. Is it even possible to light point sprites? How would you do the normals for them? If it would bring my framerate to a crawl, what could I do to get the particles to blend in with the environment? I mean if I shoot someone in the dark, his blood shouldn't be a bright red. Another question. How should I handle particles that emit light, such as sparks? Should I make the base of the particle emitter be a positional light?

Share this post


Link to post
Share on other sites
I would say.. If its a dark scene then make the blood dark using Color lerp (between red and black) and disable lighting for particles.. I always just use position colored for my point sprite particles.

For a particle that emits light, I would just fake it and use a texture with an alpha blended 'halo' around a bright center point.

Share this post


Link to post
Share on other sites
Quote:
Original post by MikeyO
I would say.. If its a dark scene then make the blood dark using Color lerp (between red and black) and disable lighting for particles.. I always just use position colored for my point sprite particles.
...

Difficult to get the lerp factor though because you'd be doing the calculations rather than D3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by MikeyO
You could use Vector3.Subtract(lightPos, spritePosition).Length(), so the longer the vector, the darker it is, and visa versa.

That would simulate a point light with linear falloff, yes.
The DirectX documentation gives (or certainly used to give) the lighting equations for spotlights etc and how they work in great detail.

Share this post


Link to post
Share on other sites

This topic is 4730 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this