-
-
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
WebGLRenderer: Add transmission render target scale #30018
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I realized that I have done this directly on the |
Yes, I think a scale factor for transmission makes sense. Depending on the device, using the full resolution is quite taxing.
That is not an issue. |
src/renderers/WebGLRenderer.js
Outdated
@@ -193,6 +193,9 @@ class WebGLRenderer { | |||
let _clippingEnabled = false; | |||
let _localClippingEnabled = false; | |||
|
|||
// transmission render target scale | |||
this.transmissionRenderTargetScale = 1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind documenting this new property here: https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, let me know if the wording is clear enough.
The PR looks good to me! Having the ability to scale the transmission render target resolution is indeed useful. When I remember correctly from earlier discussions, there were reservations to add such properties to the renderer interface. However, since the transmission render target is global we can't use a material setting. So I think the solution here is fine. |
@michaeldll can you add this ability in one example using transmission so it's easy to find for new comers ? ps : thanks for this pr, very useful for mobile and low power device! |
@Makio64 Good call, just added it to Screen.Recording.2024-12-08.at.11.25.14.mp4 |
Fixed #30017.
Description
By default, the transmission render target takes up the full viewport. Reducing this render target size is valuable due to the considerable performance impact of rendering at full resolution and minimal visual degradation by just scaling the transmission render target size.
Here is a quick side-by-side comparison of full scale versus 33% scale, respectively: