-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Clear color is lighter on mobile renderer #79931
Comments
This looks like a linear->sRGB conversion issue somewhere in https://github.com/godotengine/godot/blob/master/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp |
I think it has more to do with the _render_buffers_get_luminance_multiplierset to 2 in the mobile renderer here:
adding a .darkened(0.5) at the end of this line fixed it for me:
not sure if its the correct solution, I would love to create a pull request if you say it sounds right to you |
Yeah it seems like they forgot to multiply the colours by 0.5 in this specific case (Comment in _render_buffers_get_luminance_multiplier says that it gets multiplied by 2 due to using a UNORM buffer and they just multiply by 0.5 when rendering) |
Ya, that sounds right |
Godot version
4.1.1
System information
windows 11, mobile renderer
Issue description
On Mobile Vulkan renderer, the clear color is 50% lighter than expected
See steps to reproduce and Minimal reproduction project below.
The box and background have the same color on Forward+ and compatibility, but not on Mobile
happens also in runtime on exported project, not only in editor preview
Images of the same scene from
![compatibility](https://private-user-images.githubusercontent.com/11915378/256295704-a874fa86-c16f-43ef-aed7-c2066b770ac1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMDkxMDUsIm5iZiI6MTczOTEwODgwNSwicGF0aCI6Ii8xMTkxNTM3OC8yNTYyOTU3MDQtYTg3NGZhODYtYzE2Zi00M2VmLWFlZDctYzIwNjZiNzcwYWMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDEzNDY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQwZGE5MmVhODYzNjBkYmNlZDU1ZmU3NjIxZmM1MTY5NzY4MWViNTU2Y2Y1MjRjYjkyOGZjMDk1YThjNjJkOTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bNSl6FgJKvfs-5gdwe4LXvofLhSq6L9ItlHeXuwOIxs)
![forward](https://private-user-images.githubusercontent.com/11915378/256295714-e416f9a6-dfd4-4c47-bbc2-b552ca58f83c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMDkxMDUsIm5iZiI6MTczOTEwODgwNSwicGF0aCI6Ii8xMTkxNTM3OC8yNTYyOTU3MTQtZTQxNmY5YTYtZGZkNC00YzQ3LWJiYzItYjU1MmNhNThmODNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDEzNDY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmNWUzMzdkYjIzMDRlOTJmMjY2YzA3MzI2ZDU4MzlmMzliOTlmMjliNzhmYWY0NDllZDA2YzhhNGI1N2Y5MmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eWtDSjtGG3iQEXLhqyy8nDEEhICWv0dbvqfkPlU6WFk)
![mobile](https://private-user-images.githubusercontent.com/11915378/256295718-e28e2db8-f7c3-47e2-8c0a-44ce937c9270.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMDkxMDUsIm5iZiI6MTczOTEwODgwNSwicGF0aCI6Ii8xMTkxNTM3OC8yNTYyOTU3MTgtZTI4ZTJkYjgtZjdjMy00N2UyLThjMGEtNDRjZTkzN2M5MjcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDEzNDY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZmNmUxYzFlYWNhNmE3NDA5ZGM5OWQyNzI1MDM0N2Y4NzEwOTkxNTJhODE1OWZiYWRjMTUzZjNjNzlmZWQ1NjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Jet-EJcJ2nPntA_H2hyqejctLnk-dbrUX4PYrzVR0cM)
compatibility:
Forward+:
Mobile:
Steps to reproduce
Box and background are not the same color
Minimal reproduction project
bg_color.zip
The text was updated successfully, but these errors were encountered: