Fix examples to avoid fading alpha#33450
Conversation
|
|
I'm not sure what this means exactly. Does this mean that "ColorSpaceNode" that is modified in #33437 is not run? If so I'm not sure why the example would be changing at all? |
|
@gkjohnson Sorry, I have updated my latest comments since they were wrong. The example does indeed output sRGB values. The tone mapping and color space conversion just happens before the sobel pass runs. The https://threejs.org/examples/webgl_materials_physical_transmission_alpha Does that explain why the demo is affected by #33437? |
The are effects that require sRGB input. Sobel, FXAA or LUTs are some examples where this is the case. |
I understand why FXAA and LUT may need this but I don't see why this would have to be the case for sobel. But either way how is this being indicated? And what should the solution be? We can:
The same question applies for any of the other relevant examples in #33437 |
Let's do this. I think all examples should do that if they don't want to blend with the HTML background. |
|
Personally, I think That would mean the renderer parameter |
|
I've made the changes in #33452
I don't have a strong opinion about this. Users should be setting a clear color relevant for their use case either way. --
Can you explain how it's being indicated per effect in render pipeline that an effect needs srgb or linear input? How is it that bloom can run before srgb conversion but sobel is running after? |
|
We currently assume at one point in the render pipeline the "render output" must happen. That means tone mapping + color space conversion. The current system allows to define when this step should happen. This can be different depending on how you render pipeline is set up. We know there can be theoretical use cases where you have e.g. three subsequent effects where the first on requires sRGB input, the second linear-srgb and third one sRGB again. This is currently not supported. The passes do not indicate what color space input they need. The user must know that from the documentation. E.g. |
I understand that 😅 but how is it happening in this case. Is the |
Yes, It's renderOutput.
The automatic conversion is disabled when |

Related issue: #33437 (comment)
Description
Fixes some examples incorrectly attenuating alpha resulting in the CSS background showing through.
I'm still not sure what's going on with "webgpu_postprocessing_sobel" in the above comment, though.