浏览代码

clean sky setup

/main
sebastienlagarde 7 年前
当前提交
255c6c84
共有 3 个文件被更改,包括 4 次插入7 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 3
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  3. 6
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs

2
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


if (m_SkyManager.IsSkyValid())
{
m_SkyManager.SetGlobalSkyTexture();
m_SkyManager.SetGlobalSkyTexture(cmd);
cmd.SetGlobalInt(HDShaderIDs._EnvLightSkyEnabled, 1);
}
else

3
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


cmd.SetComputeTextureParam(deferredComputeShader, kernel, HDShaderIDs._AmbientOcclusionTexture, HDShaderIDs._AmbientOcclusionTexture);
cmd.SetComputeTextureParam(deferredComputeShader, kernel, HDShaderIDs._SkyTexture, skyTexture ? skyTexture : m_DefaultTexture2DArray);
cmd.SetComputeFloatParam(deferredComputeShader, HDShaderIDs._SkyTextureMipCount, skyTextureMipCount);
cmd.SetComputeTextureParam(deferredComputeShader, kernel, HDShaderIDs.specularLightingUAV, colorBuffers[0]);
cmd.SetComputeTextureParam(deferredComputeShader, kernel, HDShaderIDs.diffuseLightingUAV, colorBuffers[1]);

6
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


// Sets the global MIP-mapped cubemap '_SkyTexture' in the shader.
// The texture being set is the sky (environment) map pre-convolved with GGX.
public void SetGlobalSkyTexture()
public void SetGlobalSkyTexture(CommandBuffer cmd)
Shader.SetGlobalTexture(HDShaderIDs._SkyTexture, m_SkyboxGGXCubemapRT);
cmd.SetGlobalTexture(HDShaderIDs._SkyTexture, m_SkyboxGGXCubemapRT);
Shader.SetGlobalFloat(HDShaderIDs._SkyTextureMipCount, mipCount);
cmd.SetGlobalFloat(HDShaderIDs._SkyTextureMipCount, mipCount);
}
public void Resize(float nearPlane, float farPlane)

正在加载...
取消
保存