Jump to content
The Dark Mod Forums

Simulating atmospheric perspective


Springheel

Recommended Posts

Although this has me concerned:

 

 

This is even more of a problem since it seems that the engine no longer responds to the noFog keyword.

 

Adding nofog seems like exactly what would do the trick, but nothing happens.

Link to comment
Share on other sites

There is a keyword to prevent portals from fogging but I'm not sure that works now either. Will look it up when I get a chance

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

It's a bummer, because the foglight looks freaking beautiful. I can't think of any way around the problem though...binding the light to the player won't matter. I thought of those lights that you can set to light up only certain textures, but I'd have to make my own copy of every material shader to even try that out.

 

Is there any way to set a texture so that it doesn't interact with light at all (though caulk already doesn't for regular lights)?

Link to comment
Share on other sites

Does a skybox texture show the behind func_stats even if there's caulk behind it?

I was thinking of something like a skybox textured decal.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Does a skybox texture show the behind func_stats even if there's caulk behind it?

I was thinking of something like a skybox textured decal.

 

Sorry, I'm not clear on what you're suggesting.

Link to comment
Share on other sites

Not sure if this will help, but I'll throw it out there. I had an issue with draw order on the default portal_sky material which I fixed by changing it to have the blend add keyword. Possibly doing the same thing to caulk might fix your problem?

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

Sorry I was thinking about it backwards for some reason because I read too fast.

You *want* the func_stats to show through, and I was thinking you wanted to hide it. So forget what I said.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Wrt 'noFog' ...

 

If you copy a non-translucent texture definition, add the 'noFog' keyword, and place it in fog, does fog get painted on it? If so, 'noFog' isn't working. If not, 'noFog' is working.

 

Maybe caulk's problem is that the renderer is painting the skybox projection on it, which makes it opaque. Opaque surfaces get fog painted on them.

 

If you noclip up to the caulk sky, does the fog dissipate to show the sky behind it?

 

Since the sky projection isn't a material per se, I don't think there's a way to add the 'noFog' keyword to it.

Link to comment
Share on other sites

This is a typical problem and the reason why I didn't use it in Old Habits (Rebuild). One workaround may be to use a fog light with a small radius and bind it to the player.

 

I have another idea in mind but have to check it out first.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Nodraw does not seal.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Unfortunately not, because I need to allow func_static pieces to be visible from outside the visleaf. That works with caulk but not with skyportal brushes.

 

What if?

1) replace caulk with skybox texture

2) put func_static objects into the skybox room (scale them to 1/16 size)

3) activate the moving skybox type.This is, I suppose, how the skybox effect should be achieved, technically. Caulk sounds a bit hacky.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

You could also try using fog particles instead of fog lights.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

If you noclip up to the caulk sky, does the fog dissipate to show the sky behind it?

 

Yes, the amount of fog painted on the caulk brush varies with distance.

 

 

This is a typical problem and the reason why I didn't use it in Old Habits (Rebuild). One workaround may be to use a fog light with a small radius and bind it to the player.

 

I'm not sure how that would work in this case...I want the fog effect to just subtly blur things in the distance, but not anything close up. Would a small light be able to accomplish that?

 

What if?

1) replace caulk with skybox texture

2) put func_static objects into the skybox room (scale them to 1/16 size)

 

I'd have to completely redesign all the visleafs in the outdoor area to even try that, not to mention all the work to scale everything. I can't justify that much work, unfortunately.

 

 

You could also try using fog particles instead of fog lights.

 

I don't know much about fog particles...how would they be able to achieve atmospheric perspective without causing the same problem?

 

 

I had an issue with draw order on the default portal_sky material

 

Hmm, if I could get the caulk/sky to draw over top of the fog somehow, that might work...I'll try experimenting with that. *fingers crossed*

Link to comment
Share on other sites

Hmm, changing the sort order of caulk doesn't appear to do anything.

 

What about the "spectrum" keyword? Normally you set that so that only designated textures are affected by that light. Does that work with foglights?

Link to comment
Share on other sites

If you copy a non-translucent texture definition, add the 'noFog' keyword, and place it in fog, does fog get painted on it? If so, 'noFog' isn't working. If not, 'noFog' is working.

 

I tested it on a regular texture, and it still appeared foggy. I'll make a tracker for that.

Link to comment
Share on other sites

Maybe caulk's problem is that the renderer is painting the skybox projection on it, which makes it opaque. Opaque surfaces get fog painted on them.

 

But portalsky is also opaque, yet it's not affected by fog. Both materials have the forceOpaque keyword.

textures/common/caulk

{

description "a solid surface which while invisible, it can seal areas from the void and is used to help optimization"

 

qer_editorimage textures/common/caulk.tga

noshadows

forceOpaque // will still seal levels

 

 

}

 

 

 

 

 

 

 

textures/smf/portal_sky

{

qer_editorimage textures/editor/portal_sky

forceOpaque // will still seal levels

noshadows

noimpact

sort portalSky

 

{

map _currentRender

 

clamp

screen

 

// fix up the projection based on the screen coords

translate global6 * 0.5, global7 * 0.5

scale global6 * 0.5, global7 * 0.5

}

 

}

Link to comment
Share on other sites

Hmm, some progress. I switched to a different kind of fog texture with the following description:

 

 

 

description "A blend light instead of a foglight. Works best when covering the entire map and bound to the player, but can also look better (no artefacts) than real foglights. Does not fog any postprocess surface, like water or sky. These need to be colored sep. to match the fog color, either by using custom materials on them, or by putting a patch over them with textures/darkmod/fogs/real_fog_layer_moving on it."

 

This fog does not paint over caulk, which is good. The effect doesn't look quite the same as the other fog, because it brightens everything (as an additive blend). But I might be able to work with it. Does anyone know what this keyword means?

 

"blendLight"

 

(beyond id's description that "Perform simple blending of the projection, instead of interacting with bumps and textures")

 

 

Hmm, problem with this fog seems to be that it doesn't vary based on distance. Everything is equally lightened, which is no good.

post-9-0-50885500-1390752867_thumb.jpg

Link to comment
Share on other sites

Link to comment
Share on other sites

Hmm, I might be getting somewhere. I'm using a blendlight, but created a new light-texture for it that has a gentle falloff. It keeps the blendlight from affecting things near the player. It's still an additive blend, which isn't ideal, but if I make it soft and blue enough, it might still work. The last hurdle will be what it does to func_statics that show through caulk.

 

It's going to have to be bound to the player, however...and just simply adding "bind" "player1" doesn't seem to work. Is there a script that has to be used to bind things to the player?

Link to comment
Share on other sites

Caulk sounds a bit hacky.

 

I've used the caulk sky technique extensively in WS2 and WS3, along with a moving sky. The moving sky is great for tall structures seen from a distance, or for wrapping an area with surrounding buildings, and adding to realism. But the caulk sky technique allows you to avoid oddball sky brush and visportal configurations as you try to make sure architecture is visible from more than one leaf.

 

IMHO, both techniques bring something to the table.

Link to comment
Share on other sites

void setup_objects()

{

entity foglight; //creates a new entity

foglight = sys.spawn( "light" ); //spawns light

foglight.setShader( "fogs/blendlight" ); //creates the foglight. replace blendlight with the name of your foglight/blendlight

foglight.setRadius( 16384 ); //sets the size of the foglight

 

foglight.bindPosition( $player1 ); //binds the foglight to the player

foglight.setOrigin( '0 0 0' ); //exact spot from the players current position

 

foglight.setLightParm( 3, 250 ); //shaderParm3; 250 is the density of the fog

 

//color of the fog for the red, green and blue channel:

 

foglight.setLightParm(SHADERPARM_RED, 0.1);

foglight.setLightParm(SHADERPARM_GREEN, 0.1);

foglight.setLightParm(SHADERPARM_BLUE, 0.1);

}

 

void main ()

{

setup_objects ();

}

Edited by Xcen
Link to comment
Share on other sites

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 0 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...