trsh Posted May 11, 2020 Share Posted May 11, 2020 for(var i = 0; i < 4; i ++){ const triN = drawFaceTriangle(videoData.video_face_data.frames[0], renderTexture, faceData, mediaTexture); app.renderer.render(triN, renderTexture); } [.WebGL-000002191D5EC530] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 11, 2020 Share Posted May 11, 2020 input = output in your case, cant use renderTexture in sprite that is being in the same renderTexture. Its WebGL restriction. use another renderTexture. trsh 1 Quote Link to comment Share on other sites More sharing options...
trsh Posted May 11, 2020 Author Share Posted May 11, 2020 12 minutes ago, ivan.popelyshev said: input = output in your case, cant use renderTexture in sprite that is being in the same renderTexture. Its WebGL restriction. use another renderTexture. But that I my intention. That the output becomes the input. Any workarounds? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 11, 2020 Share Posted May 11, 2020 (edited) use two renderTextures, one of them is active. re-render one to second. I use that in pixi-layers: https://github.com/pixijs/pixi-layers/blob/master/src/Layer.ts#L68 , however my particular implementation somehow fails in v5, i didnt investigate yet If you learn how to do it with two textures and changing sprite texture every time - you can go even further and try to make a fake texture that points to one or another, here's the trick from the same file: if (group.useDoubleBuffer) { renderer.texture.unbind(rt); this.currentBufferIndex = 1 - this.currentBufferIndex; let buffer = db[this.currentBufferIndex]; (rt.baseTexture as any)._glTextures = (buffer.baseTexture as any)._glTextures; (rt.baseTexture as any).framebuffer = (buffer.baseTexture as any).framebuffer; } anyway, its not possible without two renderTextures. PixiJS does have flip-flopping only in FilterSystem and its not usable outside Edited May 11, 2020 by ivan.popelyshev trsh 1 Quote Link to comment Share on other sites More sharing options...
trsh Posted May 11, 2020 Author Share Posted May 11, 2020 11 minutes ago, ivan.popelyshev said: use two renderTextures, one of them is active. re-render one to second. How do I re-render one to second? Sorry I did not understand that from ur examples. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 11, 2020 Share Posted May 11, 2020 you wrote two lines , one makes something that is rendered, second renders. just pass different textures there one tick you'll do texture1->texture2 the second texture2->texture1 trsh 1 Quote Link to comment Share on other sites More sharing options...
trsh Posted May 12, 2020 Author Share Posted May 12, 2020 17 hours ago, ivan.popelyshev said: you wrote two lines , one makes something that is rendered, second renders. just pass different textures there one tick you'll do texture1->texture2 the second texture2->texture1 Ok thanks. Got it working ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 12, 2020 Share Posted May 12, 2020 Good. This technique is used not only in canvas rendering, it will help you in other places too - two big copies flip-flopping data. trsh 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.