pmndrs / react-postprocessing

📬 postprocessing for react-three-fiber
https://docs.pmnd.rs/react-postprocessing
MIT License
1.1k stars 106 forks source link

if there a way to get gl.info from renderpass? #284

Closed tom-twinlabs closed 5 months ago

tom-twinlabs commented 5 months ago

when using effectcomposer, if you get the webgl.info via useThree(), you will always get triangles: 1 (because its true) however, that's not very useful when trying to analyse your scene, instead you probably want the triangles from the initial renderpass, which might tell you some interesting stats about your scene. Is there a way to get it?

Thank you

tom-twinlabs commented 5 months ago

I was able to get this in the end with

const {gl} = useThree();
gl.autoClear = false
gl.info.autoReset = false
useFrame((state) => {
    console.log(gl.info)

        state.gl.info.reset()
})  

Not sure if that's intended to be the way you have to do it or not. Either way I will close the issue