[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Weird shader compiler error - casting a mat4 into a mat3.



----- Original Message -----
> I have an odd vertex shader compiler error that's happening on just
> one
> of my machines.
> 
> The shader is utterly minimal (it renders a sky box) - and the error
> message is cryptic:
> 
> error C0201: unsupported version 120
> 
> ...the problem appears to be that I'm trying to cast a 4x4 matrix into
> a
> 3x3 matrix.

It seems that GLSL ES 1.0 doesn't have a mat3(mat4) constructor, as far as I can see. Either this warning is telling you that you need to add '#version 120' at the beginning of your shader, or it's telling you that your GPU driver doesn't support version 120 on this GPU. It can be interesting to check with webgl.shader_validator=false, which disables ANGLE validation/translation, to see if the warning is coming from ANGLE or straight from the driver.

Cheers
Benoit

> Here is the complete shader source:
> 
> attribute vec3 POSITION ;
> attribute vec3 TEXCOORD0 ;
> uniform mat4 WorldToCamera ;
> uniform mat4 CameraToScreen ;
> varying vec2 texCoord ;
> 
> void main ()
> {
> texCoord.xy = TEXCOORD0.xy ;
> vec3 cameraPos = mat3(WorldToCamera) * POSITION,1.0) ;
> gl_Position = CameraToScreen * vec4 ( cameraPos, 1.0 ) ;
> }
> 
> ...when I rewrite the code to avoid the cast, it compiles OK. Aside
> from this one little quirk, the system is running Minefield just fine.
> 
> I'm running Minefield (latest nightly build) in WinXP on an older
> nVidia
> 6100-GO laptop. I already installed the latest nVidia drivers to avoid
> the blacklisting issue. The same code seems to work fine on dozens of
> other machines. Unfortunately, we seem to be being blacklisted under
> Chrome right now - so I don't have a comparison point here.
> 
> Any clues?
> 
> -- Steve
> 
> -----------------------------------------------------------
> You are currently subscribed to public_webgl@khronos.org.
> To unsubscribe, send an email to majordomo@khronos.org with
> the following command in the body of your email:
> unsubscribe public_webgl
> -----------------------------------------------------------
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------