浏览代码

Optimize a bit

/hdrp-staging
Evgenii Golubev 6 年前
当前提交
6f85ea50
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 8
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Volumetrics/VolumeVoxelization.compute

8
com.unity.render-pipelines.high-definition/HDRP/Lighting/Volumetrics/VolumeVoxelization.compute


{
float3 voxelCenterNDC = voxelCenterCS * 0.5 + 0.5;
float densityMask = ComputeFadeFactor(voxelCenterNDC, _VolumeData[volumeIndex].rcpPosFade, _VolumeData[volumeIndex].rcpNegFade);
overlapFraction *= ComputeFadeFactor(voxelCenterNDC, _VolumeData[volumeIndex].rcpPosFade, _VolumeData[volumeIndex].rcpNegFade);
//Sample the volumeMask
if (_VolumeData[volumeIndex].textureIndex != -1)

float3 voxelGradUpUVW = z * voxelAxisUpBS / obbExtents;
float3 voxelGradForwardUVW = halfDZ * voxelAxisForwardBS / obbExtents;
densityMask *= SampleVolumeMask(_VolumeData[volumeIndex], voxelCenterNDC, voxelGradRightUVW, voxelGradUpUVW, voxelGradForwardUVW);
overlapFraction *= SampleVolumeMask(_VolumeData[volumeIndex], voxelCenterNDC, voxelGradRightUVW, voxelGradUpUVW, voxelGradForwardUVW);
voxelScattering += overlapFraction * _VolumeData[volumeIndex].scattering * densityMask;
voxelExtinction += overlapFraction * _VolumeData[volumeIndex].extinction * densityMask;
voxelScattering += overlapFraction * _VolumeData[volumeIndex].scattering;
voxelExtinction += overlapFraction * _VolumeData[volumeIndex].extinction;
}
#ifndef USE_CLUSTERED_LIGHTLIST

正在加载...
取消
保存