Skip to content

Model 1/2: blend translucency in linear light/color space - #387

Merged
dukeeeey merged 1 commit into
trzy:masterfrom
toxieainc:m12_linearblend
Nov 21, 2026
Merged

dukeeeey merged 1 commit into
trzy:masterfrom
toxieainc:m12_linearblend

Conversation

@toxieainc

Copy link
Copy Markdown
Contributor
  • In blend mode (Transparency = 2), checkerboard and moire polygons now blend in linear light through an sRGB frame texture, as the dots would mix on an arcade CRT
  • The sRGB format is used only in blend mode; SetTransparency() recreates the frame target when the mode switches to or from blend
  • The shaders get transparency value 3 only when the renderer's own framebuffer exists. Otherwise blending works as before
dither new old

as you can see (hopefully, look at it at 100% resolution), the old/current one is too dark when compared with the original dithered output.

- In blend mode (Transparency = 2), checkerboard and moire polygons now blend in linear light through an sRGB frame texture, as the dots would mix on an arcade CRT
- The sRGB format is used only in blend mode; SetTransparency() recreates the frame target when the mode switches to or from blend
- The shaders get transparency value 3 only when the renderer's own framebuffer exists. Otherwise blending works as before
@toxieainc

Copy link
Copy Markdown
Contributor Author

..oh my, for whatever reason the github uploaded images produce kinda the opposite impression, but if you grab the same frames and use e.g. paint.net to flip back and forth, then the new/this-PR variant looks like the dithered one brightness-wise.

@dukeeeey
dukeeeey merged commit d430b94 into trzy:master Nov 21, 2026
@toxieainc
toxieainc deleted the m12_linearblend branch November 21, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants