mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
add highp lightmap macro (#14081)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 启用和初始化场景全局配置,不需要手动调用
|
||||
|
||||
Reference in New Issue
Block a user