浏览代码

Use more samples by default

/main
Evgenii Golubev 8 年前
当前提交
b68675c5
共有 3 个文件被更改,包括 5 次插入7 次删除
  1. 6
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Lit.hlsl
  2. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader
  3. 2
      Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl

6
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Lit.hlsl


// Ref: Moving Frostbite to PBR (Appendix A)
float3 IntegrateLambertIBLRef( LightLoopContext lightLoopContext,
EnvLightData lightData, BSDFData bsdfData,
uint sampleCount = 2048)
uint sampleCount = 4096)
{
float3 N = bsdfData.normalWS;
float3 tangentX = bsdfData.tangentWS;

float3 IntegrateDisneyDiffuseIBLRef(LightLoopContext lightLoopContext,
float3 V, EnvLightData lightData, BSDFData bsdfData,
uint sampleCount = 2048)
uint sampleCount = 4096)
{
float3 N = bsdfData.normalWS;
float3 tangentX = bsdfData.tangentWS;

// Ref: Moving Frostbite to PBR (Appendix A)
float3 IntegrateSpecularGGXIBLRef( LightLoopContext lightLoopContext,
float3 V, EnvLightData lightData, BSDFData bsdfData,
uint sampleCount = 2048)
uint sampleCount = 4096)
{
float3 N = bsdfData.normalWS;
float3 tangentX = bsdfData.tangentWS;

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader


float3 V = float3(sqrt(1 - NdotV * NdotV), 0, NdotV);
float3 N = float3(0.0, 0.0, 1.0);
const int numSamples = 2048;
float4 preFGD = IntegrateGGXAndDisneyFGD(V, N, PerceptualRoughnessToRoughness(perceptualRoughness), numSamples);
float4 preFGD = IntegrateGGXAndDisneyFGD(V, N, PerceptualRoughnessToRoughness(perceptualRoughness));
return float4(preFGD.xyz, 1.0);
}

2
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


// ----------------------------------------------------------------------------
// Ref: Listing 18 in "Moving Frostbite to PBR" + https://knarkowicz.wordpress.com/2014/12/27/analytical-dfg-term-for-ibl/
float4 IntegrateGGXAndDisneyFGD(float3 V, float3 N, float roughness, uint sampleCount)
float4 IntegrateGGXAndDisneyFGD(float3 V, float3 N, float roughness, uint sampleCount = 4096)
{
float NdotV = saturate(dot(N, V));
float4 acc = float4(0.0, 0.0, 0.0, 0.0);

正在加载...
取消
保存