修复体积云被切割问题:移除边界框限制

问题:之前的 intersectBox 限制了射线采样范围,
导致靠近相机的一侧云被切掉

修复:移除边界框检测,直接使用相机裁剪平面 [0.1, 1000]
让 HDDA 树遍历器自己处理空区域

效果:体积云渲染完整,不再有切割感
This commit is contained in:
2026-03-11 22:17:49 +08:00
parent 79ee8d0492
commit 412334cf74

View File

@@ -112,12 +112,8 @@ float4 MainPS(PSInput input) : SV_TARGET
{
float3 rayDir = normalize(input.worldPos - _CameraPos);
float tmin, tmax;
if (!intersectBox(_CameraPos, rayDir, _BBoxMin, _BBoxMax, tmin, tmax)) {
return float4(0, 0, 0, 0);
}
tmin = max(0, tmin);
float tmin = 0.1;
float tmax = 1000.0;
NanoVolume volume;
initVolume(volume);