add highp lightmap macro (#14081)

This commit is contained in:
Myway
2023-01-17 16:39:05 +08:00
committed by GitHub
parent 10564633bc
commit ddd059dc71
2 changed files with 17 additions and 0 deletions
+9
View File
@@ -55,6 +55,10 @@ const stationaryLightMapPatches: IMacroPatch[] = [
{ name: 'CC_USE_LIGHTMAP', value: 2 },
];
const highpLightMapPatches: IMacroPatch[] = [
{ name: 'CC_LIGHT_MAP_VERSION', value: 2 },
];
const lightProbePatches: IMacroPatch[] = [
{ name: 'CC_USE_LIGHT_PROBE', value: true },
];
@@ -971,6 +975,11 @@ export class Model {
const lightmapPathes = stationary ? stationaryLightMapPatches : staticLightMapPatches;
patches = patches ? patches.concat(lightmapPathes) : lightmapPathes;
// use highp lightmap
if (this.node.scene.globals.bakedWithHighpLightmap) {
patches = patches.concat(highpLightMapPatches);
}
}
if (this._useLightProbe) {
patches = patches ? patches.concat(lightProbePatches) : lightProbePatches;
+8
View File
@@ -1444,6 +1444,14 @@ export class SceneGlobals {
@serializable
public bakedWithStationaryMainLight = false;
/**
* @en bake lightmap with highp mode
* @zh 是否使用高精度模式烘培光照图
*/
@editable
@serializable
public bakedWithHighpLightmap = false;
/**
* @en Activate and initialize the global configurations of the scene, no need to invoke manually.
* @zh 启用和初始化场景全局配置,不需要手动调用