Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DontConvertToLinearOnRead & DontConvertToSRgbOnOnWrite in DrawFX #89

Open
gregsn opened this issue May 16, 2022 · 0 comments
Open
Labels
VL.Stride Wrapper for 3d game engine Stride

Comments

@gregsn
Copy link
Member

gregsn commented May 16, 2022

I found a case where I had to convert a shader that was supposed to be used with the device in gamma color space.
To make it work as expected I had to surround most of the pixel shader code with these calls:

    float4 col = Source.SampleLevel(Sampler0, tc, 0);
    col = ColorUtilityTemp.LinearToSRgb(col);

...
col = ColorUtilityTemp.SRgbToLinear(col);
return col;

What this does is that the pixel shader

  • converts to linear space when sampling the _SRgb texture
  • manually converts back
    And when writing to color buffer:
  • converting to linear space manually
  • converting to _SRgb on rasterization

It works but is quite an overhead.

@joreg joreg transferred this issue from vvvv/VL.Stride Mar 1, 2023
@joreg joreg added the VL.Stride Wrapper for 3d game engine Stride label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VL.Stride Wrapper for 3d game engine Stride
Projects
None yet
Development

No branches or pull requests

2 participants