Page 1 of 1
Environmental Effects Through Shaders?
Posted: Mon Aug 22, 2005 6:01 am
by Morari
I’m currently working on an arctic themed level and am curious if it would be plausible to create the effect of falling snow with shaders? I’ve done this in the past for other effects, such as rain, but never in such a large area. Before I had merely created several brushes and sloppily crisscrossed them everywhere within a small room. With this level however I am filling a rather large courtyard that can be seen from almost everywhere in the map, so I’m worried about the FPS.
Since Quake3 does not natively have any world spawn environmental effects that I am aware of (even though several mods and games based on the engine do), I was thinking that it might be worthwhile to create a shader of falling snow but do it more in the style of the game's fog. What I mean is that when applying the falling snow shader to a brush it only creates the wanted visual along the outside of said brush, fog on the other hand fills the brush. So would it be possible to do something more along those lines?
Posted: Mon Aug 22, 2005 8:58 am
by o'dium
Yes, its very possible. You will have to use a few different planes with different speed snow shaders on there, but it can work, its been done before.
Posted: Mon Aug 22, 2005 3:26 pm
by obsidian
You can't "fill" a brush with polygons or textiles, so whatever fog/snow shader you had in mind won't be possible.
Rain/snow has been done with planes as o'dium mentioned, but performance is rather slow due to the large number of transparent textile rendering passes. IOW, 5 planes will require 5x the number of rendering passes.
Better methods are to create vertical "strips" of rain/snow with
tcMod scroll and
deformVertexes autosprite like the way Cardigan did in his map, Estatica. This significantly reduces the surface area of transparent textiles from overlapping. The textiles are scrolled down vertically along the polygon strips.
Alternatively, you can create particles of snow using
deformVertexes move and
deformVertexes autosprite2 to shift the the polygons themselves. This method closely replicates actual engine built environmental effects since you are actually creating particles and moving them down vertically, but it also requires the most amount of work. More polygons will be drawn, but less overdraw.
Keep in mind that you want to properly limit the line of sight in your map with proper hinting since this will be the largest determining factor in terms of performance. If you're working on a huge terrain map where the entire map is visible at any time, then you can expect performance to grind to a halt. On the other hand, a properly hinted map, you can expect excellent performance.
Posted: Mon Aug 22, 2005 9:32 pm
by Morari
Hmmm, thank you obsidian. I'll tinker around with those methods and see what happens. They certainly sound as if they have potential, but the area I'm doing is rather large/open and often times viewable from the entire map, so I don't know. I guess it'll all just come down to FPS in the end. It's not that important of an aspect, but it's a little touch that I think would add to the atmosphere tremendously :icon25:
Posted: Tue Aug 23, 2005 12:31 am
by seremtan
obsidian wrote:Alternatively, you can create particles of snow using
deformVertexes move and
deformVertexes autosprite2 to shift the the polygons themselves. This method closely replicates actual engine built environmental effects since you are actually creating particles and moving them down vertically, but it also requires the most amount of work. More polygons will be drawn, but less overdraw.
actually this requires the least amount of work if you use particle studio
http://www.planetmedalofhonor.com/freebrief/q3a/ps/
you can tweak your effect in real time use the PS renderer, then when you're happywith it, it will write the shader for you and create a prefab to insert in where you want the particles to start. all you need is the TGA snowflake. good for snowflakes, smoke puffs, i've even seen fireworks done with it