Particles + dot3 lighting + alpha blending...

Started by
11 comments, last by Moe 19 years, 2 months ago
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.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.
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.)
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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...
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.
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.

This topic is closed to new replies.

Advertisement