Jump to content
The Dark Mod Forums
Sign in to follow this  
RPGista

Ambient light based on player

Recommended Posts

Well, its not about replacing the ambient light method, I was actually wondering if the alternative method (of fixing a wide light to the player) was possible, for the reasons stated.

 

My first idea was to use a thin black fog to simulate distant objects being darker and harder to see than what is close by the player - this worked in a way, but slowed down my map considerably, so I unfortunetely HAD to let it go.

 

Consider how the artists in Thief 3 used atmospheric fog to decrease detail of the distant environment:

 

big_824thief-3.jpg

 

Thief-Deadly-Shadows-3-Trainer_1.jpg

 

By replacing the blue with black, you can simulate surrounding darkness, but a lot more testing had to be done, and for performance issues, I didnt implement it.

 

Example of situations where actual darkness is beneficial/realistic/expressive:

 

doom-3-b.jpg

 

penumbra_full_11_01.jpg

 

There are many situations where having true black shadows are desirable. I had that in my own map, areas where physically there should be little to no light (and for dramatic reasons too), so info-location entities were used to make those areas pitch black, keeping the ambient light working elsewhere on most of the map, where you would expect "bounced light" to be present. That didnt however solve the problem of persistent light caused by the ambient world. Consider these web pictures of the mod (Im ignoring the fact that the gamma was increased in many of them):

 

training2.jpg

 

darkmod2.jpg

 

tdm_the_crucible_of_omens02_ttlg.jpg

 

Knighton_Release_5.png

 

darkm.jpg

 

thiefs_den01.jpg

 

As we know, most of those shots are from excellent maps; the concession that has to be made to combat pitch black shadows and the lack of bounced light in Doom by using the ambient world is what causes the physically impossible perception of the whole environment, no matter the distance or proximity of objects to lights. Dynamic ambient lights whould be a brilliant feature; it adjusts the "bounced light" level by counting the light sources in a room, if you douse a couple of lights, the general level falls, etc; but it suffers the same problem, it applies to the whole space at once, so if you fire a little candle inside a huge cave, you'll literally be able to see everything from one corner to the other, even if its a mile away, and every tunnel connecting to it (at least, thats what I got in my crypt space when testing). For artistic and realism reasons, I thought it could be nice to test the simple Penumbra method and see how it works in TDM - I thought AI was blind to medium ambient light levels so it wouldnt make a difference for them, its too bad they use it to see objects. Even then, certain maps where that is not a factor could still profit from this alternative method, if its not that difficult to achieve (any horror themed map, like the Creeps for example).

 

Unfortunetely, the hack described here will only potentially work on maps with constant or no ambient light level, it seems... Maps with different location settings would be a problem, because the same binded "eye" light would be subtle for an area with medium ambient level, but quite bright for darker zones.

Edited by RPGista

Share this post


Link to post
Share on other sites

Ah, I kinda get what you're aiming towards.

 

The effect you are interested in having is akin to a macro-scale AO where the

sheer physics of the eye's proximity to objects means that more light is captured

when closer to them.

 

Perhaps if AO ever gets added to the mod, that will be one of the included behaviors.

 

 

Edit:

 

I see that Ambient Light was not used by AI until Grayman added code for this functionality in 1.08?

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...)

Share this post


Link to post
Share on other sites

I see that Ambient Light was not used by AI until Grayman added code for this functionality in 1.08?

 

To my knowledge they've always used it to some extent but it was limited in some areas. I believe Grayman beefed it up.

Share this post


Link to post
Share on other sites

I think the "light things more close" should indeed be added - as a setting sep. from ambient light, more like a property of how much it darkens the ambient light based on distance.

 

Not sure if that must be post-process (we don't have access to the depth buffer, right?) or if it can be something in the ambient shader (if that has access to the depth value of the pixel, it could just scale the additional light down.) The setting must be a per-location setting, of course, because A: you might want to color it different from the general mabient and B : some locations don't need it (llike sunny day etc.)

 

rebb, what do you say, it is possible to add this?


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Share this post


Link to post
Share on other sites
Ah, I kinda get what you're aiming towards.

 

Yes, I think I understand the issue now too. I can imagine it would be nice to have situations where the ambient light is very, very low (or non-existant). Pitch-dark caves, spooky horror-themed places, etc.

 

One issue though; if the player has a light attached to him, even a very faint one, won't that keep his lightgem from ever being completely black?

Share this post


Link to post
Share on other sites

Just looking at those images, I like the the T3 shot and Im thinking I will apply a fog texture to the ambient_world so give the same effect and see what it looks like.

Share this post


Link to post
Share on other sites

Yes, I think I understand the issue now too. I can imagine it would be nice to have situations where the ambient light is very, very low (or non-existant). Pitch-dark caves, spooky horror-themed places, etc.

 

One issue though; if the player has a light attached to him, even a very faint one, won't that keep his lightgem from ever being completely black?

 

That's why I think it should be a light attached to the player, but the reverse. The ambient set by the mapper is the "max ambient", and the further away something is, the darker it gets (scalable by a factor and limited by some amount).

 

So to speak a ramp from "1.0" (closest to player eye) to "X" (where X is <= 1.0 and >= 0 and is set per-zone) and scaled by distance. So the mapper can set (if nec.) the fall off (how fast it falls off to darkness), the color (by setting the falloff not "0.1 0.1 0.1" but something like "0.5 0.1 0.1" for reddish tint) and how far it falls of.

 

That might simulate haze on a daylight mission, or darkness on a cave mission, but not impact old maps.


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Share this post


Link to post
Share on other sites
That's why I think it should be a light attached to the player, but the reverse.

Possible a light thats not a light, like a blend light..?

Share this post


Link to post
Share on other sites

Well, or just the shader that renders the ambient light takes into account the distance for each pixel... (why do people insist on creating an extra light which will result in an extra pass?)


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Share this post


Link to post
Share on other sites

One issue though; if the player has a light attached to him, even a very faint one, won't that keep his lightgem from ever being completely black?

Yes. I don't think there's any way to remove a light from the LG snapshot via spawnargs. The only way would be to permanently lower the LG level a few clicks with the worldspawn spawnarg "lightgem_adjust"

 

A possible way to implement pools of ultra-dark shadows is to use a "blend blend" light. You can find some prototype light textures to use in "lights/shadows".

 

post-2515-0-61712000-1339180184_thumb.jpg


yay seuss crease touss dome in ouss nose tair

Share this post


Link to post
Share on other sites

 

That's why I think it should be a light attached to the player, but the reverse. The ambient set by the mapper is the "max ambient", and the further away something is, the darker it gets (scalable by a factor and limited by some amount).

 

So to speak a ramp from "1.0" (closest to player eye) to "X" (where X is <= 1.0 and >= 0 and is set per-zone) and scaled by distance. So the mapper can set (if nec.) the fall off (how fast it falls off to darkness), the color (by setting the falloff not "0.1 0.1 0.1" but something like "0.5 0.1 0.1" for reddish tint) and how far it falls of.

 

That might simulate haze on a daylight mission, or darkness on a cave mission, but not impact old maps.

 

This. By having control of how far the player can see details, you will strike two targets at once: you will be improving the realism and gradation of detail for wide landscape views, and you will also be able to create a desired atmosphere (more or less claustrophobic, lighter or darker, etc) without loosing the benefits of the ambient light, performance wise (considering, again, that tricks like fog lights are quite heavy for low specs pcs).

 

Just to be sure, the main problem here is not necessarily to achieve no-ambient light spaces - this can be done, like some posts here show. The question for me is on how to allow for light levels (and thus, surface detail) to decay in relation to the player's pov, so we can have more realism than the static, lossless world light, and more opportunity for atmosphere generally (the doom and penumbra shots are to show just that, how not being able to see to infinity gives you a sense of danger, of unknown which doesnt exist in any TDM mission so far).

Share this post


Link to post
Share on other sites

Hah!

 

The new ai_see arg in 2.04 (for bounce lights) could also allow you to attach a small light to the player and get Penumbra style lighting without lightgem issues.

  • Like 1

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...)

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...