浏览代码

Merge pull request #619 from EvgeniiG/master

Reintroduce EvaluateBSDF_Area()
/main
GitHub 7 年前
当前提交
c5c6089a
共有 3 个文件被更改,包括 23 次插入4 次删除
  1. 4
      ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
  3. 15
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

4
ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl


float3 positionWS; // World space position (could be camera-relative)
float2 positionNDC; // Normalized screen UVs : [0, 1) (with the half-pixel offset)
uint2 positionSS; // Screen space pixel coordinates : [0, NumPixels)
uint2 tileCoord; // Screen space tile coordinates : [0, NumTiles)
float deviceDepth; // Depth from the depth buffer : [0, 1]
uint2 tileCoord; // Screen tile coordinates : [0, NumTiles)
float deviceDepth; // Depth from the depth buffer : [0, 1] (typically reversed)
float linearDepth; // View space Z coordinate : [Near, Far]
};

8
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl


while (i <= last && lightData.lightType == GPULIGHTTYPE_LINE)
{
DirectLighting lighting = EvaluateBSDF_Line(context, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
lightData.lightType = GPULIGHTTYPE_LINE; // Enforce constant propagation
DirectLighting lighting = EvaluateBSDF_Area(context, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
AccumulateDirectLighting(lighting, aggregateLighting);
lightData = FetchLight(lightStart, min(++i, last));

{
DirectLighting lighting = EvaluateBSDF_Rect(context, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
lightData.lightType = GPULIGHTTYPE_RECTANGLE; // Enforce constant propagation
DirectLighting lighting = EvaluateBSDF_Area(context, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
AccumulateDirectLighting(lighting, aggregateLighting);
lightData = FetchLight(lightStart, min(++i, last));

15
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


return lighting;
}
DirectLighting EvaluateBSDF_Area(LightLoopContext lightLoopContext,
float3 V, PositionInputs posInput,
PreLightData preLightData, LightData lightData,
BSDFData bsdfData, BakeLightingData bakeLightingData)
{
if (lightData.lightType == GPULIGHTTYPE_LINE)
{
return EvaluateBSDF_Line(lightLoopContext, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
}
else
{
return EvaluateBSDF_Rect(lightLoopContext, V, posInput, preLightData, lightData, bsdfData, bakeLightingData);
}
}
//-----------------------------------------------------------------------------
// EvaluateBSDF_Env
// ----------------------------------------------------------------------------

正在加载...
取消
保存