I have a pretty complex scene (I’m using ngl
which is built on three.js). I’m just starting to add color management, so I set renderer.encoding=sRGBEncoding
. Now suddenly my frame rate is 3fps instead of 60, but only when my mouse is moving. Looking at chrome dev tools it seems like most of the time is spent in this bottom-up call stack:
getProgramParameter
fetchAttributeLocations
WebGLProgram.getAttributes
initMateral
setProgram
...renderObject
I know my way around 3d in general but I’m not expert on WebGL or three.js yet. Does this stack mean my materials are getting reinitialized every frame? Is there something I can do about that or is it expected?
My code does alternate between a regular render and a pick render (to a render target).