-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Texture: add setValues() #28756
base: dev
Are you sure you want to change the base?
Texture: add setValues() #28756
Conversation
this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; | ||
this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; | ||
|
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.
These are default values inherited from RenderTarget
. Should we use NearestFilter
as the default for WebGL3DRenderTarget
and WebGLArrayRenderTarget
? #28100 (comment)
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.
Yes, that seems right.
FYI: I've deleted my previous comment since I had to read the change more closely to better understand it^^.
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.
I think I'm still wrong here, since RenderTarget
creates its own texture whose configuration I was referring to here. We can make texture
an option and pass the instantiated CubeTexture
etc. if we really wanted to inherit the configuration there.
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
for ( let i = 0; i < count; i ++ ) { | ||
|
||
this.textures[ i ] = texture.clone(); | ||
this.textures[ i ].isRenderTargetTexture = true; | ||
|
||
} | ||
|
||
this.depthBuffer = options.depthBuffer; |
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.
I'm afraid it is not correct to add non-texture related properties into the setValues()
parameter. options
should only hold values which are properties of textures. Something like depthBuffer
is a RenderTarget
property.
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.
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.
This PR doesn't generally discern options belonging to the render target and its underlying texture.
Need to do that all over.
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.
Okay, I'll convert the PR to a Draft-PR in the meanwhile. Convert it back when it is ready for a review 👍
Related issue: #28100
Description
Adds a
setValues
method toTexture
, and uses it in render target classes, some of which didn't set texture parameters before.