我在网上看到一些三个.js着色器代码,内容如下:
vCameraPosition = cameraPosition;
cameraPosition 从何而来,我可以在 API 中的哪个位置了解它?
内置制服和属性在WebGLProgram
中定义。有关详细信息,请查看以下文档页面。
https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
它是一个vec3,包含您正在渲染的摄像机的世界空间摄像机位置。