Hey guys,
So I'm looking into gamma/linear correctness and all of that goodness but hit a bit of a hurdle tonight. I'm specifically using SharpDX at the moment but that shouldn't have much of an impact on what I'm trying to accomplish.
SharpDX.Direct3D11.ImageLoadInformation imageLoadInfo = new SharpDX.Direct3D11.ImageLoadInformation();
imageLoadInfo.BindFlags = SharpDX.Direct3D11.BindFlags.ShaderResource;
imageLoadInfo.Format = SharpDX.DXGI.Format.R8G8B8A8_UNorm_SRgb;
SharpDX.Direct3D11.Resource sRGBTexture = SharpDX.Direct3D11.Texture2D.FromFile(device, filepath, imageLoadInfo);
textureView = new SharpDX.Direct3D11.ShaderResourceView(device, sRGBTexture);
The problem is that no matter if I use R8G8B8A8_UNorm or R8G8B8A8_UNorm_SRgb, the sampler in the shader is still reading the same values. If I manually adjust the values in the shader to account for gamma with pow(sampler.sample(), 2.2) then things are back on track again. Perhaps I'm misunderstanding things but I thought that if I changed the format of the ResourceView then it should automatically apply or not apply gamma correction in the texture read.
For instance; https://msdn.microsoft.com/en-us/library/windows/desktop/hh972627(v=vs.85).aspx
Am I mistaken?