浏览代码

Merge pull request #1677 from Unity-Technologies/Branch_FixPreIntegratedFGD

Fixed PreIntegratedFGD texture being destroyed in some cases and not …
/main
GitHub 6 年前
当前提交
a94b9fdf
共有 4 个文件被更改,包括 4 次插入23 次删除
  1. 1
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  2. 11
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
  3. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
  4. 11
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs

1
com.unity.render-pipelines.high-definition/CHANGELOG.md


### Fixed
- Fixed an issue with distortion that was using previous frame instead of current frame
- Fixed an issue where disabled light where not upgrade correctly to the new physical light unit system introduce in 2.0.5-preview
- Fixed an issue with PreIntegratedFGD texture being sometimes destroyed and not regenerated causing rendering to break
## [2.0.5-preview]

11
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs


// Init precomputed texture
//-----------------------------------------------------------------------------
bool m_isInit;
public Lit() {}
public override void Build(HDRenderPipelineAsset hdAsset)

m_isInit = false;
}
public override void Cleanup()

m_isInit = false;
if (m_isInit)
return;
m_isInit = true;
}
public override void Bind()

4
com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs


public void RenderInit(FGDIndex index, CommandBuffer cmd)
{
if (m_isInit[(int)index])
// Here we have to test IsCreated because in some circumstances (like loading RenderDoc), the texture is internally destroyed but we don't know from C# side.
// In this case IsCreated will return false, allowing us to re-render the texture (setting the texture as current RT during DrawFullScreen will automatically re-create it internally)
if (m_isInit[(int)index] && m_PreIntegratedFGD[(int)index].IsCreated())
return;
using (new ProfilingSample(cmd, "PreIntegratedFGD Material Generation"))

11
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs


// Init precomputed textures
//-----------------------------------------------------------------------------
bool m_isInit;
public StackLit() {}
public override void Build(HDRenderPipelineAsset hdAsset)

m_isInit = false;
}
public override void Cleanup()

m_isInit = false;
if (m_isInit)
return;
m_isInit = true;
}
public override void Bind()

正在加载...
取消
保存