-
-
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
Add new render target types for 3D and array textures. #23498
Conversation
@DavidPeicho Also FYI |
I think we should probably figure out these names too... Texture
Texture > CanvasTexture
Texture > CompressedTexture
Texture > CubeTexture
Texture > DataTexture
Texture > DataTexture2DArray // Should this be renamed to Data2DArrayTexture? Or DataArray2DTexture?
Texture > DataTexture3D // Should this be renamed to Data3DTexture?
Texture > DepthTexture
Texture > FramebufferTexture
Texture > VideoTexture
WebGLRenderTarget
WebGLRenderTarget > WebGL2DArrayRenderTarget // New. Should it be WebGLArray2DRenderTarget?
WebGLRenderTarget > WebGL3DRenderTarget // New
WebGLRenderTarget > WebGLCubeRenderTarget
WebGLRenderTarget > WebGLMultipleRenderTargets // Could we remove this one and use an Array of WebGLRenderTargets instead? (Like how we did with MultiMaterial) |
Just a heads up, Texture3D might still be broken on ANGLE isn't it? At least when you render to a level > 0. Linking the open bug: https://bugs.chromium.org/p/angleproject/issues/detail?id=5009 I think the same will happen with layered textures. Regarding namings, it's not consistent with
Because those types are constructible only with raw data anyway? |
Good point! However, I like the suggestion of @mrdoob to ensure the texture classes always end like so
The two new render target names already sound good to me. |
I don't think we can start a class with a number in JS :( |
Totally forgot that 🤦 . Too bad... |
How about using the same approach like for
|
Or we alias all the existing texture class and go for: TextureCanvas
TextureCompressed
TextureCube
TextureData
Texture2DArray
Texture3D
... Bigger change in the codebase, but from the user's pesperctive all the previous type exists as an alias? |
If we did that we'd have to change the whole API... CameraPerspective, GeometryBox, MaterialPoints, ... |
To me it doesn't seem confusing to only do it for textures, we don't need to do it for every class. |
How about this? Data3DTexture
DataArrayTexture
DataCubeTexture
WebGL3DRenderTarget
WebGLArrayRenderTarget
WebGLCubeRenderTarget Basically |
Sounds good!
|
Updated the PR with the renamed data textures. |
Thanks! |
See: mrdoob/three.js#23498 ### Description - Add new classes: - `WebGL3DRenderTarget` - `WebGLArrayRenderTarget` - `Data3DTexture` - `DataArrayTexture` - Made them deprecated: - `DataTexture2DArray` - `DataTexture3D` - Removed `WebGLRenderTarget.setTexture` - Fixed related classes - Fixed related examples ### What I didn't do - changes applied to `examples/jsm/renderers/webgpu/WebGPUTextures` , since it does not exist in this repository.
* change: Add new render target types for 3D and array textures See: mrdoob/three.js#23498 ### Description - Add new classes: - `WebGL3DRenderTarget` - `WebGLArrayRenderTarget` - `Data3DTexture` - `DataArrayTexture` - Made them deprecated: - `DataTexture2DArray` - `DataTexture3D` - Removed `WebGLRenderTarget.setTexture` - Fixed related classes - Fixed related examples ### What I didn't do - changes applied to `examples/jsm/renderers/webgpu/WebGPUTextures` , since it does not exist in this repository. * fix: Fix a test case that fails because of the previous commit
* Add new render target types for 3D and array textures. * Rename data textures. * Examples: Clean up. * Remove options parameter from new render targets.
Fixed #23466.
Description
The PR implements
WebGL3DRenderTarget
andWebGLArrayRenderTarget
similar toWebGLCubeRenderTarget
.The undocumented
WebGLRenderTarget.setTexture()
can be removed now. It was previously used to overwrite the texture reference of a render target to makewebgl2_rendertarget_texture2darray.html
work. This was actually a hack since the texture reference of a render target should not be replaced.I'll add the doc pages for both new render targets if the PR gets merged.