Fix premultiplied sRGB browser rendering - #533
Open
SoprachevAK wants to merge 2 commits into
Open
Conversation
added 2 commits
August 17, 2026 06:39
Use the scene item's linear-sRGB state to select the appropriate draw path for the premultiplied browser texture. When linear compositing is active, decompress the texture and enable framebuffer sRGB. Draw it without conversion for nonlinear compositing.
Chromium composites content in nonlinear sRGB. Set OBS_SOURCE_INITIAL_BLEND_METHOD_SRGB_OFF so new browser items use nonlinear compositing and more closely match their appearance in Chromium.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Uses the scene item's linear-sRGB state to select the correct rendering path for premultiplied browser textures:
DrawSrgbDecompressPremultiplied.Also sets
OBS_SOURCE_INITIAL_BLEND_METHOD_SRGB_OFFso new browser scene items initially use nonlinear blending.Depends on obsproject/obs-studio#13797, this fixes #469.
Motivation and Context
This is the obs-browser companion to obs-studio#13797, which contains the core rendering changes, migration logic, and full motivation.
Chromium composites content in nonlinear sRGB, so browser sources should initially use nonlinear blending while still providing a correct linear rendering path when selected by the user.
How Has This Been Tested?
Manually tested on a MacBook Pro with an Apple M5 Pro running macOS 26.5.2, together with the changes from obs-studio#13797.
Verified both linear and nonlinear blending with opaque and semi-transparent content over transparent, black, and white backgrounds. The test page, comparison screenshots, and detailed results are included in the main PR.
Types of changes
Checklist: