When I use one to render to texture and then sample back, the color is mapped from 255 to 209. I suspect that gamma conversion occurs when rendering to texture. Is there a way to avoid this situation?
Rendering to textures has a color change
-
- Gnoblar
- Posts: 1
- Joined: Wed Aug 09, 2023 3:37 pm
-
- Orc
- Posts: 405
- Joined: Sat Jun 23, 2007 5:16 pm
- x 115
Re: Rendering to textures has a color change
For me this was solved when I changed here:
Code: Select all
TextureGpu* renderTexture;
renderTexture->setPixelFormat(
from:
PFG_RGBA8_UNORM ); // dark jpg saved, good preview in app
to:
PFG_RGBA8_UNORM_SRGB ); // good jpg saved, white preview in app
-
- OGRE Team Member
- Posts: 5476
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1358
Re: Rendering to textures has a color change
As I said in Github, gamma conversion does NOT convert 255 into 209. In both linear and sRGB space 255 is 255.
Thus something else must be going on.
I forgot to ask: Did you try using RenderDoc? It even has source level debugging for shaders.