🔒 Locked
References Soft Particles
Advertisement
Original Post
i havent the sdk so can only guess what soft particles are but i assume
frag_depth = fragcoord.z + texture2d( particle_tex, tc );
ie u alter the depth based on a height/depth component in the particles texture
though u will prolly need a better implentation than a simple addition since the depthbuffer aint linear.
personally i found whilst it does improve the look, it costs to much performance
frag_depth = fragcoord.z + texture2d( particle_tex, tc );
ie u alter the depth based on a height/depth component in the particles texture
though u will prolly need a better implentation than a simple addition since the depthbuffer aint linear.
personally i found whilst it does improve the look, it costs to much performance
I beleive soft particles are a volumetric particle rendering technique. Crytek uses them alot. The had a presentation at Siggraph this year, the didn't really explain how they worked really (either that or I missed it :). The showed how it made for much better interaction with the geometry (it avoided the hard edges you see when normal particles are clipped with the floor plane).
If anyone has a more info than that I'd be interested too.
If anyone has a more info than that I'd be interested too.
AFAIK soft particles just get transparent at the intersections with the world geometry. I think this is achieved by rendering the scenes's depth to a texture and when rendering the particles adjust the transparency according to the difference between the particles depth and the one from the scene depth.
regards,
m4gnus
regards,
m4gnus
Ahh that makes sense. The rest of the presentation was about the various "deffered rendering" style effects they do with a depth texture (the use this for all their atmospheric effects).
Quote:
Original post by wolf
Yep I was sitting in there :-) ...
So.. were you sleeping ? :)
Each particle is attached a certain "depth" property (nothing to do with depth write in the pixel shader which kills early-Z etc..), then the pixel shader has the nearest opaque object Z as an input. It then takes the difference between the current particle z and the nearest object z, divide it by the depth property value, clamp it to the one and to zero (for negative values, though they shouldn't be drawn anyway), and then modulate alpha with this value.
This way a particle will have a softer look as it comes closer to an object until it disappears completely at an intersection, preventing rough edges.
LeGreg
Quote:
Original post by LeGreg
Each particle is attached a certain "depth" property (nothing to do with depth write in the pixel shader which kills early-Z etc..), then the pixel shader has the nearest opaque object Z as an input. It then takes the difference between the current particle z and the nearest object z, divide it by the depth property value, clamp it to the one and to zero (for negative values, though they shouldn't be drawn anyway), and then modulate alpha with this value.
cheers for that, seems very simple to do, though i wont do it with my game due to the performance hit, ill keep it in mind though
Quote:
Original post by LeGreg Quote:
Original post by wolf
Yep I was sitting in there :-) ...
So.. were you sleeping ? :)
Each particle is attached a certain "depth" property (nothing to do with depth write in the pixel shader which kills early-Z etc..), then the pixel shader has the nearest opaque object Z as an input. It then takes the difference between the current particle z and the nearest object z, divide it by the depth property value, clamp it to the one and to zero (for negative values, though they shouldn't be drawn anyway), and then modulate alpha with this value.
This way a particle will have a softer look as it comes closer to an object until it disappears completely at an intersection, preventing rough edges.
LeGreg
So, i guess that you need to make a depth texture from the depth buffer at the current frame? (depth texture to be fed into ps)
Quote:
Original post by grunt123
So, i guess that you need to make a depth texture from the depth buffer at the current frame? (depth texture to be fed into ps)
Almost all atmospheric effects in their renderer relies on a pixel shader pre pass that draws only Z (or more exactly distance to far plane) to a r32f or argb8 texture.
Only problem is : it doesn't work well with antialiasing. And it doesn't work too well with semi transparent objects either (the prepass only stores one z value per pixel).
LeGreg
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement