LDrawLoader: Convert to linear colors when parsing models #23272
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.
Related issue: --
https://raw.githack.com/gkjohnson/three.js/ldraw-linear-color/examples/webgl_loader_ldraw.html
Description
Semi-related to @donmccurdy's color space consistency efforts (#22346) -- all loaders should appropriately label texture color spaces, convert colors to Linear color space, and set the renderer output color space to sRGB. This PR does so for LDrawLoader.
From what I can tell these are the loader examples that still are not setting
renderer.outputEncoding = sRGBEncoding
on the page meaning they don't appropriately set the model color spaces for linear lighting calculations on load where I think the color space should be known at parse time:Here are some before and after screenshots. It seems to get rid of the blue specular look on the black pieces. The AT-ST line colors significantly darker now, as well, because tone mapping is being applied to Linear rather than sRGB values. I'm kind of on the fence about the change because while converting the colors to linear is more correct I kind of stylistically prefer some of the "before" screenshots better. Or maybe I'm just used to them. The spaceman blue definitely looks more like the real model now, though:
cc @WestLangley