Jump to content


Photo

Soft r_gamma


87 replies to this topic

#1 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 02:51 PM

I'm sure most of you have a custom r_gamma > 1.0.

It has an unfortunate side effect that all windows are overbrightened and bleached when you alt-tab from TDM.

For that reason I myself have for a long time stopped using r_gamma.

However sometimes a map is so dark that I wonder if the author was designating it to be played with high gamma value (e.g. Old Habits 1).

I'm going to put a new uniform to the ambient interaction shader that would brighten up ambient lights using r_gamma cvar value. At the same time I will disable device gamma ramp in regards of gamma. "Normal" point lights will ignore r_gamma from now on, as well as GUI's, etc.

This will affect the svn version, not 2.06.

 

Another problem this should reduce is color banding. Gamma ramp makes banding more visible due to relatively higher steps between dim color shades.

 

Please comment.



#2 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 16 December 2017 - 03:15 PM

I'm going to put a new uniform to the ambient interaction shader that would brighten up ambient lights using r_gamma cvar value. At the same time I will disable device gamma ramp in regards of gamma. "Normal" point lights will ignore r_gamma from now on.

 

How would that affect the gamma setting room in the Training Mission?


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#3 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1731 posts

Posted 16 December 2017 - 03:39 PM

I make all my textures and materials for ambient_world with brightness 16 and default gamma 1.2 (I can use gamma 1.0 to get better contrast or e.g. when I play in the evening). Will that affect my textures or materials in any way?



#4 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 03:52 PM

I make all my textures and materials for ambient_world with brightness 16 and default gamma 1.2 (I can use gamma 1.0 to get better contrast or e.g. when I play in the evening). Will that affect my textures or materials in any way?

I don't think so

 

How would that affect the gamma setting room in the Training Mission?

Probably it won't

Thinking about that - does it make any sense to have a gamma room in Training mission at all considering new players will have gamma setting on its default value? Do we actually expect different visibility on different monitors in digital LCD era? I think that's what people did on CRT's 10+ years ago.


  • Judith likes this

#5 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 16 December 2017 - 04:03 PM

So you're saying that the lights in a mission will be directly adjusted by the gamma value the player sets in the menu?  Won't that mean that the gamma value would suddenly start impacting player visibility?


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#6 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 04:05 PM

So you're saying that the lights in a mission will be directly adjusted by the gamma value the player sets in the menu?  Won't that mean that the gamma value would suddenly start impacting player visibility?

Good question.

Do ambient lights contribute to lightgem? I think not. @nbohre1more?

If so, no change, otherwise lightgem calc output will have to be adjusted accordingly OR gamma shader skipped during lightgem stage.



#7 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12733 posts

Posted 16 December 2017 - 04:18 PM

A gamma change that affects light and ambient light brightness will affect an AIs ability to spot missing items. This is a change in gameplay.

I dont remember if the lightgem is affected by ambient lights.

It looks to me like the number of things this change would affect and probably require further code changes to mitigate is decreasing the need to make the change.

#8 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 16 December 2017 - 04:21 PM

Do ambient lights contribute to lightgem? I think not. @nbohre1more?

 

 

Yes, they do.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#9 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12733 posts

Posted 16 December 2017 - 04:23 PM

@duzenko,

Did you jump the gun on submitting your suggested gamma/ambient changes?
  • Springheel likes this

#10 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 04:26 PM

A gamma change that affects light and ambient light brightness will affect an AIs ability to spot missing items. This is a change in gameplay.

I dont remember if the lightgem is affected by ambient lights.

It looks to me like the number of things this change would affect and probably require further code changes to mitigate is decreasing the need to make the change.

Not sure what you mean my light brightness. The change I did is about pixels on the screen. Unless AI somehow reads pixels...



#11 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 04:27 PM

 

Yes, they do.

Do you mean that simple and advanced ambient (that produce different output color on the screen) also affects lightmap output value?



#12 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 16 December 2017 - 04:30 PM

Ambient world sets a default light value for the map.  AI read that light value when determining whether they can see the player or not.  I traditionally make the ambient_world light value brighter on higher difficulties in my map so that AI can see the player more easily.

 

If your change increases the light value based on the player gamma setting, then it is going to affect how AI see the player (and everything else).


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#13 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 16 December 2017 - 04:32 PM

Ambient world sets a default light value for the map.  AI read that light value when determining whether they can see the player or not.  I traditionally make the ambient_world light value brighter on higher difficulties in my map so that AI can see the player more easily.

 

If your change increases the light value based on the player gamma setting, then it is going to affect how AI see the player (and everything else).

If you're talking about lightgem here, I would still like to hear about enhanced vs simple ambient.



#14 Abusimplea

Abusimplea

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 16 December 2017 - 08:35 PM

Thinking about that - does it make any sense to have a gamma room in Training mission at all considering new players will have gamma setting on its default value? Do we actually expect different visibility on different monitors in digital LCD era? I think that's what people did on CRT's 10+ years ago.

There are people without OLED displays out there and for them backlight bleed is still a thing. It heavily depends on the panel, how much the backlight bleed reduces contrast for darker areas. Actually, some CRTs and especially the plasma TV sets where better than current TFT in this regard as there was no permanent backlight, that could have shined through "black" dots. So until we all got OLEDs, gamma correction will keep beeing a thing - especially in darker games like TDM.

 

And there also are personal differences in taste and physical ability when it comes to distinguishing the darker shades of grey. That will certainly grow a bit as some of the audience of TDM gets older and therefore less good vision.


Edited by Abusimplea, 16 December 2017 - 08:38 PM.


#15 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 16 December 2017 - 09:13 PM

If you're talking about lightgem here, I would still like to hear about enhanced vs simple ambient.

 

I'm not really sure what you're asking.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#16 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 17 December 2017 - 03:07 AM

 

I'm not really sure what you're asking.

You say ambient lights contribute to lightgem.

The ambient/simple ambient affects brightness of ambient lights on different surfaces - were you aware of this?



#17 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 17 December 2017 - 05:13 AM

Revision: 7348
r_gamma in GLSL skipped for lightgem
 



#18 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1731 posts

Posted 17 December 2017 - 05:32 AM

AFAIK, ambient lights work just like "vertex lights" in Thief 3: they're cheap, because they both don't cast shadows and they ignore brush/mesh faces. And they affect lightgem as any other light would do. Ambient_world is basically ambient brightness, it sets the color and brightness for the low-end of the output light range in a level, so you don't get pitch-black shadows, and this obviously affects the lightgem as well. You can set it to something like RGB 64, and you can have a dawn/daylight mission, and the lightgem will react accordingly, as well as AI.

 

As far as I've seen with my WIP map, there's no visible difference between Ambient Rendering option set to Enhanced and Simple. Btw. when you change Interaction shader between Default and Enhanced, there's a difference in how my speculars work though, they look better with Enhanced.


  • Springheel likes this

#19 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37455 posts

Posted 17 December 2017 - 09:04 AM

The ambient/simple ambient affects brightness of ambient lights on different surfaces - were you aware of this?

 

 

Ambient and simple rendering was designed to be as similar as possible.  There are a few minor differences on some textures, but nothing that should have an impact on AI vision.

 

Revision: 7348
r_gamma in GLSL skipped for lightgem

 

 

What about AI noticing things like bodies, ropes, or missing loot?  That is also affected by ambient lights.

 

Wouldn't it be a good idea to sort out how (and if) this works before adding it to SVN?


  • Judith likes this
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#20 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9108 posts

Posted 19 December 2017 - 01:45 AM

Since this change, I'm getting spotted all the time and the lightgem is too bright for my location.

You'll need to make some sort of lightgem offset to counter balance.

 

I was actually thinking of a similar system but not as a replacement for gamma and instead

just a way for players to control the ambient_world light to taste. Similar offset would be required though.


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

#21 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 509 posts

Posted 19 December 2017 - 03:59 AM

You say ambient lights contribute to lightgem.

The ambient/simple ambient affects brightness of ambient lights on different surfaces - were you aware of this?

 

I was, your gameplay experience is actually different depending on which ambient method you use, normal or enhanced. The lights change brightness and affect the lightgem.

 

I thought this was about just divorcing our gamma slider from the Windows gamma one, which would be sane enough on its own. On paper this sounds like not that bad of an implementation of a "soft gamma" in order to eliminate the ugly banding.

 

Of note is that a mapper could choose to place a texture other than an ambient light as their ambient_world, a map could also have no ambient lights at all. It's a fringe case, but something to keep in mind.

 

Every type of light contributes to visibility, unless it has ai_see 0 set on it. If you want to do anything with them, that's something worth looking into, or the lightgem adjustment mentioned in the previous post. How you'd make it conditional to only ambient lights, I don't know.


My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#22 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1731 posts

Posted 19 December 2017 - 04:05 AM

I was actually thinking of a similar system but not as a replacement for gamma and instead

just a way for players to control the ambient_world light to taste. Similar offset would be required though.

 

That seems like a bad idea to me. Mappers and modelers set and change ambient_world so it matches the location, textures, materials, etc. And it affects lightgem / visibility, so it's also a gameplay-related feature. Giving that ability to players would break things.


  • stgatilov likes this

#23 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1831 posts

Posted 19 December 2017 - 08:55 AM

Since this change, I'm getting spotted all the time and the lightgem is too bright for my location.

Does simple ambient fix it?



#24 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9108 posts

Posted 19 December 2017 - 09:09 AM

Does simple ambient fix it?


I'll test that tonight.
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...)

#25 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12733 posts

Posted 19 December 2017 - 09:17 AM

I tested AI noticing a missing object both in 2.05 and SVN.

 

I measured the amount of light hitting the object, and in both cases it was nearly the same (2.05 = 0.388595, SVN = 0.388700).

 

So it doesn't look like this change affects the amount of light cast on a missing object.

 

I cranked up the gamma and brightness in the menu with no change in SVN results.

 

I still don't think I'm clear on whether this is just a "pixels on the screen" change or it will "brighten up ambient lights". These seem like contradictory statements, the latter making it sound like ambient lights in the game will now be brighter and affect the amount of light falling on objects, which affects AI being able to see them.

 

I think the confusion in the comments on this thread stems from an incomplete description of exactly what's changing.

 

Please clarify.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users