PBR shader error on WebGL1.0

in PBRMaterialDefines class it defines NUM_SAMPLES as “0u” directly which does not supported on WebGL1.0,

therefore it brings parse error on our customized platforms (based on webkitcore):
image
actually the shader has handled this already:

#ifdef WEBGL2
         for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
         for(int i=0; i<NUM_SAMPLES; ++i)
#endif

or:

but the predefintion does not…
so I manually deleted the ‘u’ (I think it actually is an INT or UINT auto type?), and the PBR shader works, but, with wrong appearance:

1, environment cubemap reflection missing on the surface. (SPH diffuse works)
2, ugly black strips on the model (not sure it’s shadow color or AO map color)
image

correctly one:
image

Pinging @Evgeni_Popov and @sebavan

On it i ll fix it tonight for the compilation issue, about the wrong appearance with stripes could you share a repro ? I can not seem to reproduce with other models ?

i guess it related to shader precision or something. last time when i was creating some 2d efx shader if use sin to generate random number the black strip appears on the graphics. because our platform is not a standard web browser so not sure if this is the same issue, so i think you probably cant reproduce the bug on standard browser. anyway i’ill provide you a zip link later tomorrow when i’m in office (please keep the file secret because it’s our business confidential, thanks, that’s the reason i didnot create a PG case for you sorry.)


this is the issue last time i encountered.
i’ll try to find the exact reason tomorrow on my side and let you know.

Non problem i ll keep it secret :slight_smile: and let you know if I can spot smthg

1 Like

sent through PM. :wink:

@sebavan and another problem when Engine creation:

I think same as this one:

I modified the source code according to that issue to:

if (this._gl.HALF_FLOAT_OES !== 0x8D61) { // Half floating-point type (16-bit).
        this._gl.HALF_FLOAT_OES != 0x8D61;
    }

and it works, but not sure if this is the solution.

I refered the next line in the source code:

today I found, that a conculsion is, the black strips only appears on iOS device.

May I ask what browser you are using cause I can not seem to repro those issues :frowning: (still working on the stripes one)

it’s actually a WebView based on Tencent X5 engine. so yes hard to reproduce for you. i’ll try more and let you know. thanks so much for the help.