浏览代码

Formatting; avoid D3D11 compiler warning

/main
Evgenii Golubev 8 年前
当前提交
f6ce1375
共有 1 个文件被更改,包括 16 次插入13 次删除
  1. 29
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/SinglePass/SinglePassLoop.hlsl

29
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/SinglePass/SinglePassLoop.hlsl


diffuseLighting = float4(0.0, 0.0, 0.0, 0.0);
specularLighting = float4(0.0, 0.0, 0.0, 0.0);
for (int i = 0; i < _PunctualLightCount; ++i)
int i = 0; // Declare once to avoid the D3D11 compiler warning.
for (i = 0; i < _PunctualLightCount; ++i)
float4 localDiffuseLighting;
float4 localSpecularLighting;
EvaluateBSDF_Punctual(context, V, positionWS, prelightData, _PunctualLightList[i], bsdfData, localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
float4 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Punctual(context, V, positionWS, prelightData, _PunctualLightList[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
for (int i = 0; i < _AreaLightCount; ++i)
for (i = 0; i < _AreaLightCount; ++i)
EvaluateBSDF_Area(context, V, positionWS, prelightData, _AreaLightList[i], bsdfData, localDiffuseLighting, localSpecularLighting);
EvaluateBSDF_Area(context, V, positionWS, prelightData, _AreaLightList[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;

float4 iblSpecularLighting = float4(0.0, 0.0, 0.0, 0.0);
for (int j = 0; j < _EnvLightCount; ++j)
for (i = 0; i < _EnvLightCount; ++i)
float4 localDiffuseLighting;
float4 localSpecularLighting;
float4 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Env(context, V, positionWS, prelightData, _EnvLightList[j], bsdfData, localDiffuseLighting, localSpecularLighting);
EvaluateBSDF_Env(context, V, positionWS, prelightData, _EnvLightList[i], bsdfData, localDiffuseLighting, localSpecularLighting);
iblDiffuseLighting.rgb = lerp(iblDiffuseLighting.rgb, localDiffuseLighting.rgb, localDiffuseLighting.a); // Should be remove by the compiler if it is smart as all is constant 0
iblSpecularLighting.rgb = lerp(iblSpecularLighting.rgb, localSpecularLighting.rgb, localSpecularLighting.a);
}

{
float4 localDiffuseLighting;
float4 localSpecularLighting;
float4 localDiffuseLighting, localSpecularLighting;
context.sampleReflection = SINGLE_PASS_CONTEXT_SAMPLE_SKY;
EvaluateBSDF_Env(context, V, positionWS, prelightData, _EnvLightSky, bsdfData, localDiffuseLighting, localSpecularLighting);
iblDiffuseLighting.rgb = lerp(iblDiffuseLighting.rgb, localDiffuseLighting.rgb, localDiffuseLighting.a); // Should be remove by the compiler if it is smart as all is constant 0

正在加载...
取消
保存