I am currently working on a threejs application that requires updating a texture in each frame. The output encoding of the THREE.WebGLRenderer is set to sRGB.
Upon setting the texture encoding to sRGB, I observed that the rendering result is accurate. However, the frames per second (fps) decreased to about 26-29 on Mac Chrome and 30-40 on HUAWEI Meta40. Conversely, leaving the texture encoding unset resulted in incorrect rendering, but consistently high fps of 60 on both Mac Chrome and HUAWEI Meta40.
I am curious to understand why setting the texture encoding to sRGB caused a drop in fps. Is there any possibility to optimize the fps while maintaining the correct rendering result?
Below is a snippet of the demo code:
<html lang="en">
...
UPDATE:
Further investigation revealed that the render function itself executes quickly (around 1ms), but the requestAnimationFrame calling interval significantly increases when using sRGB texture encoding. This indicates that the GPU might be performing tasks that delay the browser from updating the next frame.