Jump to content
The Dark Mod Forums

Simulating atmospheric perspective


Springheel

Recommended Posts

Just curious if anyone has tried this before. When you look at thing further away, they get bluer and have less contrast. Is there a way to simulate this in TDM with fog lights or something? I've never used fog before, and I don't want fog close to the player, but I'd love to have a way to make some kind of distance-based fading. Is this feasible?

Link to comment
Share on other sites

I do want it to affect the play area though, just not in the player's immediate location.

Link to comment
Share on other sites

Im not sure if this was a Tel's solution only, or if it can be achieved in TDM also, but he wrotte an article on fog a while back, as we were discussing this very issue at the time and he wanted to expand its use for his modification (called Swift Mazes):

 

http://swift-mazes.com/diary.html

 

This could or could not be useful, as it is a different sort of mechanism. Still, this was talked about for a bit here in the forums some time ago, and for me, if it wasnt for the performance cost, this should be kind of standard procedure for all maps. Atmospheric fog is simply necessary to simulate loss of detail caused by distance, and many situations should gain if that effect is in place. I was going to use a very subtle dark blue fog on my own map, but at the time all I could do technically as place a general fog light over the whole map and I could feel a visible hit on performance, so decided agaisnt it. It would be awesome if you do decide to use this in your map, but it would be important to account for it as soon as possible.

Link to comment
Share on other sites

http://forums.thedarkmod.com/topic/13848-ambient-light-based-on-player/page__hl__atmospheric__st__25

 

A fog is the simplest solution, a faint, subtle one you wouldnt even see inside a room, but would make a difference when you are in the open/looking down the corridor.

Link to comment
Share on other sites

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

Another possibility is to set the ambient light to a light value that you want distant objects to appear in, and use another non-shadow-casting light bound to the player, that creates together with the blueish ambient an appropiate ambient near the player (where near is relative).

  • Like 1

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

Another possibility is to set the ambient light to a light value that you want distant objects to appear in, and use another non-shadow-casting light bound to the player, that creates together with the blueish ambient an appropiate ambient near the player (where near is relative).

I dont follow, got a basic map as an example..?

Link to comment
Share on other sites

Another possibility is to set the ambient light to a light value that you want distant objects to appear in, and use another non-shadow-casting light bound to the player, that creates together with the blueish ambient an appropiate ambient near the player (where near is relative).

 

Do you mean in combination with a fog-light? Or instead of it? Wouldn't that lose the distant blurriness of fog?

Link to comment
Share on other sites

I've meant instead of a fog light. For distance blurriness you could use a speric patch with a heat haze distortive texture one it that surrounds the player.

 

It is a bit late here, so I go and set up a test map tomorrow.

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

I'll be interested to see what you have in mind. For the distances I have in mind, it would have to be an awfully large light.

 

On the other hand, I like the idea of a really dark map where a small ambient attached to the player allows you to see close up details.

Link to comment
Share on other sites

What's the advantage to binding the foglight to the player, btw, as opposed to a single light the spans the whole map?

Link to comment
Share on other sites

Fog lights seem to be more responsive to script changes when bound to the player. Just be careful about additive fog methods, these

can really screw with the lightgem. It would be cool if you could disable that part of the calculation. (Or it would be cool if unbound fog lights

listened to scripts...)

 

With scripting you can make the fog fade in and out smoothly.

 

Without scripting you either need to have hard transitions, obstructive geometry, or other hacks to hide the transition from fog to no-fog.

 

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

 

Another way to make smooth transitions is the use a projection image with smooth alpha but its quite cumbersome to set up:

 

1) Get an orthoview screen of your map

2) Make a GIANT texture that represents where fog will and wont be in your map

3) Create a custom foglight texture that uses this as the projection image

4) Orient the light to project downward and align the projection with your map

 

Since you can't really see what the two light images are doing in DR very well, that last

step is pretty much trial and error \ flying blind.

 

All credit due to goliathvt:

 

http://www.doom3world.org/phpbb2/viewtopic.php?f=1&t=6325

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

What's the advantage to binding the foglight to the player, btw, as opposed to a single light the spans the whole map?

I didn't bind it to the player, remembered that wrong.

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

Here ya go. This is just for a rough impression. The settings should be tweaked for a better result.

springheel.pk4.txt

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

Well damn. Adding a subtle foglight that covers the whole map does exactly what I want, with one catch. All the caulk surfaces no longer show the skybox through them, and instead are a flat colour. I need them to show the skybox. Please tell me there's a way around that? The effect on the buildings is absolutely gorgeous.

post-9-0-59687300-1390674485_thumb.jpg

Link to comment
Share on other sites

Can't you use the skyportal texture instead of caulk in those locations..?

 

Whats the perf like with two world lights though? can you do a "r_showprimitives 1" and tell me what the Draw call count is in that scene or better still, a scene with an already heavy perf req in its location. I ask because I would like to see what the perf would be like on some of the campaign missions.

 

nice screenshot btw.

Link to comment
Share on other sites

Can't you use the skyportal texture instead of caulk in those locations..?

 

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.

 

I'd have to do a before and after test to know for sure about performance.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...