If I open example webgl_mirror.html and add renderer.outputEncoding = THREE.sRGBEncoding; around line 56, I get a massive performance drop. The animation is stuttering and really slow. If I remove the line the animation is smooth again.
I also observed this in the release version of r113.
I use linux, ubuntu 19.10 and I can observer this both in Firefox and Chrome. (More severe in Firefox)
Has anyone else encountered this problem? Should I open a github issue?
The problem is that the encoding of the renderer and the internal render target of Reflector are different. That means all shader programs are recompiled per frame which of course totally kills the performance.
If you need sRGBEncoding, you can fix the issue by adding encoding: sRGBEncoding to the following parameters object in Reflector:
Please verify first if the above approach fixes your issue. If so, I think it could still be valuable to report this at github. Ideally objects like Reflector could automatically derive the correct encoding from WebGLRenderer in some way.
Hi Mugen87, this indeed fixed the problem. Question: Can I set encoding: sRGBEncodingin the release version? I don’t see how (or I miss something) Should I copy Reflector.js to my project? What would be a good approach fixing this for my project using r113?
I’m happy to open up a github issue if this helps…