浏览代码

metal/ios: lower samplecount for mobile compute limitations, disable MIS since there is no read_write texture support

/fptl_cleanup
Antti Tapaninen 7 年前
当前提交
a2cdeb47
共有 4 个文件被更改,包括 21 次插入3 次删除
  1. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/ComputeGgxIblSampleData.compute
  2. 11
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/RuntimeFilterIBL.cs
  3. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  4. 7
      Assets/ScriptableRenderPipeline/ShaderLibrary/ImageBasedLighting.hlsl

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/ComputeGgxIblSampleData.compute


#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/ImageBasedLighting.hlsl"
#ifdef SHADER_API_MOBILE
#define MAX_IBL_SAMPLE_CNT 34
#else
#endif
RWTexture2D<float4> output; // [MAX_SAMPLE_CNT x UNITY_SPECCUBE_LOD_STEPS]

11
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/RuntimeFilterIBL.cs


public class IBLFilterGGX
{
RenderTexture m_GgxIblSampleData = null;
const int k_GgxIblMaxSampleCount = 89; // Width
int k_GgxIblMaxSampleCount = TextureCache.isMobileBuildTarget ? 34 : 89; // Width
const int k_GgxIblMipCountMinusOne = 6; // Height (UNITY_SPECCUBE_LOD_STEPS)
ComputeShader m_ComputeGgxIblSampleDataCS = null;

Material m_GgxConvolveMaterial = null; // Convolves a cubemap with GGX
bool m_SupportMIS = !TextureCache.isMobileBuildTarget;
public bool SupportMIS
{
get { return m_SupportMIS; }
}
public void Initialize(ScriptableRenderContext context)
{
if (!m_ComputeGgxIblSampleDataCS)

}
if (!m_BuildProbabilityTablesCS)
if (!m_BuildProbabilityTablesCS && SupportMIS)
{
m_BuildProbabilityTablesCS = Resources.Load<ComputeShader>("BuildProbabilityTables");
m_ConditionalDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeConditionalDensities");

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
if (m_useMIS)
if (m_useMIS && m_iblFilterGgx.SupportMIS)
{
m_iblFilterGgx.FilterCubemapMIS(renderContext, input, target, mipCount, m_SkyboxConditionalCdfRT, m_SkyboxMarginalRowCdfRT, m_CubemapFaceMesh);
}

7
Assets/ScriptableRenderPipeline/ShaderLibrary/ImageBasedLighting.hlsl


{
case 1: sampleCount = 21; break;
case 2: sampleCount = 34; break;
#ifdef SHADER_API_MOBILE
case 3: sampleCount = 34; break;
case 4: sampleCount = 34; break;
case 5: sampleCount = 34; break;
case 6: sampleCount = 34; break; // UNITY_SPECCUBE_LOD_STEPS
#else
#endif
}
return sampleCount;

正在加载...
取消
保存