浏览代码

Make evalue punctual bsdf prototype match area and env

/Yibing-Project-2
Sebastien Lagarde 7 年前
当前提交
ec73e7bd
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

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


{
#ifdef LIGHTLOOP_TILE_PASS
// TODO: Convert the for loop below to a while on each type as we know we are sorted!
// TODO: Convert the for loop below to a while on each type as we know we are sorted and compare performance.
uint punctualLightStart;
uint punctualLightCount;
GetCountAndStart(posInput, LIGHTCATEGORY_PUNCTUAL, punctualLightStart, punctualLightCount);

float3 localDiffuseLighting, localSpecularLighting;
int punctualIndex = FetchIndex(punctualLightStart, i);
EvaluateBSDF_Punctual( context, V, posInput, preLightData, _LightDatas[FetchIndex(punctualLightStart, i)], bsdfData,
EvaluateBSDF_Punctual( context, V, posInput, preLightData, _LightDatas[punctualIndex], bsdfData, _LightDatas[punctualIndex].lightType,
localDiffuseLighting, localSpecularLighting);
accLighting.punctualDiffuseLighting += localDiffuseLighting;

{
float3 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Punctual( context, V, posInput, preLightData, _LightDatas[i], bsdfData,
EvaluateBSDF_Punctual( context, V, posInput, preLightData, _LightDatas[i], bsdfData, _LightDatas[i].lightType,
localDiffuseLighting, localSpecularLighting);
accLighting.punctualDiffuseLighting += localDiffuseLighting;

5
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


}
void EvaluateBSDF_Punctual( LightLoopContext lightLoopContext,
float3 V, PositionInputs posInput, PreLightData preLightData, LightData lightData, BSDFData bsdfData,
float3 V, PositionInputs posInput,
PreLightData preLightData, LightData lightData, BSDFData bsdfData, int GPULightType,
int lightType = lightData.lightType;
int lightType = GPULightType;
// All punctual light type in the same formula, attenuation is neutral depends on light type.
// light.positionWS is the normalize light direction in case of directional light and invSqrAttenuationRadius is 0

正在加载...
取消
保存