浏览代码

Merge pull request #981 from Unity-Technologies/Branch_FixSkyRotation

Reversed rotation of HDRI sky to match legacy and removed it from pro…
/main
GitHub 7 年前
当前提交
41657818
共有 4 个文件被更改,包括 6 次插入5 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/SkySettingsEditor.cs
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/HDRISky/HDRISkyRenderer.cs
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/ProceduralSky/ProceduralSkyRenderer.cs

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs


EditorGUILayout.Space();
base.CommonSkySettingsGUI();
base.CommonSkySettingsGUI(false);
}
}
}

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/SkySettingsEditor.cs


m_EnvUpdatePeriod = Unpack(o.Find(x => x.updatePeriod));
}
protected void CommonSkySettingsGUI()
protected void CommonSkySettingsGUI(bool enableRotation = true)
PropertyField(m_SkyRotation);
if(enableRotation)
PropertyField(m_SkyRotation);
PropertyField(m_EnvUpdateMode);
if (!m_EnvUpdateMode.value.hasMultipleDifferentValues && m_EnvUpdateMode.value.intValue == (int)EnvironementUpdateMode.Realtime)

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/HDRISky/HDRISkyRenderer.cs


public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
{
m_SkyHDRIMaterial.SetTexture(HDShaderIDs._Cubemap, m_HdriSkyParams.skyHDRI);
m_SkyHDRIMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_HdriSkyParams.exposure, m_HdriSkyParams.multiplier, m_HdriSkyParams.rotation, 0.0f));
m_SkyHDRIMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_HdriSkyParams.exposure, m_HdriSkyParams.multiplier, -m_HdriSkyParams.rotation, 0.0f)); // -rotation to match Legacy...
// This matrix needs to be updated at the draw call frequency.
m_PropertyBlock.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix);

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/ProceduralSky/ProceduralSkyRenderer.cs


sunDirection = -builtinParams.sunLight.transform.forward;
}
m_SkyProceduralMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_ProceduralSkyParams.exposure, m_ProceduralSkyParams.multiplier, m_ProceduralSkyParams.rotation, 0.0f));
m_SkyProceduralMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_ProceduralSkyParams.exposure, m_ProceduralSkyParams.multiplier, 0.0f, 0.0f));
m_SkyProceduralMaterial.SetFloat(_SunSizeParam, m_ProceduralSkyParams.sunSize);
m_SkyProceduralMaterial.SetFloat(_SunSizeConvergenceParam, m_ProceduralSkyParams.sunSizeConvergence);
m_SkyProceduralMaterial.SetFloat(_AtmoshpereThicknessParam, m_ProceduralSkyParams.atmosphereThickness);

正在加载...
取消
保存