浏览代码

Cleanup shader

/main
Antoine Lelievre 6 年前
当前提交
3f870344
共有 2 个文件被更改,包括 2 次插入40 次删除
  1. 34
      com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader
  2. 8
      com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering.meta

34
com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader


}
real GetUpperHemisphereLuxValue(TEXTURECUBE_ARGS(skybox, sampler_skybox), real3 N, uint sampleCount = 16384)
// Spherical integration of the upper hemisphere
real GetUpperHemisphereLuxValue(TEXTURECUBE_ARGS(skybox, sampler_skybox), real3 N)
{
float sum = 0.0;
float dphi = 0.005;

}
sum *= dphi * dtheta;
return sum;
real acc = 0.0;
// Add some jittering on Hammersley2d
real2 randNum = InitRandom(0.0);
real3x3 localToWorld = GetLocalFrame(N);
for (uint i = 0; i < sampleCount; ++i)
{
real2 u = frac(randNum + Hammersley2d(i, sampleCount));
real NdotL;
real weightOverPdf;
real3 L;
ImportanceSampleLambert(u, localToWorld, L, NdotL, weightOverPdf);
real pdf = NdotL / PI;
real omegaS = rcp(sampleCount) * rcp(pdf);
// _InvOmegaP = rcp(FOUR_PI / (6.0 * cubemapWidth * cubemapWidth));
real mipLevel = 0.5 * log2(omegaS * _InvOmegaP);
if (NdotL > 0.0)
{
real val = Luminance(SAMPLE_TEXTURECUBE_LOD(skybox, sampler_skybox, L, mipLevel).rgb);
acc += PI * val;
}
}
return acc / sampleCount;
}
float4 Frag(Varyings input) : SV_Target

8
com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering.meta


fileFormatVersion: 2
guid: d522828bc0314e14cb6faa4291bb64da
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存