浏览代码

Enable sky IBL

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

1
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 (debugParameters.useSinglePassLightLoop)
{

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


iblSpecularLighting = lerp(iblSpecularLighting, localSpecularLighting, weight.y);
}
/*
// The EnvLightData of the sky light contains a bunch of compile-time constants.
// We set them here directly to allow the compiler to propagate them and optimize the code.
_EnvLightSky.envShapeType = ENVSHAPETYPE_SKY;
_EnvLightSky.envIndex = 0;
_EnvLightSky.forward = float3(0.0, 0.0, 1.0);
_EnvLightSky.up = float3(0.0, 1.0, 0.0);
_EnvLightSky.right = float3(1.0, 0.0, 0.0);
_EnvLightSky.positionWS = float3(0.0, 0.0, 0.0);
_EnvLightSky.offsetLS = float3(0.0, 0.0, 0.0);
_EnvLightSky.innerDistance = float3(0.0, 0.0, 0.0);
_EnvLightSky.blendDistance = 1.0;
*/
diffuseLighting += iblDiffuseLighting;
specularLighting += iblSpecularLighting;

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


}
}
// Sets the global "_SkyTexture" cubemap array in the shader.
// The texture being set is a sky (environment) map pre-convolved with GGX.
public void SetGlobalSkyTexture()
{
Shader.SetGlobalTexture("_SkyTexture", m_SkyboxGGXCubemapRT);
}
public void Rebuild()
{
// TODO: We need to have an API to send our sky information to Enlighten. For now use a workaround through skybox/cubemap material...

正在加载...
取消
保存