About FBO and getProgramInfoLog delay. #3435
-
Hi everyone! I have a simple question regarding the FBO and the 3.5 second long delay; which happens due to the 'getProgramInfoLog' process. On Debian environment, the loading is significantly lower (like 200ms) Packages
NotesNot using Next turbo thing, just a plain Web Pack setup (followed next-three-drei template) Example (takes some time.. like 5 seconds..)https://codesandbox.io/p/devbox/l49qhm Is there any possible solution to asynchronously build the texture, such that UI doesn't get blocked? I tried suspend, dynamic import, etc, but none works without initial freeze on the browser's end, due to the WebGL being blocked with getProgramInfoLog. Found some old issues that mentions disabling it with EditThere was a duplicate post on here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The linked example is a problematic one since it's pulling in quite a complicated noise function. The second or 3D noise function is simply Perlin noise (which Curl noise extends). My suggestion would be to precompute the noise patterns in a texture and look it up (AKA LUT or Look Up Table). This should speed up the shader quite a bit and incidentally lower compile time. Unfortunately, Codesandbox is easily broken here for me so I can't download or modify your example without the site crashing. |
Beta Was this translation helpful? Give feedback.
gl.getProgramInfoLog
comes from shader compilation, which is blocking as program linking and validation waits on shaders to compile. This is done serially in three.js, so all (unique permutations of) materials will compile in lockstep. Same story with any other GPU resource, like (geometry) vertex buffers or textures which are uploaded from the CPU.WebGLRenderer.compileAsync
would help in the case of many meshes or unique programs, but not in the case of a single material or blocking resource. Precompiling shaders or preloading textures helps when there is already parallel work to begin with, but strictly introduces latency otherwise. Further, compressed texture formats like KTX2 or imag…