提交 abf63b05 编写于 作者: B bdysvik

Proper prefixing of uniforms and attributes. Add 'color' to the attribreplaceTHREEShaderAttributes.

上级 50b2d2f7
......@@ -486,6 +486,13 @@ THREE.GLTFLoader = ( function () {
shaderText = shaderText.replace( regEx, 'uv' );
break;
case 'COLOR_0':
case 'COLOR0':
case 'COLOR':
shaderText = shaderText.replace( regEx, 'color' );
break;
case "WEIGHT":
shaderText = shaderText.replace( regEx, 'skinWeight' );
......@@ -1758,4 +1765,4 @@ THREE.GLTFLoader = ( function () {
return GLTFLoader;
} )();
} )();
\ No newline at end of file
precision highp float;
attribute vec3 position;
attribute vec3 color;
attribute vec3 a_position;
attribute vec3 a_color;
varying vec3 v_color;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 u_modelViewMatrix;
uniform mat4 u_projectionMatrix;
void main(void) {
vec4 pos = modelViewMatrix * vec4(position,1.0);
v_color = color;
gl_Position = projectionMatrix * pos;
vec4 pos = u_modelViewMatrix * vec4(position,1.0);
v_color = a_color;
gl_Position = u_projectionMatrix * pos;
}
\ No newline at end of file
......@@ -158,8 +158,8 @@
},
"program": "meshProgram",
"uniforms": {
"modelViewMatrix": "modelViewMatrixParameter",
"projectionMatrix": "projectionMatrixParameter"
"u_modelViewMatrix": "modelViewMatrixParameter",
"u_projectionMatrix": "projectionMatrixParameter"
},
"states": {
"enable": [
......
precision highp float;
attribute vec3 position;
attribute vec3 color;
attribute vec3 a_position;
attribute vec3 a_color;
varying vec3 v_color;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 u_modelViewMatrix;
uniform mat4 u_projectionMatrix;
void main(void) {
vec4 pos = modelViewMatrix * vec4(position,1.0);
v_color = color;
gl_Position = projectionMatrix * pos;
vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);
v_color = a_color;
gl_Position = u_projectionMatrix * pos;
}
\ No newline at end of file
......@@ -181,8 +181,8 @@
},
"program": "meshProgram",
"uniforms": {
"modelViewMatrix": "modelViewMatrixParameter",
"projectionMatrix": "projectionMatrixParameter"
"u_modelViewMatrix": "modelViewMatrixParameter",
"u_projectionMatrix": "projectionMatrixParameter"
},
"states": {
"enable": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册