修复体积云被切割问题:移除边界框限制
问题:之前的 intersectBox 限制了射线采样范围, 导致靠近相机的一侧云被切掉 修复:移除边界框检测,直接使用相机裁剪平面 [0.1, 1000] 让 HDDA 树遍历器自己处理空区域 效果:体积云渲染完整,不再有切割感
This commit is contained in:
@@ -112,12 +112,8 @@ float4 MainPS(PSInput input) : SV_TARGET
|
|||||||
{
|
{
|
||||||
float3 rayDir = normalize(input.worldPos - _CameraPos);
|
float3 rayDir = normalize(input.worldPos - _CameraPos);
|
||||||
|
|
||||||
float tmin, tmax;
|
float tmin = 0.1;
|
||||||
if (!intersectBox(_CameraPos, rayDir, _BBoxMin, _BBoxMax, tmin, tmax)) {
|
float tmax = 1000.0;
|
||||||
return float4(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
tmin = max(0, tmin);
|
|
||||||
|
|
||||||
NanoVolume volume;
|
NanoVolume volume;
|
||||||
initVolume(volume);
|
initVolume(volume);
|
||||||
|
|||||||
Reference in New Issue
Block a user