Realistic fog effect
Muu
Join Date: 2002-01-24 Member: 23Members
<div class="IPBDescription">Or how to permanently blind ns players.</div>Does anyone know how to make a steam effect that is not additive, Ive tryed all the rendering modes with ever combination of sprite and I cant get it to look like steam instead of the <b>glowing mist of power</b> from some rubbish game or something. Note these shots have been brightened to look like they do in-game, my gamma is set to 1.8 with out it the effect looks of but I dont want to get rid of it because Ive already based many visuals on it. Any ideas?
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10019.jpg" border="0">
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10020.jpg" border="0">
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10019.jpg" border="0">
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10020.jpg" border="0">
Comments
I haven't actually tried it myself, but you may want to try darkening the sprite you are using... more black in other words.
-Edit- You may also want to try adjusting the Particle Max Alpha down to 0.4 or lower.
Darkening the texture may do the trick... I really don't have an answer though.
If you're trying to obscure the players view with fog, you should just get used to it, because it won't look better <!--emo&:(--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/sad.gif" border="0" valign="absmiddle" alt=':('><!--endemo--> Any other render mode will result in black boxes with the sprite on top, and thats even worse.
You may want to consider env_fog for this situation, but be aware that it only works in OpenGL mode, so anyone playing NS with software or D3D mode would be able to see right through it.
From what I see, you either get rid of the hope of it looking better or you get rid of the idea of blocking the player's view <!--emo&:(--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/sad.gif" border="0" valign="absmiddle" alt=':('><!--endemo--> Sorry, but that's how it seems to be working.
In case you're wondering, blame this on the additive render mode, which looks at what's behind the fog, and then adds the color value of the fog on top of it -- it gets whiter and whiter for each sprite it renders. Black adds nothing, because its color value is 0,0,0.
Maybe the following would work: if you made your own fog texture, medium grey blob on a blue background, you could use another render mode (maybe) and your fog will only be about as bright as the grey you chose.
The problem with that is that it will be very blocky and unsmooth. And you can't smooth your texture out or all your blobs will have blue edges, and you can't see through it in the middle, in a smooth way (if you had blue dots, you could kindof see through it)
But I'm afraid that you'd just be better off not trying to block the corridor with fog. And if you do still want to do that, I suggest using only a few sprites with a higher alpha value, because that will help framerates in that area (it has to render the screen for each sprite you are looking through -- if you have 50 in front of you, it re-renders the screen 50 times, or so I've heard)
-Jacius
PS - I dont think it renders each sprite in a seperate pass - I believe it sorts them(which takes time) into a list and then renders them on a single pass - I suspect it dosnt but them in the same list as game models because you can see sprites through them. -Note whis is not based on fact but on a very simple(and probably flawed) understanding of how quake1 renders stuff.
edit - Monsieur I can't get onto IRC channes appart from quakenet really im behind an annoying Uni firewall. Maybe he'll pop by later
Additive 'adds' he brightness to whatevers behind it, the more layers of sprites you use, the brighter its gonna get.
...least thats my theory...probbaly be wrong.
The fog I used in hera is done using simple env_sprites, set to a murky colour, and a very low transparency. If you're using a particle systehm then you lose the benefit of being able to choose your own colour, and the lowest alpha setting you can have is 0.125. Since the maxiumum is 1.0, this is the equivelant of an env_sprite's FX amount being set to 32. (Out of 255) I believe the fog in hera uses an FX amount of 24, so its not so different, except the colour of the fog is very dark and brown.
I can only suggest a) less particles and b) setting the max alpha level to 0.125
I found out how to do it - this old half-life engines got a lot of life in her yet! I'll post some screen shots when ive got it close to right, im using and indexed alpha sprite and trans colour rendering. There is a very serius limitation though - The half-life engine doesn't sort its sprites for displaying by thier distance from the player but reather by the order they were created in the world, this was probably done to save memory and processing time by only keeping one list of sprits. This causes newer sprits to "overwrite" visualy older ones instead of blending with them (or it may be the otherway round). Do you think we could get valve to do something about this - they seem pretty commited to keeping the half-life engine going and this would open up a hole new range of dynamic fog effects, if done properly it would fix the issue with gl fog too.
Note - all of this is speculation based on my understanding of gl rendering and game engines - I'm also assuming that there is no way to sort sprites from the game DLL.
Ok I spent most of today playing with sprites.
Fog additive
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10024.jpg" border="0">
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10025.jpg" border="0">
fog colour transparent with index alpha sprite
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10026.jpg" border="0">
<img src="http://www.mumuland.co.uk/ns/map/ns_jewel/coridor10027.jpg" border="0">
The second effect would be alot more realistic and a lot faster than additive but it has that limitation due to the HL engine I mentioned befor - red circuls show newer sprites being overdrawing older ones, green shows older sprites blending with newer ones - which is how it should look. Im going to do some more messing around tomorrow to see if there is anything easy which could be done but I supose that to fix it would probably require a full rewrite of the data structures in the graphics engine - not something they're going to do I think. Shame, it would look pretty.
Flayra could you think about making the particle sprites lockable in the horizontal plane eather x or y or from the env_custom_particle angle settings? maybe with a random angle too I'd appreciate it <!--emo&;)--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/wink.gif" border="0" valign="absmiddle" alt=';)'><!--endemo-->
Dont blame me if im just saying something which could never be done, because i have no idea, but this is what it seems like to me...
And viper, the smoke effect from CS isnt exactly what we're looking for here. Personally i think the CS smoke looks cheesy, especially in lower detail settings.