-
Notifications
You must be signed in to change notification settings - Fork 10
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
Color Inaccuracies between Shadertoy.com renderer and shadertoy-rs #29
Comments
I believe you're correct that it's to do with interpolation, and my first thought is that it's due to sRGB, which is designed to take things like computer display technologies and human color perception into account if I remember correctly. Usually this is considered desirable. If this is indeed the case, I'm not sure why shadertoy.com doesn't use it, as it seems fairly standard at this point (have you tried in different browsers with different graphics implementations?). I'd have to dig into this a bit more to find out for sure but if it's indeed an sRGB issue I'd guess that it should be possible to disable in gfx-rs or something. |
Following your suggestion I tried opening the shader in ShaderToy on different browsers and OSes. They all behave the same (as initially described). I've tried Linux Chrome and Firefox as well as Windows Chrome and Firefox. On different GPUs (Nvidia 960 and 2070). I investigated a little bit on sRGB and I think you are correct. I found some issues on gfx related to being unable to turn off sRGB. (gfx-rs/gfx#997) One seemed to hit the point and provided a possible fix. gfx-rs/gfx#1915
However it does force the use of unsafe code. I can open a pull request for this if you wish so. |
Huh, does indeed seem to be a gfx-related bug, as shadertoy-rs makes use of If you wanna send a PR for this, go for it! All I'd ask is that you gate the change behind a CLI flag (maybe something like |
Yep I noticied that. I even tried to explicitly set the use of srgb to false for glutin but to no avail.
I was looking into this as well at first to see if other libs would have the same issue but could not find a really good fit. Either really low level like vulkano proved too difficult for me 😅 and wgpu seems like is more geared towards WGSL rather than GLSL.
All right I'll prepare something ! |
Hello,
I was using shadertoy-rs when I discovered a weird issue that seem to suggest rendering on shadertoy-rs is not 100% the same as on the website.
As an example look at this shader.
https://www.shadertoy.com/view/ttB3Rh
What you will see is three major colors (RGB) with minimal blending between the colors.
When rendering this same shader with shadertoy-rs. I find the result to be quite different.
I see that the section between the red and green has a way more pronounced orange tint than the shadertoy rendered version.
At first I thought that there was some kind of weird color interpolation going on somewhere, I tried to look around the code but could not find anything suspicous. (My knowledge of computer graphics is very limited). Do you have an idea of where this issue might be coming from ?
OS: Arch linux, X11
i3 window manager
Let me know if more debug data is needed.
The text was updated successfully, but these errors were encountered: