浏览代码

[PlanarReflection] Add debug mode on both planar and reflection probe

/main
Frédéric Vauchelles 7 年前
当前提交
b4cc081b
共有 2 个文件被更改,包括 11 次插入11 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
  2. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopDef.hlsl


#define SINGLE_PASS_CONTEXT_SAMPLE_SKY 1
#ifdef DEBUG_DISPLAY
float4 ApplyDebugProjectionVolume(float4 color, float3 texCoord, float scale)
float4 ApplyDebugProjectionVolume(float4 color, float3 radiusToProxy, float scale)
float l = length(texCoord);
float l = length(radiusToProxy);
l = pow(l / (1 + l), scale);
return float4(l.xxx * 0.7 + color.rgb * 0.3, color.a);
}

float4 color = SAMPLE_TEXTURE2D_ARRAY_LOD(_Env2DTextures, s_trilinear_clamp_sampler, ndc.xy, index, 0);
color.a = any(ndc.xyz < 0) || any(ndc.xyz > 1) ? 0 : 1;
#ifdef DEBUG_DISPLAY
if (_DebugLightingMode == DEBUGLIGHTINGMODE_ENVIRONMENT_PROXY_VOLUME)
return ApplyDebugProjectionVolume(color, texCoord, _DebugEnvironmentProxyDepthScale);
#endif
return color;
}
else if (cacheType == ENVCACHETYPE_CUBEMAP)

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


weight = InfluenceBoxWeight(lightData, bsdfData, positionWS, positionIS, dirIS);
}
// 2. Process the influence
//if (influenceShapeType == ENVSHAPETYPE_SPHERE)
// weight = InfluenceSphereWeight(lightData, bsdfData, positionWS, positionIS, dirIS);
//else if (influenceShapeType == ENVSHAPETYPE_BOX)
// weight = InfluenceBoxWeight(lightData, bsdfData, positionWS, positionIS, dirIS);
#ifdef DEBUG_DISPLAY
float3 radiusToProxy = R;
#endif
// When we are rough, we tend to see outward shifting of the reflection when at the boundary of the projection volume
// Also it appear like more sharp. To avoid these artifact and at the same time get better match to reference we lerp to original unmodified reflection.

float3 F = preLightData.specularFGD;
float iblMipLevel = PerceptualRoughnessToMipmapLevel(preLightData.iblPerceptualRoughness);
#ifdef DEBUG_DISPLAY
if (_DebugLightingMode == DEBUGLIGHTINGMODE_ENVIRONMENT_PROXY_VOLUME)
preLD = ApplyDebugProjectionVolume(preLD, radiusToProxy, _DebugEnvironmentProxyDepthScale);
#endif
// Smooth weighting
weight = Smoothstep01(weight);

正在加载...
取消
保存