Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed serialization issue with matcap scale intensity.
- Fixed XR shadows culling
- Fixed volument component creation via script.
- Fixed issue with exposure history being uninitialized on second frame.

### Changed
- Removed XRSystemTests. The GC verification is now done during playmode tests (case 1285012).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ private enum SMAAStage

HDRenderPipeline m_HDInstance;

void FillEmptyExposureTexture()
static void SetExposureTextureToEmpty(RTHandle exposureTexture)
{
var tex = new Texture2D(1, 1, TextureFormat.RGHalf, false, true);
tex.SetPixel(0, 0, new Color(1f, ColorUtils.ConvertExposureToEV100(1f), 0f, 0f));
tex.Apply();
Graphics.Blit(tex, m_EmptyExposureTexture);
Graphics.Blit(tex, exposureTexture);
CoreUtils.Destroy(tex);
}

Expand Down Expand Up @@ -218,7 +218,7 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources
// TODO: Write a version that uses structured buffer instead of texture to do atomic as Metal doesn't support atomics on textures.
m_MotionBlurSupportsScattering = m_MotionBlurSupportsScattering && (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Metal);

FillEmptyExposureTexture();
SetExposureTextureToEmpty(m_EmptyExposureTexture);

// Initialize our target pool to ease RT management
m_Pool = new TargetPool();
Expand Down Expand Up @@ -305,7 +305,7 @@ public void Cleanup()
void CheckRenderTexturesValidity()
{
if (!m_EmptyExposureTexture.rt.IsCreated())
FillEmptyExposureTexture();
SetExposureTextureToEmpty(m_EmptyExposureTexture);

HDUtils.CheckRTCreated(m_InternalLogLut.rt);
HDUtils.CheckRTCreated(m_TempTexture1024.rt);
Expand Down Expand Up @@ -827,9 +827,11 @@ static void GrabExposureHistoryTextures(HDCamera camera, out RTHandle previous,
RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem)
{
// r: multiplier, g: EV100
return rtHandleSystem.Alloc(1, 1, colorFormat: k_ExposureFormat,
var rt = rtHandleSystem.Alloc(1, 1, colorFormat: k_ExposureFormat,
enableRandomWrite: true, name: $"Exposure Texture ({id}) {frameIndex}"
);
SetExposureTextureToEmpty(rt);
return rt;
}

// We rely on the RT history system that comes with HDCamera, but because it is swapped
Expand Down