-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Used color space (sRGB vs Linear) #1724
Comments
I don't have your answers right now, and perhaps surprisingly I am not the best person to answer. Looking at it from a casual distance, the subtleties and wording involved in srgb/linear space discussions are still mostly confusing to me (even though a few kind people have made an effort to explain things and I've got several e-mail/articles to re-read). Linking this post to #578 for now. |
Ok thanks, I will take a look. As a side note, the two problems that I am facing are:
|
I changed the HLSL vertex shader to:
and my dithering problem is solved (you cannot see the quantization banding anymore): |
It appears that the right solution here is to use SRGB texture view e.g. here: |
@DiligentGraphics this would not solve the whole problem as the vertex colors are not part of a texture. Furthermore, (I need to double-check) ImGui uses one font texture that is black and white-ish (i.e. linear black/white = sRGB black/white). Of course if the latter would have some colors in between, an sRGB will be the better fit. Other related ImGui issue with more detailed info: #578 (comment) |
…AT_R8G8B8A8_UNORM_SRGB Shader taken from ocornut/imgui#1724
Based on the vertex structure used,
I assume that
col
represents a color in sRGB color space (i.e. not in linear color space)?Since these vertex structures aren't modified and sent straight to the actual vertex buffer, and since the D3D11 vertex layout is the following:
I assume that the color attribute of a vertex is still expressed in sRGB color space?
Based on the exemplar D3D11 pixel shader used,
I assume all intermediate calculations occur in sRGB color space and sRGB colors are written to a non-sRGB RTV?
If all of the above questions are answered with "yes" and I want to work in a linear color space instead, is it just necessary (and efficient) to:
transform
ImDrawVert
to a custom format instead of usingImDrawVert* vtx_dst = (ImDrawVert*)vtx_resource.pData;
directly;change the vertex input layout to a
DXGI_FORMAT_R32G32B32A32_FLOAT
?The text was updated successfully, but these errors were encountered: