Skip to content

Conversation

@Filoppi
Copy link

@Filoppi Filoppi commented Mar 19, 2023

The "XYZ_RGB" matrices remain very very very slightly different (like 0.212671 vs 0.2126) from the luma vector I used though it shouldn't really matter.

As previously discussed, the game was using the BT.601 luminance formula all around, instead of the BT.709, which is the color space it actually uses. Likely a mistake that carried over from the 90s.
Mind that many game shaders still use the wrong luminance formula even with these fixes.

The "XYZ_RGB" matrices remain very very very slightly different (like 0.212671 vs 0.2126) from the luma vector I used though it shouldn't really matter.
@EndlesslyFlowering
Copy link

EndlesslyFlowering commented Mar 19, 2023

overall all the shaders should be checked whether those values are used on linear or gamma encoded values
also I am not sure if they actually want the luma or lumianance vector

@mchaptel
Copy link
Owner

most of those would be better replaced by calls to the helper function with the correct values I think..

Copy link

@EndlesslyFlowering EndlesslyFlowering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not used anywhere, so it's fine too.
changing all shaders to work in linear space will be a huge task.


float get_luma(float3 col) {
return max(dot(col, float3(0.299, 0.587, 0.114)), 0.001);
return max(dot(col, float3(0.2126, 0.7152, 0.0722)), 0.001);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be for use on gamma encoded values
those should be converted to linear first and this can't be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants