Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I'm wondering if Gildoran or OrbWeaver (or anyone else of course) might have an idea here. I'd like to (if possible) create a smooth fading fog, so that a level can have transitions from no fog (indoors) to full fog (outdoors), without the ugly seam that appears when doing it with existing fogs. I attempted the obvious - using a light texture which fades gently toward the edges - however this seemed to have no effect on the fog or how it acts at the edges. Any idea why, or how to achieve this, or if it's completely impossible?

Posted

Yeah, the default D3 fog looks kind of ugly... for nicer looking fog, I might recommend using a blendlight. However, that doesn't help with transitions. :( I'd say it's either impossible or hard to do with the D3 engine, though it might be possible to do some tricks to make it seem like you have transitions.

 

I've had an idea for a map with some misty ruins, and a deep gaping hole in the ground leading down into some fogless chambers. I planned on doing the transition by adjusting the blendlight fog in intensity as the player based on the player's Z-position in the hole. (I've done similar things to adjust the brightness of fog in water based on a player's Z-position, so that water appears darker the deeper you go)

 

Then again, that doesn't sound like what you want to achieve. I do have one idea by using overlapping blendlights (one to determine fog intensity, and the other to implement distance fog, the first one setting the alpha channel for the second to use), but I'm not sure it would work well, or even at all.

Posted

I'm of the opinion that foglights are buggy in numerous ways... for example, they don't have the proper density if you're looking down at them. Also, triangles that intersect with foglights can end up with sections of the triangle getting fogged twice (once by the fog shader, and the other by the transparent fog plane at the boundary :( )

Posted
I've had an idea for a map with some misty ruins, and a deep gaping hole in the ground leading down into some fogless chambers. I planned on doing the transition by adjusting the blendlight fog in intensity as the player based on the player's Z-position in the hole. (I've done similar things to adjust the brightness of fog in water based on a player's Z-position, so that water appears darker the deeper you go)

 

Vertical falloff works OK if you use the texture "pitfog_to_black". This suggests that it should be possible to have a fog which falls off in any direction, not just vertical, but even looking at the MTR I couldn't really understand what pitfog_to_black is doing.

 

The other alternative is to bind a very large foglight to the player's position, and script it so that the intensity is modified when the player enters/exits certain areas. This is more or less how Thief did it (except that it was done by the engine, not by the mapper explicitly placing a light).

Posted

It looks like the reason it behaves differently is because it's using a falloff image. In lights and fogs, a stage defines the x/y axies, and the falloff image defines the z-axis... (of course, a light can have its axies rotated) Unfortunately, I'm not exactly sure how it combines the falloff and cross-section to yield the color at a specfici point... perhaps it multiplies the colors together?

 

Hmm... It just occured to me that it might be possible to use clamping to fix the problem with fogging at the edge of fog-lights. I'll have to try it and see how it goes.

Posted
It looks like the reason it behaves differently is because it's using a falloff image. In lights and fogs, a stage defines the x/y axies, and the falloff image defines the z-axis... (of course, a light can have its axies rotated) Unfortunately, I'm not exactly sure how it combines the falloff and cross-section to yield the color at a specfici point... perhaps it multiplies the colors together?

 

I presume it does a multiplication for ordinary lights, but foglights are different. They are not actually lights as such, I believe they just blend their colour with the remote surface based on the distance between the player and that surface. I am not quite sure how the falloff images fit into this, certainly in my tests I was unable to make a foglight use biground1.tga to create circular fog, for instance.

Posted
It just occured to me that it might be possible to use clamping to fix the problem with fogging at the edge of fog-lights. I'll have to try it and see how it goes.

Any luck? The fogs I was playing with had that zeroclamp setting, so I'm not sure that will help.

 

I am not quite sure how the falloff images fit into this, certainly in my tests I was unable to make a foglight use biground1.tga to create circular fog, for instance.

Yep, that's exactly the same thing I did. :( Between that and a full white texture like that used for ambient no fall off, there was no noticeable difference. Which makes no sense, unless it just has nothing to do with it.

 

I also tried varying levels of fogs within each other to fudge a "transition", and well... you can probably guess how that looked. *vomit*

Posted

I was actually thinking about this sneaksie and came up with a relatively bad solution:

 

*make the map first (of course) then get the exact outline of where you want the fog to go and create a large image (2048x2048?) that has the transitions you want. Use this as your lighttexture etc.

 

The only other solution I have is to use the bind light at map start thingy. Though that means the fog is always with you.

Posted
*make the map first (of course) then get the exact outline of where you want the fog to go and create a large image (2048x2048?) that has the transitions you want. Use this as your lighttexture etc.

 

If the fog doesn't obey the light texture (which it seems not to), this won't work.

 

The only other solution I have is to use the bind light at map start thingy. Though that means the fog is always with you.

 

Yes, but you can script the light to change intensity, colour or fog density (shaderParm 3 I think) based on the player's position.

Posted
If the fog doesn't obey the light texture (which it seems not to), this won't work.

 

But it does obey the light texture. I've already tried this.

 

Yes, but you can script the light to change intensity, colour or fog density (shaderParm 3 I think) based on the player's position.

 

Did'nt think of that. Guess that'd be the most fluid option, though it would be a bit tricky getting it to work right.

Posted

Damn, just tried it out again. It did'nt obey the light texture, must've had it confused with something else.

 

I guess the only option is to either edit the shader or use the bind light to player technique.

Posted

Yeah the binding looks really bad, too, at least in it's current state. And the problem with changing the state as the player moves is then you can't see the fog from outside of it, which is one of the most dramatic effects. Still, it's probably usable if there's no other choice.

 

Still thinking about this; there's gotta be some decent solution. Even if it's a light or particle trick at borders/doorways...

Posted

Yeah, the only way to do true volumetric fog is by using a particle effect. Perhaps you could modify your snow/rain emitting texture to emit very large, slow-moving smokepuff particles (which look good as fog if they are sufficiently faint). You might not even have a performace issue if you used large enough sprites, as you would not need that many.

Posted

Well, in playing around I've done some similar stuff (check tdm_dustfog1 and tdm_dustfog2 particles) but not in the direction of true, area covering fog. Even these little versions have their problems, because if you use 'view', they rotate with you (which can sometimes look really bad, depending on the use) and if you use x/y/z orientation, it looks like old school three-axis sprites... /shiver.

 

Incidentally, I think there's a bug in the particle light thingy. If you change the light colors of the particles above even a hair, the whole blending effect is ruined, and they pop in and out of existance, no matter how much you tweak after that. I had to copy and modify an id particle to keep the fading intact. <_<

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...