跳到主要内容

VoxelRenderTuning

VoxelRenderTuning 是渲染参数对象。创建并设置字段后调用 controller.setRenderTuning(tuning);该调用会重新应用到当前场景,后续加载的场景也会继承这一对象。

色调与环境​

字段默认值说明
toneMappingMode0色调映射模式,默认 ACES。
exposure0.82总体曝光。
ambientDiffuse0.88环境漫反射。
ambientSpecular0.48环境高光。
ambientTemperature0环境色温偏移,中性为 0。

四向灯光​

字段默认值说明
keyIntensity0.84主光强度。
keyAzimuth37主光方位角,度。
keyElevation41主光高度角,度。
keyTemperature0主光色温偏移。
fillIntensity0.10冷色补光强度。
rimIntensity0.18轮廓光强度。
bottomIntensity0.06底部补光强度。

后处理与结构感​

字段默认值说明
bloomThresholdHard1.20Bloom 硬阈值。
bloomThresholdSoft0.78Bloom 软阈值。
bloomScaleFactor0.42Bloom 采样尺度。
bloomScatter0.10Bloom 扩散。
vignetteIntensity0暗角强度,0 为关闭。
vignetteRoundness0.70暗角圆度。
colorFringeIntensity0色散强度,0 为关闭。

阴影与描边​

字段默认值说明
shadowsEnabledtrue开启投射阴影。
shadowReceiverEnabledtrue地面/受体接收阴影。
shadowResolution2048阴影图分辨率。
voxelBordersVisibletrue显示体素描边。

完整示例​

const tuning = new VoxelRenderTuning();
tuning.exposure = 0.92;
tuning.ambientDiffuse = 0.82;
tuning.keyIntensity = 0.9;
tuning.keyAzimuth = 32;
tuning.rimIntensity = 0.24;
tuning.bloomScatter = 0.08;
tuning.shadowsEnabled = true;
tuning.shadowReceiverEnabled = true;
tuning.voxelBordersVisible = true;
controller.setRenderTuning(tuning);

阴影图提高到高于 2048 会增加设备端内存和原生创建成本;对 128³ 高密度模型,应先确认目标设备的帧率和首帧耗时。关闭描边可显著减轻边线构建工作,但会弱化体素结构辨识。