Environmental Effects Through Shaders?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Morari
Posts: 9
Joined: Mon Aug 22, 2005 5:53 am

Environmental Effects Through Shaders?

Post 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?
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Morari
Posts: 9
Joined: Mon Aug 22, 2005 5:53 am

Post 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:
User avatar
seremtan
Posts: 36013
Joined: Wed Nov 19, 2003 8:00 am

Post 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
Post Reply