Jump to content

SetGamma(1.0) not reverting brightness to old look


Dreikblack
 Share

Go to solution Solved by Josh,

Recommended Posts

Last steam beta.

 

Lightning now is broken in my project with any values of gamma in shader or game code until they are both 1.0

Default:

image.thumb.png.13b75f91e4f4e269f165b8dd535db3ae.png

Camera->SetGamma(1.0f);

image.thumb.png.4047864f6e795b1538a460fbaaf2c205.png

Only in shader gamma 1.0:

image.thumb.png.fbce2256fbe756717b41a199be80e782.png

How should be and looks like gamma 1.0 in shader AND game code

image.thumb.png.b7f4d05a44f506c9ac3efd5cc2a8f9bf.png

 

Link to comment
Share on other sites

Camera:SetGamma controls the final linear to sRGB color conversion, and is a setting meant for adjusting a game's brightness levels for the monitor. It does not affect the sRGB to linear color conversion, which can be changed by modifying the GAMMA value in Shaders/Khronos/tonemapping.glsl.

Every screenshot above looks as I would expect.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Solution

Except for the recent activity, that is a shader file that never changes. You could make the file read-only if you want to protect it.

There is no max gamma value. The default is 2.2, which is the correct value to convert linear to sRGB. 

The first render looks correct, but keep in mind:

  • Quake is a dark game and those textures were designed before sRGB was in use in games.
  • You have a directional light plus PBR diffuse and specular lighting brightening the scene.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

11 hours ago, Josh said:

You have a directional light plus PBR diffuse and specular lighting brightening the scene.

Without diffuse and specular maps still looks wrong. Anyway even if i fix shader and gamma for all cameras manually the Editor still needs a gamma settings then to fix it there.

Also gamma settings would be nice for Camera in the Editor entity properties to avoid creating extra component and applying it every time

  • Like 1
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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...