Open klren0312 opened 1 year ago
// = object.matrixWorld uniform mat4 modelMatrix; // = camera.matrixWorldInverse * object.matrixWorld uniform mat4 modelViewMatrix; // = camera.projectionMatrix uniform mat4 projectionMatrix; // = camera.matrixWorldInverse uniform mat4 viewMatrix; // = inverse transpose of modelViewMatrix uniform mat3 normalMatrix; // = camera position in world space uniform vec3 cameraPosition; // default vertex attributes provided by BufferGeometry attribute vec3 position; attribute vec3 normal; attribute vec2 uv;
uniform mat4 viewMatrix; uniform vec3 cameraPosition;
https://threejs.org/docs/index.html#api/zh/renderers/webgl/WebGLProgram
顶点着色器
片元着色器
参考资料
https://threejs.org/docs/index.html#api/zh/renderers/webgl/WebGLProgram