Skip to content

Commit 452a1ab

Browse files
Fixed LUT initialization in Wireframe mode (#5156)
Co-authored-by: sebastienlagarde <[email protected]>
1 parent 16e98f0 commit 452a1ab

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
358358
- Fixed motion vector for custom meshes loaded from compute buffer in shader graph (like Hair)
359359
- Fixed incorrect light list indexing when TAA is enabled (case 1352444).
360360
- Fixed Additional Velocity for Alembic not taking correctly into account vertex animation
361+
- Fixed wrong LUT initialization in Wireframe mode.
361362

362363
### Changed
363364
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard

com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ public override void RenderInit(CommandBuffer cmd)
285285
return;
286286
}
287287

288+
if (GL.wireframe)
289+
{
290+
m_preIntegratedFGD_Ward.Create();
291+
m_preIntegratedFGD_CookTorrance.Create();
292+
return;
293+
}
294+
288295
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.PreIntegradeWardCookTorrance)))
289296
{
290297
CoreUtils.DrawFullScreen(cmd, m_preIntegratedFGDMaterial_Ward, new RenderTargetIdentifier(m_preIntegratedFGD_Ward));

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ public void RenderInit(FGDIndex index, CommandBuffer cmd)
104104
if (m_isInit[(int)index] && m_PreIntegratedFGD[(int)index].IsCreated())
105105
return;
106106

107+
// If we are in wireframe mode, the drawfullscreen will not work as expected, but we don't need the LUT anyway
108+
// So create the texture to avoid errors, it will be initialized by the first render without wireframe
109+
if (GL.wireframe)
110+
{
111+
m_PreIntegratedFGD[(int)index].Create();
112+
return;
113+
}
114+
107115
CoreUtils.DrawFullScreen(cmd, m_PreIntegratedFGDMaterial[(int)index], new RenderTargetIdentifier(m_PreIntegratedFGD[(int)index]));
108116
m_isInit[(int)index] = true;
109117
}

0 commit comments

Comments
 (0)