浏览代码

Merge pull request #1851 from Unity-Technologies/HDRP/increase-probe-volume-comparison

Hdrp/increase probe volume comparison
/main
GitHub 6 年前
当前提交
b1b167e4
共有 2 个文件被更改,包括 13 次插入7 次删除
  1. 1
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  2. 19
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs

1
com.unity.render-pipelines.high-definition/CHANGELOG.md


### Changed
- Changed default reflection probe to be 256x256x6 and array size to be 64
- Increased the precision when comparing Planar or HD reflection probe volumes
### Added
- Added a new Fabric shader model that supports Silk and Cotton/Wool

19
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


m_areaLightCount = areaLightCount;
// Redo everything but this time with envLights
Debug.Assert(k_MaxEnvLightsOnScreen <= 256); //for key construction
int envLightCount = 0;
var totalProbes = cullResults.visibleReflectionProbes.Count + reflectionProbeCullResults.visiblePlanarReflectionProbeCount;

static float CalculateProbeLogVolume(Bounds bounds)
{
float boxVolume = 8 * bounds.extents.x * bounds.extents.y * bounds.extents.z;
float logVolume = Mathf.Clamp(256 + Mathf.Log(boxVolume, 1.05f), 0, 4095); // Allow for negative exponents
//Notes:
// - 1+ term is to prevent having negative values in the log result
// - 1000* is too keep 3 digit after the dot while we truncate the result later
// - 1048575 is 2^20-1 as we pack the result on 20bit later
float boxVolume = 8f* bounds.extents.x * bounds.extents.y * bounds.extents.z;
float logVolume = Mathf.Clamp(Mathf.Log(1 + boxVolume, 1.05f)*1000, 0, 1048575);
lightVolumeType = (LightVolumeType)((sortKey >> 17) & 0x3);
probeIndex = (int)(sortKey & 0xFFFF);
listType = (int)((sortKey >> 16) & 1);
lightVolumeType = (LightVolumeType)((sortKey >> 9) & 0x3);
probeIndex = (int)(sortKey & 0xFF);
listType = (int)((sortKey >> 8) & 1);
// 12 bit volume, 3 bit LightVolumeType, 1 bit list type, 16 bit index
return (uint)logVolume << 20 | (uint)lightVolumeType << 17 | listType << 16 | ((uint)probeIndex & 0xFFFF);
// 20 bit volume, 3 bit LightVolumeType, 1 bit list type, 8 bit index
return (uint)logVolume << 12 | (uint)lightVolumeType << 9 | listType << 8 | ((uint)probeIndex & 0xFF);
}
void VoxelLightListGeneration(CommandBuffer cmd, HDCamera hdCamera, Matrix4x4[] projscrArr, Matrix4x4[] invProjscrArr, RenderTargetIdentifier cameraDepthBufferRT)

正在加载...
取消
保存