diff --git a/examples/webgl_materials_modified.html b/examples/webgl_materials_modified.html index f1e8f11883686..0cd0ec4860984 100644 --- a/examples/webgl_materials_modified.html +++ b/examples/webgl_materials_modified.html @@ -100,7 +100,14 @@ shader.vertexShader = 'uniform float time;\n' + shader.vertexShader; shader.vertexShader = shader.vertexShader.replace( '#include ', - 'vec3 transformed = vec3( position.x + sin( time + position.y ) / 2.0, position.y, position.z );' + [ + 'float theta = sin( time + position.y ) / 2.0;', + 'float c = cos( theta );', + 'float s = sin( theta );', + 'mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c );', + 'vec3 transformed = vec3( position ) * m;', + 'vNormal = vNormal * m;' + ].join( '\n' ) ); materialShader = shader;