Realistic fog effect

MuuMuu 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">

Comments

  • realityisdeadrealityisdead Employed by Raven Software after making ns_nothing Join Date: 2002-01-26 Member: 94Members, NS1 Playtester, Contributor
    I've run into the same problem before.

    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.
  • MuuMuu Join Date: 2002-01-24 Member: 23Members
    max alpha is .245 - thats not the point I want to the fog to obscure the view of the coridor but i dont want it to make it brighter - Im not sure if this is possible but maybe someone has seen something like it and can tell me where.
  • realityisdeadrealityisdead Employed by Raven Software after making ns_nothing Join Date: 2002-01-26 Member: 94Members, NS1 Playtester, Contributor
    Oh, I see... misunderstood.

    Darkening the texture may do the trick... I really don't have an answer though.
  • JaciusJacius Join Date: 2002-01-25 Member: 43Members
    darkening the texture would have the exact same effect as reducing the alpha. Exactly. (Except it would take more work)

    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
  • MonsieurEvilMonsieurEvil Join Date: 2002-01-22 Member: 4Members, Retired Developer, NS1 Playtester, Contributor
    I think that Merkaba found a workaround for this actually, and I'm not enough of a mapper to explain it properly (he once told me in IRC - right over my head). But in Hera, he uses sprite based fog and he did some tricky lighting thing for everything to come out nice and gloomy without being pitch black or washed out bright. You might even email him, or stop in #naturalselection to ask him.
  • MuuMuu Join Date: 2002-01-24 Member: 23Members
    Thanks Jacius but I already know all that <!--emo&:(--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/sad.gif" border="0" valign="absmiddle" alt=':('><!--endemo--> I tryed using a 255 transperency sprite but it looked rubbish - ive still got a few ideas though - Ill see what I come up with tomorrow.

    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
  • UnCriticalUnCritical Join Date: 2002-01-25 Member: 73Members, Constellation
    I think the trick is not to use too many sprites.
    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.
  • MerkabaMerkaba Digital Harmony Join Date: 2002-01-24 Member: 22Members, Retired Developer, NS1 Playtester
    I *think* I know what Monse means <!--emo&:)--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=':)'><!--endemo-->

    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
  • MuuMuu Join Date: 2002-01-24 Member: 23Members
    Flayra please read and tell me what you think - Thanks.
    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.
  • MuuMuu Join Date: 2002-01-24 Member: 23Members
    <b>Flayra read this too please</b>

    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-->
  • Shuvit_ViperShuvit_Viper Join Date: 2002-01-25 Member: 62Members
    I really dont know particles and that stuff, but in cs the smoke grenade worked fine. Isn't there a way to copy the code of the SG in the ns code, that you place a func_smoke or something and that will release smoke, just like an SG? you could then add settings like angle (whereto it blows, down is no speed, up is smoke from a fire), the speed, etc., and on systems of people with slow computers, it would still look good, since they just put the smoke complexity lower... and they wouldnt see through anything...

    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...
  • BlahmanBlahman Join Date: 2002-01-25 Member: 85Members, NS1 Playtester
    Nice work Mu. Maybe put some framerates to show which methods are fastest.

    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.
Sign In or Register to comment.