-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
CopyShader opacity does not work as expected #19531
Comments
Yes, likely. One needs to check the three.js examples where this is used -- used both directly and indirectly. Check |
I have second thoughts on this... I trust the original author knew what he was doing back in 2011.
If you want to further scale the opacity, you need to scale all four components. I would be inclined to revert #23671, and look elsewhere if there are issues. |
Yes, it seems better to revert the PR. That means however shader materials using three.js/examples/jsm/postprocessing/TexturePass.js Lines 23 to 31 in e9b9783
I can file a PR with updating the respective example code. |
I am not sure that is correct. Maybe no-blending.
|
The problem is that What is the downside of always setting |
You can try. There have been many piecemeal attempts at getting post-processing working correctly with opacity < 1. So far, it's always been one more thing to try to fix... |
Description of the problem
In examples/js/shaders/CopyShader.js, there is an issue with the fragment shader:
Because
texel
is multiplied byopacity
directly, all elements of the color are scaled by the opacity value. This means on a black background, the opacity is effectively applied twice. On any other background, the resulting color will end up darker than expect.Proposed Solution:
Multiply only the alpha component by opacity:
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: