浏览代码

Correctly enable/disable the sky light

/main
Evgenii Golubev 8 年前
当前提交
64c5cdc1
共有 4 个文件被更改,包括 15 次插入4 次删除
  1. 11
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl
  3. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePassLoop.hlsl
  4. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs

11
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


//Shader.SetGlobalTexture("_CookieTextures", m_CookieTexArray.GetTexCache());
//Shader.SetGlobalTexture("_CubeCookieTextures", m_CubeCookieTexArray.GetTexCache());
Shader.SetGlobalTexture("_EnvTextures", m_CubeReflTexArray.GetTexCache());
m_SkyRenderer.SetGlobalSkyTexture();
if (m_SkyRenderer.IsSkyValid(m_SkyParameters))
{
m_SkyRenderer.SetGlobalSkyTexture();
Shader.SetGlobalInt("_EnvLightSkyEnabled", 1);
}
else
{
Shader.SetGlobalInt("_EnvLightSkyEnabled", 0);
}
if (debugParameters.useSinglePassLightLoop)
{

3
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl


uint _PunctualLightCount;
uint _AreaLightCount;
uint _EnvLightCount;
int _EnvLightSkyEnabled; // TODO: make it a bool and move it into '_EnvLightSky'
float4 _DirShadowSplitSpheres[4]; // TODO share this max between C# and hlsl
float4 _DirShadowSplitSpheres[4]; // TODO: share this max between C# and hlsl
CBUFFER_END
struct LightLoopContext

3
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePassLoop.hlsl


iblSpecularLighting = lerp(iblSpecularLighting, localSpecularLighting, weight.y);
}
// Sky Ibl
// Only apply sky IBL if the sky texture is available.
if (_EnvLightSkyEnabled)
{
float3 localDiffuseLighting, localSpecularLighting;
float2 weight;

2
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs


}
bool IsSkyValid(SkyParameters parameters)
public bool IsSkyValid(SkyParameters parameters)
{
// Later we will also test shader for procedural skies.
return parameters.skyHDRI != null;

正在加载...
取消
保存