标签:style blog http color os io 数据 ar
如下代码在编译fragment shader时候会提示编译错误
vertex shader
|
Fragment shader
|
varying vec4 v_color; \n attribute vec3 v_Position; \n attribute vec4 f_Color; \n void main(void) \n { \n gl_Position = vec4(v_Position, 1.0); \n v_color = f_Color; \n }"
|
varying vec4 v_color; \n void main(void) \n { \n gl_FragColor = v_color; \n };
|
在fragment shader中加入精度控制,就不会出现编译错误!任何一个精度控制都可以解决编译错误(不解!)
vertex shader |
Fragment shader |
varying vec4 v_color; \n attribute vec3 v_Position; \n attribute vec4 f_Color; \n void main(void) \n { \n gl_Position = vec4(v_Position, 1.0); \n v_color = f_Color; \n }" |
varying (lowp/mediump/highp) vec4 v_color; \n void main(void) \n { \n gl_FragColor = v_color; \n };
|
http://blog.chinaunix.net/uid-12348673-id-3441087.html
GLES & Shader Language 易错集锦,布布扣,bubuko.com
标签:style blog http color os io 数据 ar
原文地址:http://www.cnblogs.com/yaozhongxiao/p/3920943.html