|
|
|
|
|
|
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"); |
|
|
|