浏览代码

Revert the UNITY_SPECCUBE_LOD_STEPS change

/main
Evgenii Golubev 8 年前
当前提交
6f11466b
共有 4 个文件被更改,包括 10 次插入9 次删除
  1. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader
  2. 6
      Assets/ScriptableRenderLoop/ShaderLibrary/API/D3D11.hlsl
  3. 8
      Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl
  4. 2
      Assets/ScriptableRenderLoop/fptl/ReflectionTemplate.hlsl

3
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader


case 1: sampleCount = 21; break;
case 2: sampleCount = 34; break;
case 3: sampleCount = 55; break;
case 4: sampleCount = 55; break;
case 4: sampleCount = 89; break;
case 6: sampleCount = 89; break; // UNITY_SPECCUBE_LOD_STEPS
}
float4 val = IntegrateLD(TEXTURECUBE_PARAM(_MainTex, sampler_MainTex),

6
Assets/ScriptableRenderLoop/ShaderLibrary/API/D3D11.hlsl


#define IS_FRONT_VFACE(VAL, FRONT, BACK) ((VAL) ? (FRONT) : (BACK))
// TODO: We need to change this hard limit!
#ifndef UNITY_SPECCUBE_MAX_LOD
#define UNITY_SPECCUBE_MAX_LOD 5
#ifndef UNITY_SPECCUBE_LOD_STEPS
#define UNITY_SPECCUBE_LOD_STEPS 6
#endif
#define CBUFFER_START(name) cbuffer name {

#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, min(lod, UNITY_SPECCUBE_MAX_LOD))
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, min(lod, UNITY_SPECCUBE_LOD_STEPS))
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)

8
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


perceptualRoughness = perceptualRoughness * (1.7 - 0.7 * perceptualRoughness);
#endif
return perceptualRoughness * UNITY_SPECCUBE_MAX_LOD;
return perceptualRoughness * UNITY_SPECCUBE_LOD_STEPS;
return saturate(mipmapLevel / UNITY_SPECCUBE_MAX_LOD);
return saturate(mipmapLevel / UNITY_SPECCUBE_LOD_STEPS);
}
//-----------------------------------------------------------------------------

// Bias the MIP map level to compensate for the importance sampling bias.
// This will blur the reflection.
// TODO: bias more accurately once the 'UNITY_SPECCUBE_MAX_LOD' restriction has been lifted.
mipLevel = lerp(mipLevel, UNITY_SPECCUBE_MAX_LOD, sqrt(bias));
// TODO: bias more accurately once the 'UNITY_SPECCUBE_LOD_STEPS' limit has been lifted.
mipLevel = lerp(mipLevel, UNITY_SPECCUBE_LOD_STEPS, sqrt(bias));
}
if (NdotL > 0.0)

2
Assets/ScriptableRenderLoop/fptl/ReflectionTemplate.hlsl


half mip = perceptualRoughness * UNITY_SPECCUBE_MAX_LOD;
half mip = perceptualRoughness * UNITY_SPECCUBE_LOD_STEPS;
half4 rgbm = UNITY_SAMPLE_ABSTRACT_CUBE_ARRAY_LOD(tex, float4(glossIn.reflUVW.xyz, sliceIndex), mip);
return DecodeHDR(rgbm, hdr);

正在加载...
取消
保存