浏览代码

Clean up the code

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

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


voxelCenterUV.z = voxelCenterUV.z * _VolumeMaskDimensions.x;
voxelCenterUV.z += offset;
// TODO: expose the LoD bias parameter.
float lod = ComputeTextureLOD(duvw_dx, duvw_dy, duvw_dz, _VolumeMaskDimensions.z);
// TODO: bugfix.
// Note that this clamping to edge doesn't quite work.
// First of all, the distance to the edge should depend on the LoD.

// For now, we choose the second option.
float lod = ComputeTextureLOD(duvw_dx, duvw_dy, duvw_dz, _VolumeMaskDimensions.z);
float lodScale = exp2(ceil(lod));
float clampBorder = 0.5f * lodScale * _VolumeMaskDimensions.y; // 0.5 * (lodScale / textureSize)
int textureSize = (int)_VolumeMaskDimensions.z;
int mipSize = textureSize >> (int)ceil(lod);
float clampBorder = 0.5f * rcp(mipSize);
// TODO: TRILINEAR WRAP
// TODO: expose the LoD bias parameter.
float maskValue = SAMPLE_TEXTURE3D_LOD(_VolumeMaskAtlas, s_trilinear_clamp_sampler, voxelCenterUV, lod).a;
return maskValue;

正在加载...
取消
保存