-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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: Allow for copying 2d targets to and from layers of 3d textures #29710
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
||
<h3> | ||
[method:undefined copyTextureToTexture3D]( [param:Texture srcTexture], [param:Texture dstTexture], [param:Box3 srcRegion], [param:Vector3 dstPosition], [param:Number level] ) | ||
[method:undefined copyTextureToTexture]( [param:Texture srcTexture], [param:Texture dstTexture], [param:Box3 srcRegion], [param:Vector3 dstPosition], [param:Number level] ) |
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 function can technically take Box2 and Vector2 as arguments, as well. Is there a typical way to signify that here?
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 we separated multiple types with a |
so far.
E.g. https://threejs.org/docs/index.html#examples/en/exporters/DRACOExporter.parse
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.
🎉 And I'll ask here just in case - but are you aware of any way to copy texture mip map data from a src texture to a dst texture mip map? A la the Stack overflow question? It's not clear that it's possible from the WebGL APIs... |
No, sorry :(. |
Related issue: #29688
Description
This PR addresses allows for passing in 2d or 3d textures into the src or destination arguments of
copyTextureToTexture3D
. In the case of a 2d it is treated effectively as a single-layer 3d texture so individual layers can be copied in and out of 3d textures.Ultimately this means that you can pass two 2d textures into the function to copy data between them, rendering the
copyTextureToTexture
function for 2d targets redundant.--
I'm still working out some question I have about copying mipmaps but I think that's separate.
edit I've created a stack overflow question here asking about how to copy a mip map from a source texture.