
const customShader = new Cesium.CustomShader({
lightingModel: Cesium.LightingModel.UNLIT,
uniforms: {
u_cameraDirectionWC: {
type: Cesium.UniformType.VEC3,
value: WE.viewer.scene.camera.positionWC,
},
Cesium Custom Shader实现光照与多光源效果

本文介绍了如何使用Cesium库中的CustomShader功能,通过UNLIT照明模型和自定义片段着色器,实现对场景中多个光源的处理,包括颜色和位置设置,并结合PBR参数计算最终物体颜色。着重展示了makeLight函数和fragmentMain中的灯光混合算法。
最低0.47元/天 解锁文章
4652





