Home › Forums › Programming › WebGLRenderTarget
- This topic has 6 replies, 3 voices, and was last updated 4 years, 11 months ago by Ivan Lyubovnikov.
-
AuthorPosts
-
2019-12-03 at 10:58 am #21611vincentCustomer
I work on custom a function like Replace Texture. I need to do appear camera view on a mobile phone.
In the previous version of Verge3D (V9), we create a v3d.WebGLRenderTarget in order to render the scene in it :
var bufferTexture = new v3d.WebGLRenderTarget( window.innerWidth, window.innerHeight, {minFilter: v3d.LinearFilter, magFilter: v3d.NearestFilter, antialias: true});
appInstance.renderer.render(scene , camera, bufferTexture);But now there is a bug at the execution. (I work with Verge3D 16.0)
2019-12-03 at 12:57 pm #21619Yuri KovelenovStaffHi,
But now there is a bug at the execution.
what error is thrown in browser console?
2019-12-03 at 1:55 pm #21624vincentCustomerWebGL: too many errors, no more errors will be reported to the console for this context.
1559v3d.js:1 v3d.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.
render @ v3d.js:1
render @ visual_logic.js:920
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:917
requestAnimationFrame (async)
render @ visual_logic.js:9172019-12-03 at 1:57 pm #21625vincentCustomerWebGL: too many errors, no more errors will be reported to the console for this context. 1559v3d.js:1 v3d.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead. render @ v3d.js:1 render @ visual_logic.js:920 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917 requestAnimationFrame (async) render @ visual_logic.js:917
2019-12-03 at 2:29 pm #21627Yuri KovelenovStaff2019-12-03 at 4:04 pm #21630vincentCustomerv3d.js:1 v3d.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead. Eo.safeSetTexture2D @ v3d.js:1 Aa @ v3d.js:1 Ya.upload @ v3d.js:1 ye @ v3d.js:1 renderBufferDirect @ v3d.js:1 ve @ v3d.js:1 me @ v3d.js:1 render @ v3d.js:1 render @ visual_logic.js:874 replace3DTexture @ visual_logic.js:876 (anonymous) @ visual_logic.js:975 (anonymous) @ visual_logic.js:663 (anonymous) @ visual_logic.js:661 pickListener @ visual_logic.js:605 visual_logic.js:875 [.WebGL-0x5592c7fa61f0]GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.
2019-12-04 at 10:56 am #21650Ivan LyubovnikovStaffHi vincent,
You can also try to restore the scene’s original render target after rendering into “bufferTexture”:
var currentRenderTarget = appInstance.renderer.getRenderTarget(); appInstance.renderer.setRenderTarget(bufferTexture); appInstance.renderer.render(scene, camera); appInstance.renderer.setRenderTarget(currentRenderTarget);
From the error you posted it looks like “bufferTexture” is used in the scene on some object as a texture while still being the active render target for this scene, which isn’t alowed, but it’s difficult to tell what’s going on without knowing the actual code.
Co-founder and lead developer at Soft8Soft.
-
AuthorPosts
- You must be logged in to reply to this topic.