-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Add copyTextureToTexture3D() to WebGLRenderer
#21244
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
Conversation
|
@DavidPeicho Could you also add an example in this PR? |
|
It would also be good to update the documentation page of |
|
Trying to think what good example I could do. I can do a dummy one with colors but that's not fancy. Just for debugging purposes, on my side I made one updating the "cloud" example with smaller clouds, but that's ugly because it creates discontinuities |
|
Regarding the |
Don't worry about making it fancy. Once it's working I can try to come up with something 👍
Lets just reset them for now. |
|
@mrdoob done. Test example is And thanks to the person that wrote the |
|
Thanks! |
|
Thanks!!! ❤️ |
Description
This PR adds the
copyTextureToTexture3D()to the classWebGLRenderer.Why
Just like for 2D textures, it can be useful to update only a small part of a texture on the GPU. When dealing with volumes of consequent size ( > 128 x 128 x 128 for instance), being able to re-upload only what changed gives enormous performance improvement.
Improvements
Right now, the
pixelStoreiparameters aren't reset:If we plan on adding those on the texture object, then it could make sense to do the
pixelStoreiof those constants directly inWebGLTexturesjust like it's done for 2D textures. Otherwise, we can just reset those to the default values after thetexSubImage3Dcall.