react-postprocessing icon indicating copy to clipboard operation
react-postprocessing copied to clipboard

Performance drops when using with drei>Reflector

Open gsimone opened this issue 3 years ago • 2 comments

Demo here: https://codesandbox.io/s/fo7fg?file=/src/Scene.js

<Reflector /> uses this example https://threejs.org/examples/webgl_mirror.html

gsimone avatar Aug 03 '20 13:08 gsimone

reflector is quite expensive, i think it re-renders everything again (?), not sure how these two interact otherwise.

drcmda avatar Aug 03 '20 14:08 drcmda

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).

vanruesc avatar Aug 08 '20 21:08 vanruesc