-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Transmission not working properly when a Reflector is added to the scene #27846
Comments
I've investigated the issue and found that the problem is the renderer To workaround the problem I added 2 new methods to WEBGLRenderer:
Then added a render target for transmission to Reflector class and used it in onBeforeRender and onAfterRender callbacks:
In this way transmission is renderered correctly. In my particular use case I also use a transparent background and found that this line in WEBGLRenderer is a bit arbitrary because the alpha setting is hardcoded. It would be useful to be able to control the alpha/clear color for transmission. |
You are referring to: if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 ); Some background information about the mentioned line: #25819 (comment) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Um, issues like that show how tricky the transmission implementation is^^. @LR17 Instead of having The idea is to have a transmission render target for each render state. Can you please give the following commit a try and see if it solves the issue? Mugen87@449b914 |
Yes, it works! |
Description
The transmission effect is not correct when a Reflector is added to the scene and facing the camera. It seems that the
WebGLRenderer.render()
invoked insideReflector.onBeforeRender()
alters the internal state of the renderer while it is rendering the transmissive object.Reproduction steps
Live example
Screenshots
No response
Version
dev
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: