-
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
Add option to force SRGB off within opengl #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some minor nits
@@ -118,6 +121,8 @@ impl ArgValues { | |||
(None, false) | |||
}; | |||
|
|||
let force_srgb_off = matches.is_present("force_srgb_off"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and elsewhere (README.md
, src/cli.yml
), I'd prefer force-srgb-off
(i.e. dashes instead of underscores
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems there is another parameter that is making use of underscores anisotropic_max
. Should this one be changed to dashes too while I'm at it :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh! I missed that. In that case, for the sake of both uniformity and backwards compatibility, let's just use underscores for everything :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Adjusted help message
@@ -118,6 +121,8 @@ impl ArgValues { | |||
(None, false) | |||
}; | |||
|
|||
let force_srgb_off = matches.is_present("force_srgb_off"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks for your contribution! |
Following issue #29
By default, GFX enables FRAMEBUFFER_SRGB in OpenGL. Even if shadertoy only uses RGBA at some point the conversion to SRGB is made which leads to disparities between shadertoy.com's rendering and shadertoy-rs's. This PR adds the option to disable FRAMEBUFFER_SRGB in OpenGL with a flag.
Unsafe has to be used in this case.
Shader used to compare changes.
Before:
![image](https://private-user-images.githubusercontent.com/4690919/277434866-851dc7f4-5ca3-4098-84de-d745fd42d255.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg3ODE1NDEsIm5iZiI6MTczODc4MTI0MSwicGF0aCI6Ii80NjkwOTE5LzI3NzQzNDg2Ni04NTFkYzdmNC01Y2EzLTQwOTgtODRkZS1kNzQ1ZmQ0MmQyNTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDVUMTg0NzIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmYwNzQ0YmJhOWRiM2Y0N2JkYjYxMGQ5YmYxNjlkODQ5MjQ5OWJiMzhjMjczMzEzNDMwZTk2OGMzMTc0NWJhZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.rSirRkuxMcI9KxkJGggkCS4dvYjcu_fT9_Y2w2jr0O8)
After:
![image](https://private-user-images.githubusercontent.com/4690919/277434964-41f64f1d-1ee3-4204-a4e3-612562a6c796.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg3ODE1NDEsIm5iZiI6MTczODc4MTI0MSwicGF0aCI6Ii80NjkwOTE5LzI3NzQzNDk2NC00MWY2NGYxZC0xZWUzLTQyMDQtYTRlMy02MTI1NjJhNmM3OTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDVUMTg0NzIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODlmYmYwNmMxOTQyZGM3MmE3YTQ2MTI2NmI2Zjk5ODA2Y2JlOGVjNDc1MGNlYzQ5MDc0NWMwMGI5ZDcyNmUyMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.2ryHZDCVUFLhnuALkbt1QuABVd_ylmOt5yVa5fOC0HA)
For more details see initial issue as well as :