We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

WebGLRenderTarget

Home Forums Programming WebGLRenderTarget

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #21611
    vincent
    Customer

    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)

    #21619

    Hi,

    But now there is a bug at the execution.

    what error is thrown in browser console?

    Chief 3D Verger | LinkedIn | Twitter

    #21624
    vincent
    Customer

    WebGL: 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

    #21625
    vincent
    Customer
    WebGL: 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
    #21627

    try this one:

    appInstance.renderer.setRenderTarget(bufferTexture);
    appInstance.renderer.render(scene, camera);

    Chief 3D Verger | LinkedIn | Twitter

    #21630
    vincent
    Customer
    v3d.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.
    #21650

    Hi 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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.