/**
* 添加点光源
* @param {Viewer} viewer
* @param {Cesium3DTileset} tileset
*/
addPointLight(viewer,tileset, distance = 1000) {
// 点光源 颜色、位置
const lightPoint = {
color: Cesium.Color.RED,
position: Cesium.Cartesian3.fromDegrees(110, 27, 50)
};
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(110, 27, 50),
ellipsoid: {
radii: new Cesium.Cartesian3(2, 2, 2),
material: Cesium.Color.RED.withAlpha(0.5),
}
})
const customShader = new Cesium.CustomShader({
lightingModel: Cesium.LightingModel.UNLIT, // Cesium.LightingModel.PBR
uniforms: {
u_distance: {
type: Cesium.Uniform
Cesium 使用着色器实现点光源
于 2023-09-22 09:32:49 首次发布