Google Chrome WebGL Shader Compile Linker Error, Uniform with the same name but with a different type / precision

Uniform with the same name but with a different type / precision

This is what I get when compiling shaders, only with the latest Chrome on Windows. Nothing more

Looking at

http://www.cocos2d-x.org/forums/19/topics/39063?r=39258 as well as https://code.google.com/p/chromium/issues/detail?id=309527

I tried to add both highp for both of the following and it won't help either.

VShader:

"attribute vec3 a_position; \n" "attribute vec3 a_normal; \n" "attribute vec2 a_texture; \n" "uniform mat4 u_mvpMatrix; \n" "uniform mat3 u_normalMatrix; \n" "uniform vec4 u_lightDir; \n" "uniform lowp int u_eT; \n" "uniform lowp int u_eL; \n" "uniform vec4 u_colormul; \n" "varying float v_cf; \n" "varying vec2 v_t; \n" 

F shader

  "precision mediump float; \n" "uniform vec4 u_color; \n" "uniform lowp int u_eT; \n" "uniform sampler2D u_texture0; \n" "uniform vec4 u_colormul; \n" "varying float v_cf; \n" "varying vec2 v_t; \n" 

Early response highly appreciated

thanks

+7
google-chrome precision shader webgl uniform
source share
1 answer

I solved this by adding precision mediump float; into my vertex shaders to match the accuracy defined for their copy fragments.

+9
source share

All Articles