WebGLRenderTarget: .clone() does not clone framebuffer/texture data.
See original GitHub issueDescription of the problem
When cloning an equirectangular CubeTexture the result is a black texture. The same operation does work with a CubeTextureLoader loaded texture (with 6 images).
No map after clone()
- jsfiddle clone (latest release branch)
- jsfiddle clone (dev branch)
Three.js version
- Dev
- r117
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Hardware Requirements (graphics card, VR Device, …)
Resolved
When using refraction for an equirectangular texture with EquirectangularRefractionMapping
, using it as a background does not work, an the mapping has wrong seams. For CubeTextureLoader with CubeRefractionMapping
both of that works (see cubemap refraction).
wrong background rendering & seam
- jsfiddle refraction (dev branch)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
three.js - Can't clone() Texture - Stack Overflow
TextureLoader().load() sets the needsUpdate flag for you, while cloning does not. Do this, instead var texture2 = texture1.clone(); texture2.
Read more >Material#clone – three.js docs
Sets the alpha value to be used when running an alpha test. The material will not be rendered if the opacity is lower...
Read more >Object3D - Verge3D User Manual - Soft8Soft
An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will...
Read more >THREE.js base for shadow testing - Unsaved project - Plunker
Vector3( 0, 1, 0 ) ); var quatInverse = quat.clone().inverse(); var lastPosition = new ... InstancedBufferGeometry but hardware does not support extension ...
Read more >Team:Munich/Hardware/threeJS - iGEM 2018
clone : function () { ... this method does not support reflection matrices ... WebGLRenderTarget.prototype = Object.assign( Object.create( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
clone()
methods inthree.js
turned out to be problematic in various classes. They work well with math primitives but cloning more complex objects is problematic since it is not always possible to replicate the “correct” object state. This is especially true for render targets. After reconsidering this issue, it’s just not feasible to copy framebuffer data for cloned render targets. SoWebGLRenderTarget.clone()
just creates a new render target with the same configuration but not with copied data.Sounds like a good solution. I agree, that it is kind of strange that it works.