-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
RFC: workflow
canvas prop
#2299
Comments
My general concern with short prop names is how they describe themselves -- linear, flat, legacy, etc. don't inform me that I'm working with color. I think this makes for a confusing API, despite the above semantical concerns. I like how Don's proposal clarifies their relation to each other in more familiar terms, although I think it's important for options to be documented as to how they would be implemented in three. For existing projects, the only reference point users have would be which encoding, tonemapping, or colorspace they're using. |
if we want the workflow-oriented approach, these could be some opinionated defaults:
Users will reasonably want to change tone mapping and change texture encoding in certain cases. The other settings could perhaps be hidden behind the 'workflow' flag or something like it. Probably it's also worth spelling out what more explicit versions of the API might look like, for example: <Canvas
inputColorSpace={'srgb'}
workingColorSpace={'srgb-linear'}
outputColorSpace={'srgb'}
toneMapping={'filmic'} /> Predefined color space names above borrowed from CSS Color Module Level 4. |
Maybe having the props split up like this for advanced users: <Canvas
colorspace={{ input: 'srgb', working: 'srgb-linear', output: 'srgb' }}
tonemapping={'filmic'} /> Then if I am doing a postprocessing workflow, assuming 'lit' is the default, I can just do: <Canvas tonemapping={false} /> I'm wondering how useful wide reaching presets are here. Seems to me most users use the 'lit' preset for most of their content and then some run into texture encoding issues, and then rarely others are trying to import an entire prelit scene. In those cases I'm thinking it would be better to have a short guide for how to use the @donmccurdy The part I'm curious about in your presets is |
three.js cannot guess the right
I'm certainly not opposed to exposing more granular options if they're clearly and precisely named. I would caution that these "short guides" can get quickly get more complicated as we try to cover lit vs. unlit workflows, and the various post-processing implementations. That complexity cannot totally be avoided — we do need more of these guides — but (maybe) presets are a way to help some users avoid the pain. |
Side note — I'm not totally confident on the best 'unlit' settings. Maybe those users are totally fine going with the 'lit' workflow. The actual performance overhead for the (possibly unnecessary) sRGB → Linear-sRGB → sRGB round trip is probably not much. And effects like blending and color grading do still apply to 2D and unlit stuff, but I have pretty limited understanding of the tradeoffs of doing those operations in sRGB or Linear-sRGB space. |
My intuition is since these workflows are so complicated trying to cover them with presets might also cause more pain compared to having users read some information and ask questions on the Discord. On the other hand, it is nice to tell a user when doing some diagnosis to try putting |
I believe this has become redundant since the introduction of |
three.js r157 added (early, experimental) support for wide gamut color. We have a lot more to do on that side, but I think I feel comfortable suggesting that R3F will — eventually — need some changes to take full advantage of that work:
<Canvas colorSpace={ LinearSRGBColorSpace | SRGBColorSpace | DisplayP3ColorSpace } />
Threlte ships both (1) and (2) now. Wide-gamut color will also require setting Finally, textures need to be tagged with their color space correctly, e.g. |
Definitely a fan of such configuration, and find WRT assigning texture color space, I saw mrdoob/three.js#27042 recently which somewhat worked around this. |
I support this change as well. |
from discord
Don:
[pedantic stuff]
three.js always renders with sRGB primaries and white point (i.e. color gamut) but lighting calculations explicitly do not use the sRGB transfer function (sometimes called a gamma curve). Usually what people mean when referring to named color spaces are:
For that reason flag names like linear={true} and flat={true} are probably adding some confusion... I love short property names as much as the next JavaScript programmer, but color seems to be an area where precise wording pays off. Alternative to the full technical terms would be to have an API in terms of 'what the user wants to do', like workflow={ 'lit' | 'unlit' | 'legacy' | ... } and internally set opinionated defaults for each workflow.
[/pedantic stuff]
Cody:
I'm not sure if people think beyond which encoding/tonemapping they're using.
The text was updated successfully, but these errors were encountered: