"Feedback loop formed between Framebuffer and active Texture."

What does this mean?
[.WebGL-000001541E5BFBE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.

On a scene I have it just dumps that a bunch of times. Does not really seem to effect much, but is still odd.

You are trying to render to a texture using a shader relying on the same texture which creates trouble.

Im not using any custom shaders in the scene. I am using the customMaterial but not binding any buffers anywhere.

This sounds really strange. Could you repro in the playground ?

maaaayyyybe… um, damn it might be hard to… uhhhhhhh.

how against signing a quick NDA are you? Then I could just send you the scene as just a simple webpage.

Its not really gonna be conducive for me to take the time to make a PG right now given my workload.

If you cant I get it, but then this flag might have to wait for a couple week or two here.

I can not do that or it requires lots of approval from where I work :slight_smile:

And your scene will be a lot too much to troubleshoot. Isolating the issue is the way to go but this error come for sure from the issue above.

2 Likes

Hi, a while ago I ran into a similar error. It turns out that it had a texture of the MirrorTexture type and when I went through the scene through a loop adding the objects so that they were reflected in that mirror, I also tried to add the object that had the mirror texture, producing that error. I don’t know if it will be your case but if you have a MirrorTexture there, check that you are not trying to add the object that contains the texture. I solved it by adding an if to the loop where I was loading the objects.

scene.meshes.forEach(function(m) {      
  if (m.getClassName()=='Mesh' && m.name!="TestingMirror")
  {
    console.log("added to mirror: "+m.name);
    mirrorMaterial.reflectionTexture.renderList.push(m);        
  }
})
6 Likes

Yes. And this can happen if you load another camera into the scene (like a miniMap).

You also need to wait for the meshes list to be fully loaded before applying any filters:

const renderTargetTexture = new RenderTargetTexture("depth", 1024);

scene.customRenderTargets.push(renderTargetTexture);

renderTargetTexture.activeCamera = camera;
material.diffuseTexture = renderTargetTexture;
cameraMesh.material = material;

scene.onDataLoadedObservable.add((scene: Scene) => {
	renderTargetTexture.renderList = scene.meshes.filter(
		(mesh: AbstractMesh) => {
			return mesh.name != cameraMesh.name;
		}
	);
});