diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index 10c8a4079c67c0ddde335dcfc93895c4df599ff5..84757702e5c17845feec17399280881897ee971a 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -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 diff --git a/examples/models/gltf/snowflake/line_vert.glsl b/examples/models/gltf/snowflake/line_vert.glsl index 478770c631901504ac340db860d12b3a7d839372..80ff31b224a75ca81f435e4a03d9039af5620f44 100644 --- a/examples/models/gltf/snowflake/line_vert.glsl +++ b/examples/models/gltf/snowflake/line_vert.glsl @@ -1,15 +1,15 @@ 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 diff --git a/examples/models/gltf/snowflake/snowFlake.gltf b/examples/models/gltf/snowflake/snowFlake.gltf index 97e399ad1d73af1af38bde95bf9d4dc2e387161e..a5a4ce55a496cdf1a26ba2bc89ece84235e6dd5b 100644 --- a/examples/models/gltf/snowflake/snowFlake.gltf +++ b/examples/models/gltf/snowflake/snowFlake.gltf @@ -158,8 +158,8 @@ }, "program": "meshProgram", "uniforms": { - "modelViewMatrix": "modelViewMatrixParameter", - "projectionMatrix": "projectionMatrixParameter" + "u_modelViewMatrix": "modelViewMatrixParameter", + "u_projectionMatrix": "projectionMatrixParameter" }, "states": { "enable": [ diff --git a/examples/models/gltf/snowflakes/line_vert.glsl b/examples/models/gltf/snowflakes/line_vert.glsl index 478770c631901504ac340db860d12b3a7d839372..48239476456515ae3858443cc4c274e0570fef42 100644 --- a/examples/models/gltf/snowflakes/line_vert.glsl +++ b/examples/models/gltf/snowflakes/line_vert.glsl @@ -1,15 +1,15 @@ 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 diff --git a/examples/models/gltf/snowflakes/snowFlakes.gltf b/examples/models/gltf/snowflakes/snowFlakes.gltf index f43cb1fcc8b7f019c621c2dd590a7aa8f8c4a306..066f363438418f6822b6c709ba823cd812dbd195 100644 --- a/examples/models/gltf/snowflakes/snowFlakes.gltf +++ b/examples/models/gltf/snowflakes/snowFlakes.gltf @@ -181,8 +181,8 @@ }, "program": "meshProgram", "uniforms": { - "modelViewMatrix": "modelViewMatrixParameter", - "projectionMatrix": "projectionMatrixParameter" + "u_modelViewMatrix": "modelViewMatrixParameter", + "u_projectionMatrix": "projectionMatrixParameter" }, "states": { "enable": [