Sign in to follow this  
trsh

Why is this not allowed?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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 by ivan.popelyshev

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.