Cloud/smoke/thing algorithm(well, vague idea) that's probably too slow/looks crappy.

Started by
26 comments, last by cowsarenotevil 20 years, 6 months ago
Does this sound at all plausible? OK, your scene is rendered normally with one pass (without vaporous objects) and then the clouds in view are rendered as white on black (You'd need some kind of sorting, or to render the rest of the scene in yet another pass in black to cover the clouds) to a texture/backbuffer. Then you use the fastest blur filter you can think of on this backbuffer, and render it over the original scene( - clouds) with some type of addative blending. It seems to me that this would be too slow, but what do you think? [edited by - cowsarenotevil on October 9, 2003 8:09:09 PM]
-~-The Cow of Darkness-~-
Advertisement
Hmm.... a few issues I can think of:

* occlusion: after the blur, clouds will show on the edge of occluded objects. If you have a smoke plume 20 feet away, and a flagpole 10 feet away, you want the edge between the flagpole and the plume to be sharp; but it would be blurred.

* blurring: fast blurs don''t tend to blur very much.

* blending: the blending should not be additive. That''s not how smoke works. Smoke is a partially opaque object, and should be rendered as such. That part wouldn''t be too hard to fix, tho.

How appropriate. You fight like a cow.
Yes, those are very good points. I just picked additive blending because it would be fastest, you could also mask a solid gray, or even a shaded version of the model onto it (this could look cool for ghosts, if nothing else ). The occlusion is definately a good point, but that I''ll work out last, because it would still work somewhat without it, and it hurts my brain too much right now. Perhaps for the blur you could do a random noise thing, and then average pixels in close proximity, but if it''s not already obvious, fast image filtering is not something I know anything about
-~-The Cow of Darkness-~-
Actually, if the occlusion thing were fixed, this could conceivably be very interesting for ghost/spirit effects. After all, the single accumulation pass would mean that ghosts wouldn''t show through each other, which tends to be the convention in most films. That could be cool.

How appropriate. You fight like a cow.
Yeah, it could... I pondered the occlusion, and it seems that the way to do it would be to blur into the white area, but not out. So that nothing could possibly be covered with white that wasn't covered with the original objects, and it would also be more realistic in that the models wouldn't get bigger (and if you didn't like that, you could just make your models fatter to begin with).

EDIT: Though this would create a "dent" in the object where it's occluded, but it probably would still look better.

[edited by - cowsarenotevil on October 10, 2003 6:38:05 PM]
-~-The Cow of Darkness-~-
>>* blurring: fast blurs don''t tend to blur very much.

Well, this depends. Summed area tables (google for more information) can do box filter blurs of arbitrary size, with arbitrary blur coefficient for each pixel. And that''s just four table lookups per pixel (depth of field has been done in realtime with this method, in a pixelshader).

Of course blurring in the image space doesn''t give perfect results but that''s not what people expect of games.

- Mikko Kauppila
OMG I just had teh sudden inspiration. All right, so instead of bluring anything, you''d simply make the "white" polygons shaded with a head-on diffuse light. That would probably be a good enough aproximation, and you wouldn''t have to deal with occlusion at all. And it''d be fast. I think I''m going to patent this
-~-The Cow of Darkness-~-
quote:Original post by cowsarenotevil
OMG I just had teh sudden inspiration. All right, so instead of bluring anything, you''d simply make the "white" polygons shaded with a head-on diffuse light. That would probably be a good enough aproximation, and you wouldn''t have to deal with occlusion at all. And it''d be fast. I think I''m going to patent this


Huh, interesting... so you''d rely on the curvature of the object edges to effect the blur? That could work very well for relatively high-poly meshes of organic objects (less so for objects with angular edges).

How appropriate. You fight like a cow.
quote:Original post by Sneftel
quote:Original post by cowsarenotevil
OMG I just had teh sudden inspiration. All right, so instead of bluring anything, you''d simply make the "white" polygons shaded with a head-on diffuse light. That would probably be a good enough aproximation, and you wouldn''t have to deal with occlusion at all. And it''d be fast. I think I''m going to patent this


Huh, interesting... so you''d rely on the curvature of the object edges to effect the blur? That could work very well for relatively high-poly meshes of organic objects (less so for objects with angular edges).


Yeah, that was what I was thinking. For sharper objects, you could use smooth normals to improve it a bit, but you must remember, most vapours aren''t particularly angular now for the implementation...
-~-The Cow of Darkness-~-
UPDATE: It looks, um, weird... I tried it with the teapot (yes, I cheated and used photoshop if you''re wondering how I did it so fast... but it gives the effect very clearly) and it looks mostly good, except the handle and spout look awful (they''re not really attached to the teapot, which is why) and the base isn''t that great, because the angle is slightly sharper. But nevertheless, it looks good, and with relatively curvy objects (clouds, smoke, even ghosts if modeled well) it should be fine.
-~-The Cow of Darkness-~-

This topic is closed to new replies.

Advertisement