-
-
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
PMREMGenerator extension: Now you can set texture size and position #30334
base: dev
Are you sure you want to change the base?
Conversation
Arrays are not currently taken into account by the wgslTypeLib. However, with the struct extension mrdoob#29908, arrays will also become important as a type.
Update WGSLNodeBuilder.js
Since textureSampleLevel is usable in compute shaders, this small PR allows sampler to be used in compute shaders for this purpose
enables the use of samplers in compute shaders
add background to environment reflection
Update webgpu_pmrem_scene.html
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Please add the size and position to the three.js/src/extras/PMREMGenerator.js Line 112 in a13e4b0
|
I'll take care of it over the weekend, luckily it's a small thing |
I remember how Sunag adjusted these lines to fix the reflection error. These were still at the old status in the webgl PMREMGenerator. I also adjusted that straight away. I see that no environment is rendered in the webgl_pmrem_test as was previously the case with the webgpu pmrem example. Therefore, this will never have been noticed.
|
Do you mind revert this change in |
No problem, I'm happy if I can contribute something to the project, even if it's not much. |
* @return {WebGLRenderTarget} | ||
*/ | ||
fromScene( scene, sigma = 0, near = 0.1, far = 100 ) { | ||
fromScene( scene, sigma = 0, near = 0.1, far = 100, size = 256, position = new Vector3( 0, 0, 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.
Couldn't we have these properties in class scope? e.g:
const sceneRT = new THREE.PMREMGenerator( renderer );
sceneRT.position = new THREE.Vector3( ... );
sceneRT.faceSize = 256;
sceneRT.fromScene( ... )
Maybe we will have more options in the future, that should help.
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.
position
and size
are only relevant for fromScene()
and have no purpose for the rest of the API. Hence, I would favor to keep both in the method signature. As a compromise, how about doing the following?
generator.fromScene( scene, sigma, near, far, options );
In this way, we can add position
, size
and potentially future configuration properties to options
.
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.
Sounds good to me.
Related issue: #30071
I have modified the PMREMGenerator so that you can now change the texture size and position. To do this, I changed the values to a parameter list. In my opinion, that makes more sense than having to constantly hand over all the values. This way you only need to specify the ones you want to change. Otherwise you would have to fill the empty spaces with undefined.
This change made it necessary to also adapt the examples webgpu_ocean, webgpu_postprocessing_ao, webgpu_postprocessig_ssr