|
|
|
|
|
|
readBackTexture = null; |
|
|
|
} |
|
|
|
|
|
|
|
// Compute the lux value in the upper hemisphere of the HDRI skybox
|
|
|
|
// GPU texture readback
|
|
|
|
|
|
|
|
float omegaP = (Mathf.PI * 4) / (6.0f * hdri.width * hdri.width); |
|
|
|
m_IntegrateHDRISkyMaterial.SetTexture(HDShaderIDs._Cubemap, hdri); |
|
|
|
m_IntegrateHDRISkyMaterial.SetFloat(HDShaderIDs._InvOmegaP, 1.0f / omegaP); |
|
|
|
|
|
|
// Copy the rendertexture containing the lux value inside a Texture2D
|
|
|
|
// And then the value inside this texture
|
|
|
|
Color hdriIntensity = readBackTexture.GetPixel(0, 0); |
|
|
|
m_UpperHemisphereLuxValue.value.floatValue = hdriIntensity.r; |
|
|
|
} |
|
|
|
|
|
|
PropertyField(m_IntensityMode); |
|
|
|
} |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
if (m_IntensityMode.value.enumValueIndex == (int)SkyIntensityMode.Lux) |
|
|
|
{ |
|
|
|