aframe-effects icon indicating copy to clipboard operation
aframe-effects copied to clipboard

Component does not clean up correctly when A-Frame inspector loads

Open UXVirtual opened this issue 8 years ago • 4 comments

I've found that when opening the inspector, the effects layer doesn't seem to be removed from the scene, preventing interaction with entities in the inspector viewport. See the official demo here for an example of this: https://wizgrav.github.io/aframe-effects/index.html

In the demo, unchecking 'Toggle Effects' before opening the inspector allows the inspector viewport to function as expected.

The big problem here is that the inspector has no way of adding some kind of pre-launch hook so code can be run beforehand, so components must take this into account during their component specific render loops so they're aware of the inspected open / close states.

UXVirtual avatar Jul 12 '17 06:07 UXVirtual

I've debugged a bit and It seems strange, even if I start the inspector without post processing and then do eg. a scene.setAttribute("effects", "bloom, fxaa") the post processing will take effect only after you revert to the non inspector scene.

My guess is that another scene is created and all components are serialized to it for the inspector. The effects attribute updates the system though. I'll need to consult @fernandojsg on this

wizgrav avatar Jul 13 '17 15:07 wizgrav

Ok I think I'm getting somewhere, scene.isPlaying is false in the inspector(scene is paused) so tick and tocks are not getting called it's not a new scene it's just that the scene is set up by the effects system to render on scene.renderTarget (when set rendering will happen to that instead of directly on the canvas). I need to find a way to get notified when play state changes to disable effects.

This means that post proc won't work in the inspector which is kindof a shame since the inspector would be great for tuning the effects. I'll bring it up in slack for discussion

wizgrav avatar Jul 13 '17 17:07 wizgrav

Any update o workaround on this issue?

diegodorado avatar Jan 22 '18 22:01 diegodorado

Yeah this needs some update, I was planning to do it along with the ssao effect which also is almost done but then life and changing countries and jobs put it on halt. I'll try to at least fix this and some more minor issues this w/e

wizgrav avatar Jan 22 '18 22:01 wizgrav