This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Colors are stupid, but now tints work
Comfy's GPU tinting works in linear space, and while textures are being converted from sRGB to linear space, the colors passed to shaders are passed as in. Our shaders then do `a*b`, which means we're implicitly doing tinting in linear space. But blood canvas runs on the CPU and uses image data from the `image` crate, which apparently works in sRGB at least in the way we're using it. This means that the same tint color we get from `to_quad_draw(...)` can't just multiply, as that would be sRGB * linear. For simplicity we'll just convert it to sRGB and then do .linear_space_tint(...), which does a conversion to linear space, multiplication, and conversion back. We could do this differently, but this works for now.
- Loading branch information
Showing
3 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters