cables-gl / cables_docs

cables documentation docs.cables.gl
https://cables.gl/docs/docs
45 stars 16 forks source link

cgl_pixelreader:220 WebGL #920

Open strangerattractor opened 2 days ago

strangerattractor commented 2 days ago

This scene: https://cables.gl/edit/rLyfqu

Looks fine on my phone and on my Deskstop: Machine info: https://cables.gl/browser/r/673cf2d084f54ec84f3c9f01

But throws these errors on my laptop once per frame:

cgl_pixelreader:220 WebGL: INVALID_ENUM: readPixels: invalid format

cgl_pixelreader:220 WebGL: too many errors, no more errors will be reported to the console for this context.
read    @   cgl_pixelreader:220

and looks broken like so:

image

Machine info: https://cables.gl/browser/r/673cf4d584f54ec84f3c9f83

strangerattractor commented 1 day ago

SOLVED

Nevermind,

I found the bug in my own code. Though I don't 100% understand it.

In the shadercode I had this line:

            // Early exit for fully occluded rays
            if (transmittance < DensityThreshold) {
                break;
            }

But I can't use "break" here, because it breaks the entire loop early on my laptop.

CONTINUE works: // Early exit for fully occluded rays if (transmittance < DensityThreshold) { continue; }

Some precision thing I don't understand.