浏览代码

Added comments

/main
Antoine Lelievre 6 年前
当前提交
3c29756a
共有 3 个文件被更改,包括 7 次插入3 次删除
  1. 7
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/HDRISky.shader
  3. 1
      com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader

7
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs


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)
{

2
com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/HDRISky.shader


TEXTURECUBE(_Cubemap);
SAMPLER(sampler_Cubemap);
float4 _SkyParam; // x exposure, y multiplier, z rotation, w lux
float4 _SkyParam; // x exposure, y multiplier, z rotation
float4x4 _PixelCoordToViewDirWS; // Actually just 3x3, but Unity can only set 4x4
struct Attributes

1
com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader


#pragma fragment Frag
#pragma target 4.5
#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch
#pragma enable_d3d11_debug_symbols
#include "CoreRP/ShaderLibrary/Common.hlsl"
#include "CoreRP/ShaderLibrary/Color.hlsl"

正在加载...
取消
保存