Jump to content
  • Advertisement
Sign in to follow this  

Particles + dot3 lighting + alpha blending...

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

Hey, A few days ago I had the crazy idea to make particle effects look even better - especially for smoke. I was thinking that you could use a normal/bump map on the particle texture to give each particle a bit more depth (using per pixel lighting). Does anyone have any idea what this would look like? Has this been done before? I think it could be quite interesting to see. I would throw together a demo if I wasn't so involved in school.

Share this post


Link to post
Share on other sites
Advertisement
I answer this from having used Direct3D's point-sprites for particle rendering, but isn't a typical particle rendered in screen-space as a billboard/imposter?

Provided that assertion is correct, your idea for per-pixel lighting falls apart a bit? I'm sure you could work around it - but the basic geometry is in screen space rather than work space, thus making converting the lighting vectors and so on a bit trickier?

[EDIT]
Actually, I suppose if you could pass your geometry through a shader you could work out the correct tangents/binormals and other funky stuff needed, and you obviously have the direction/distance from the light source..
[/EDIT]

Cheers,
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
I answer this from having used Direct3D's point-sprites for particle rendering, but isn't a typical particle rendered in screen-space as a billboard/imposter?

I am not 100% sure what you mean by this, but the particle system wouldn't necessarily have to be based on Pointsprites. Also, the particles would be treated just like any other 3D object - transformed from model space to world space, etc.

Quote:

Provided that assertion is correct, your idea for per-pixel lighting falls apart a bit? I'm sure you could work around it - but the basic geometry is in screen space rather than work space, thus making converting the lighting vectors and so on a bit trickier?

I would basically be supplying a normal map or bump map for each particle. That way any point/spot lights would effect the lighting of each particle differently. I think I know what you are getting at though.

Share this post


Link to post
Share on other sites
Quote:
I think I know what you are getting at though.

At least someone has some idea of what I'm on about [wink].

Quote:
the particle system wouldn't necessarily have to be based on Pointsprites.

That was both my assumption and my exception.

In D3D, with PSprites, you specify a point list and it transforms it to screen space and then generates a quad around it (again, in screen space) - to my knowledge none of these 4 verticies are anything more than 2D Quad's. Thus, if you applied a vertex/pixel shader that worked on the final geometry (and not the intermediary) you run into the problem I stated.

As I corrected myself, after thinking some more about it, I'm pretty sure it would be possible - just might be a bit more work on your part (no PSprite freebies).

Jack

Share this post


Link to post
Share on other sites
Yes, this is something we have proposed to several developers at various times. Also, if you make depth-correct sprites, it looks even better.

For instance, you can run a luminance filter on your smoke particle, and then use this as a height value to modify the depth of the particle on a per-fragment basis. It's slower than regular rendering, so if you are gpu bound, you can do non-depth correct rendering when you are far from a solid object, and turn it on when you get close to something.

Share this post


Link to post
Share on other sites
I think it would be interesting to experiment with this. Thanks for the feedback so far!

(I also think it would be interesting to do Cubic gloss mapping (on an object, but that is perhaps a whole nother discussion.)

Share this post


Link to post
Share on other sites
Quote:
Original post by SimmerD
Yes, this is something we have proposed to several developers at various times. Also, if you make depth-correct sprites, it looks even better.

Clever, I like the sound of that - don't suppose you have any screenshots/presentations demonstrating this sort of thing??

With regards to particle rendering - one thing I've always wanted to try in realtime (to my knowledge, no one else has tried) is shadowing (especically self shadowing).

I saw a few screenshots from an offline ray-tracer some years back where there were two scenes... the first was a nightclub with that fake smoke they pump out that picked out all the edges of the spotlights being used. The other was a simple statue in a graveyard and a bit of moonlight - and the way that the fog almost seems to disappear in the statue's shadow. Looked very nifty.

Jack

Share this post


Link to post
Share on other sites
I am considering adding these three effects to my engine as high-end features. I already have pretty nice smoke that hugs walls, responds to the wind, etc. but adding a bit of lighting, and possibly depth-correction would be good.

Since I am doing fake black on white background shadows, this makes translucent shadows easy.

Come to think of it, I bet you could do depth peeling from the light's POV to do translucent shadow maps...

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
With regards to particle rendering - one thing I've always wanted to try in realtime (to my knowledge, no one else has tried) is shadowing (especically self shadowing).


Link

A little ways down is an older demo by Humus that has shadows cast onto particles, which also cast shadows onto the ground. I don't believe it includes self-shadowing though (can't check right now, at work). It is pretty neat.

Share this post


Link to post
Share on other sites
Quote:
Original post by SimmerD
I am considering adding these three effects to my engine as high-end features. I already have pretty nice smoke that hugs walls, responds to the wind, etc. but adding a bit of lighting, and possibly depth-correction would be good.

Since I am doing fake black on white background shadows, this makes translucent shadows easy.

Come to think of it, I bet you could do depth peeling from the light's POV to do translucent shadow maps...

Wow, it sounds like you have quite the particle system! I am interested on how you do it...

I have always had some sort of strange fetish for particle systems. I thought it would look especially cool to use bump mapped particles with point/spot lights. It would give the smoke that added depth without having to use a hoard of smaller particles. I think this is something I am going to have to play with.

Hey Kalidor, thanks for the link. I had run accross it before, but didn't trying running it. I will have to try running it when I get home.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!