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
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,7 @@ internal void ReserveCookieAtlasTexture(HDAdditionalLightData hdLightData, Light
m_TextureCaches.lightCookieManager.ReserveSpace(light?.cookie);
break;
case HDLightType.Point:
if (light.cookie != null && hdLightData.IESPoint != null && light.cookie != hdLightData.IESPoint)
if (light?.cookie != null && hdLightData.IESPoint != null && light.cookie != hdLightData.IESPoint)
m_TextureCaches.lightCookieManager.ReserveSpaceCube(light.cookie, hdLightData.IESPoint);
else if (light?.cookie != null)
m_TextureCaches.lightCookieManager.ReserveSpaceCube(light.cookie);
Expand All @@ -2854,7 +2854,7 @@ internal void ReserveCookieAtlasTexture(HDAdditionalLightData hdLightData, Light
break;
case HDLightType.Spot:
// Projectors lights must always have a cookie texture.
if (light.cookie != null && hdLightData.IESSpot != null && light.cookie != hdLightData.IESSpot)
if (light?.cookie != null && hdLightData.IESSpot != null && light.cookie != hdLightData.IESSpot)
m_TextureCaches.lightCookieManager.ReserveSpace(light.cookie, hdLightData.IESSpot);
else if (light?.cookie != null)
m_TextureCaches.lightCookieManager.ReserveSpace(light.cookie);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ static internal void DestroyVolumetricHistoryBuffers(HDCamera hdCamera)
}

// Must be called AFTER UpdateVolumetricBufferParams.
static readonly string[] volumetricHistoryBufferNames = new string[2]{ "VBufferHistory0", "VBufferHistory1" };
static internal void ResizeVolumetricHistoryBuffers(HDCamera hdCamera, int frameIndex)
{
if (!hdCamera.IsVolumetricReprojectionEnabled())
Expand All @@ -428,11 +429,9 @@ static internal void ResizeVolumetricHistoryBuffers(HDCamera hdCamera, int frame
CreateVolumetricHistoryBuffers(hdCamera, hdCamera.vBufferParams.Length); // Basically, assume it's 2
}

string[] names = new string[2]{ "VBufferHistory0", "VBufferHistory1" };

// We only resize the feedback buffer (#0), not the history buffer (#1).
// We must NOT resize the buffer from the previous frame (#1), as that would invalidate its contents.
ResizeVolumetricBuffer(ref hdCamera.volumetricHistoryBuffers[currIdx], names[currIdx], currentParams.viewportSize.x,
ResizeVolumetricBuffer(ref hdCamera.volumetricHistoryBuffers[currIdx], volumetricHistoryBufferNames[currIdx], currentParams.viewportSize.x,
currentParams.viewportSize.y,
currentParams.viewportSize.z);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ ExposureParameters PrepareExposureParameters(HDCamera hdCamera)
parameters.exposureVariants[2] = (int)adaptationMode;
parameters.exposureVariants[3] = 0;

bool useTextureMask = m_Exposure.meteringMode == MeteringMode.MaskWeighted && m_Exposure.weightTextureMask.value != null;
bool useTextureMask = m_Exposure.meteringMode.value == MeteringMode.MaskWeighted && m_Exposure.weightTextureMask.value != null;
parameters.textureMeteringMask = useTextureMask ? m_Exposure.weightTextureMask.value : Texture2D.whiteTexture;

ComputeProceduralMeteringParams(hdCamera, out parameters.proceduralMaskParams, out parameters.proceduralMaskParams2);
Expand Down