Jump to content


Photo

Ambient light based on player


36 replies to this topic

#26 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1429 posts

Posted 06 June 2012 - 02:30 PM

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:

Posted Image

Posted Image

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:

Posted Image

Posted Image

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

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

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, 06 June 2012 - 02:35 PM.


#27 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8045 posts

Posted 07 June 2012 - 01:21 PM

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, 07 June 2012 - 01:22 PM.

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

http://www.indiedb.c...ds/the-dark-mod

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

#28 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13782 posts

Posted 07 June 2012 - 01:43 PM

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.

#29 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 June 2012 - 02:53 AM

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

#30 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36514 posts

Posted 08 June 2012 - 07:43 AM

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?

#31 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18745 posts

Posted 08 June 2012 - 08:07 AM

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.

#32 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 June 2012 - 08:15 AM

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

#33 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18745 posts

Posted 08 June 2012 - 11:46 AM

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

#34 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 08 June 2012 - 11:49 AM

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

#35 Mortem Desino

Mortem Desino

    Uber member

  • Development Role
  • PipPipPipPip
  • 2442 posts

Posted 08 June 2012 - 01:29 PM

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

thecreeps_2012-06-08_13.27.50.jpg
yay seuss crease touss dome in ouss nose tair

#36 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1429 posts

Posted 08 June 2012 - 06:06 PM

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

#37 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8045 posts

Posted 06 September 2016 - 04:10 PM

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.


  • RPGista likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users