react-postprocessing
react-postprocessing copied to clipboard
Performance drops when using with drei>Reflector
Demo here: https://codesandbox.io/s/fo7fg?file=/src/Scene.js
<Reflector /> uses this example https://threejs.org/examples/webgl_mirror.html
reflector is quite expensive, i think it re-renders everything again (?), not sure how these two interact otherwise.
Related: https://github.com/vanruesc/postprocessing/issues/219#issuecomment-668572380, https://github.com/mrdoob/three.js/issues/19248
The performance issue is most likely caused by three's outputEncoding
system. Reflector probably triggers shader recompilations each frame due to alternating output encodings (e.g. renderTarget uses LinearEncoding, screen uses sRGBEncoding).