Skip to content

Merge 7.x.x/hd/staging #1796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3946d4b
Pre warm RT Handle system so that reallocations are reduced.
FrancescoC-unity Jun 6, 2020
c650892
Fixed blend distance editing (1248931) #838
fredericv-unity3d Jun 12, 2020
c01d193
Fix custom pass after post process buffer #1072
alelievr Jul 2, 2020
4ab10ca
Find the appropriate default frame settings per editor (case 1247631)…
fredericv-unity3d Jul 3, 2020
33799c6
Hdrp/fix hierarchicalbox gizmo symetry and homothety mode ensuring fa…
RSlysz Jul 9, 2020
fbd6866
Remove MSAA debug mode when renderpipeline asset has no MSAA #1289
adrien-de-tocqueville Jul 16, 2020
c7912b8
Bugfix for HDRenderPipelineAsset getting set to null when running uni…
pastasfuture Aug 31, 2020
999e171
Fix compilation issue when XR is not available #1391
FrancescoC-unity Jul 23, 2020
dc83afb
Fixed an issue where only one of the two lookdev views would update w…
JulienIgnace-Unity Aug 25, 2020
2569f24
Added propagating nans doc (#1562)
JordanL8 Aug 25, 2020
6dafa20
GFXGI-237: Force update for static skies when camera type is set to S…
i9neus Aug 25, 2020
76a4790
Fixing the remapping of Min/Max parametrizations values to Amplitude …
jpg-unity Aug 25, 2020
e902855
Updating UI to match documentation of LayeredLit
jpg-unity Aug 26, 2020
b99725b
Hdrp/fix/terrain layer parametrization #1678
sebastienlagarde Sep 1, 2020
ccc5ed0
Update HDRenderPipeline.LookDev.cs (#1740)
sebastienlagarde Sep 1, 2020
f2687a8
Added information about HDRP not upgrading particle shaders (#1601)
JordanL8 Aug 24, 2020
5e5cf3c
Changed cog to gear to adhere to style guide rules #1611
JordanL8 Aug 24, 2020
aa0d711
Added build settings setup (#1631)
JordanL8 Aug 24, 2020
8438717
Hdrp/docs/shader additions #1580
JordanL8 Aug 24, 2020
5eddf1c
Merge branch '7.x.x/release' into 7.x.x/hd/staging
sebastienlagarde Sep 2, 2020
acdb92b
Merge branch '7.x.x/release' into 7.x.x/hd/staging
sebastienlagarde Sep 8, 2020
5431fd6
Fix XR multipass #1133
fabien-unity Jul 4, 2020
edee636
Fix Screen position out of view frustum issues when planar reflection…
FrancescoC-unity Sep 2, 2020
2283cc7
Update Layered-Lit-Shader #1766
JordanL8 Sep 3, 2020
d0f2506
Fix for assertion on undoing a mod of diffuse profile list with volum…
FrancescoC-unity Sep 4, 2020
5ad49f8
Fixed two issues with sky static lighting. #1775
JulienIgnace-Unity Sep 8, 2020
5ae9bee
[8.x.x backport] Fix issues with history sampling and hw dynamic res …
FrancescoC-unity Sep 4, 2020
f2db371
fixed changelog
sebastienlagarde Sep 8, 2020
59e548d
Fix for potentially corrupted refraction result on xbox #1699
FrancescoC-unity Sep 9, 2020
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 @@ -119,8 +119,14 @@ void OnUndoRedoPerformed()

// Dumb hack to make sure the serialized object is up to date on undo (else there'll be
// a state mismatch when this class is used in a GameObject inspector).
m_SerializedObject.Update();
m_SerializedObject.ApplyModifiedProperties();
if (m_SerializedObject != null
&& !m_SerializedObject.Equals(null)
&& m_SerializedObject.targetObject != null
&& !m_SerializedObject.targetObject.Equals(null))
{
m_SerializedObject.Update();
m_SerializedObject.ApplyModifiedProperties();
}

// Seems like there's an issue with the inspector not repainting after some undo events
// This will take care of that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples)
lastFrameMaxSize = new Vector2(GetMaxWidth(), GetMaxHeight());
}

if (DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled())
if (DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled() && m_HardwareDynamicResRequested)
{
m_RTHandleProperties.rtHandleScale = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
}
Expand Down
10 changes: 9 additions & 1 deletion com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed issue that failed compilation when XR is disabled.
- Fixed an issue where only one of the two lookdev views would update when changing the default lookdev volume profile
- Fix Amplitude -> Min/Max parametrization conversion

- Fixed sky asserts with XR multipass
- Fixed "Screen position out of view frustum" error when camera is at exactly the planar reflection probe location.
- Fixed issue when undoing a change in diffuse profile list after deleting the volume profile.
- Fixed a static lighting flickering issue caused by having an active planar probe in the scene while rendering inspector preview.
- Fixed an issue where even when set to OnDemand, the sky lighting would still be updated when changing sky parameters.
- Fixed TAA issue and hardware dynamic resolution.
- Fixed warning with area mesh (case 1268379)
- Fixed an issue that lead to corrupted refraction in some scenarios on xbox.

### Changed
- The `CustomPassLoadCameraColor` and `CustomPassSampleCameraColor` functions now returns the correct color buffer when used in after post process instead of the color pyramid (which didn't had post processes).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ Unity exposes up to four Material layers for you to use in your Layered Material
| **Smoothness Remapping** | Use this min-max slider to remap the smoothness values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.<br />This property only appears when you assign a **Mask Map**. |
| **Ambient Occlusion Remapping** | Use this min-max slider to remap the ambient occlusion values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.<br />This property only appears when you assign a **Mask Map**. |
| **Mask Map** | Assign a [channel-packed Texture](Glossary.html#ChannelPacking) with the following Material maps in its RGBA channels.<br />&#8226; **Red**: Stores the metallic map. <br />&#8226; **Green**: Stores the ambient occlusion map.<br />&#8226; **Blue**: Stores the detail mask map.<br />&#8226; **Alpha**: Stores the smoothness map.<br />For more information on channel-packed Textures and the mask map, see [mask map](Mask-Map-and-Detail-Map.html#MaskMap). |
| **Normal Map Space** | Use this drop-down to select the type of Normal Map space that this Material uses.**TangentSpace**: Defines the normal map in UV space; use this to tile a Texture on a Mesh. The normal map Texture must be BC7, BC5, or DXT5nm format. **ObjectSpace**: Defines the normal maps in world space. Use this for planar-mapping objects like the terrain. The normal map must be an RGB Texture . |
| **Normal Map Space** | Use this drop-down to select the type of Normal Map space that this Material uses.<br />&#8226; **TangentSpace**: Defines the normal map in UV space; use this to tile a Texture on a Mesh. The normal map Texture must be BC7, BC5, or DXT5nm format.<br />&#8226; **ObjectSpace**: Defines the normal maps in world space. Use this for planar-mapping objects like the terrain. The normal map must be an RGB Texture . |
| **Normal Map** | Assign a Texture that defines the normal map for this Material in tangent space. Use the slider to modulate the normal intensity between 0 and 8.<br />This property only appears when you select **TangentSpace** from the **Normal Map Space** drop-down. |
| **Normal Map OS** | Assign a Texture that defines the object space normal map for this Material. Use the handle to modulate the normal intensity between 0 and 8.<br />This property only appears when you select **ObjectSpace** from the **Normal Map Space** drop-down. |
| **Bent Normal Map** | Assign a Texture that defines the bent normal map for this Material in tangent space. HDRP uses bent normal maps to simulate more accurate ambient occlusion. Note: Bent normal maps only work with diffuse lighting.<br />This property only appears when you select **TangentSpace** from the **Normal Map Space** drop-down.. |
| **Bent Normal Map OS** | Assign a Texture that defines the bent normal map for this Material in object space. HDRP uses bent normal maps to simulate more accurate ambient occlusion. Note: Bent normal maps only work with diffuse lighting.<br />This property only appears when you select **ObjectSpace** from the **Normal Map Space** drop-down. |
| **Height Map** | Assign a Texture that defines the heightmap for this Material. Unity uses this map to blend this layer. |
| **- Parametrization** | Use the drop-down to select the parametrization method for the to use for the **Height Map**.**Min/Max**: HDRP compares the **Min** and **Max** value to calculate the peak, trough, and base position of the heightmap. If the **Min** is -1 and the **Max** is 3, then the base is at the Texture value 0.25. This uses the full range of the heightmap.**Amplitude**: Allows you to manually set the amplitude and base position of the heightmap. This uses the full range of the heightmap. |
| **- Parametrization** | Use the drop-down to select the parametrization method for the to use for the **Height Map**.<br />&#8226; **Min/Max**: HDRP compares the **Min** and **Max** value to calculate the peak, trough, and base position of the heightmap. If the **Min** is -1 and the **Max** is 3, then the base is at the Texture value 0.25. This uses the full range of the heightmap.<br />&#8226; **Amplitude**: Allows you to manually set the amplitude and base position of the heightmap. This uses the full range of the heightmap. In this mode, **Amplitude** sets the range of values and **Base** defines how far through the range the zero value (base) is. For example, if **Amplitude** is 100 and **Base** is 0.5 (the default value), the minimum value is -50 and the maximum value if 50. If you then set **Base** to 0, the minimum value becomes 0 and the maximum value becomes 100. |
| **- Min** | Set the minimum value in the **Height Map**. |
| **- Max** | Set the maximum value in the **Height Map**. |
| **- Offset** | Set the offset that HDRP applies to the **Height Map**. |
| **- Amplitude** | Set the amplitude of the **Height Map**. |
| **- Base** | Use the slider to set the base for the **Height Map**. |
| **Base UV Mapping** | Use the drop-down to select the type of UV mapping that HDRP uses to map Textures to this Material’s surface.Unity manages four UV channels for a vertex: **UV0**, **UV1**, **UV2**, and **UV3**.**Planar:** A planar projection from top to bottom. **Triplanar**: A planar projection in three directions:X-axis: Left to rightY-axis: Top to bottomZ-axis: Front to back Unity blends these three projections together to produce the final result. |
| **- Amplitude** | Set the amplitude of the **Height Map**. This is the range of values the height map represents. |
| **- Base** | Use the slider to set the base for the **Height Map**. This is the value of the level 0 in the height map. If you set this to 0.5 and set **Amplitude** to 100, the minimum value is -50 and the maximum value is 50. |
| **Base UV Mapping** | Use the drop-down to select the type of UV mapping that HDRP uses to map Textures to this Material’s surface.<br />&#8226; Unity manages four UV channels for a vertex: **UV0**, **UV1**, **UV2**, and **UV3**.<br />&#8226; **Planar:** A planar projection from top to bottom.<br />&#8226; **Triplanar**: A planar projection in three directions:X-axis: Left to rightY-axis: Top to bottomZ-axis: Front to back Unity blends these three projections together to produce the final result. |
| **Tiling** | Set an **X** and **Y** UV tile rate for all of the Textures in the **Surface Inputs** section. HDRP uses the **X** and **Y** values to tile these Textures across the Material’s surface, in object space. |
| **Offset** | Set an **X** and **Y** UV offset for all of the Textures in the **Surface Inputs** section. HDRP uses the **X** and **Y** values to offset these Textures across the Material’s surface, in object. |

Expand All @@ -128,7 +128,7 @@ Unity exposes up to four Material layers for you to use in your Layered Material
| **Emission UV Mapping** | Use the drop-down to select the type of UV mapping that HDRP uses for the **Emission Map**.• Unity manages four UV channels for a vertex: **UV0**, **UV1**, **UV2**, and **UV3**.• **Planar:** A planar projection from top to bottom.• **Triplanar**: A planar projection in three directions:X-axis: Left to rightY-axis: Top to bottomZ-axis: Front to back Unity blends these three projections together to produce the final result. |
| **- Tiling** | Set an **X** and **Y** tile rate for the **Emission Map** UV. HDRP uses the **X** and **Y** values to tile the Texture assigned to the **Emission Map** across the Material’s surface, in object space. |
| **- Offset** | Set an **X** and **Y** offset for the **Emission Map** UV. HDRP uses the **X** and **Y** values to offset the Texture assigned to the **Emission Map** across the Material’s surface, in object space. |
| **Emission Intensity** | Set the overall strength of the emission effect for this Material.Use the drop-down to select one of the following [physical light units](Physical-Light-Units.html) to use for intensity:[Nits](Physical-Light-Units.html#Nits)[EV<sub>100</sub>](Physical-Light-Units.html#EV) |
| **Emission Intensity** | Set the overall strength of the emission effect for this Material.Use the drop-down to select one of the following [physical light units](Physical-Light-Units.md) to use for intensity:<br />&#8226; [Nits](Physical-Light-Units.md#Nits)<br />&#8226; [EV<sub>100</sub>](Physical-Light-Units.md#EV) |
| **Exposure Weight** | Use the slider to set how much effect the exposure has on the emission power. For example, if you create a neon tube, you would want to apply the emissive glow effect at every exposure. |
| **Emission Multiply with Base** | Enable the checkbox to make HDRP use the base color of the Material when it calculates the final color of the emission. When enabled, HDRP multiplies the emission color by the base color to calculate the final emission color. |
| **Emission** | Toggles whether emission affects global illumination. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ internal void ForceRenderingNextUpdate()

void UpdateProbeName()
{
// TODO: ask if this is ok:
if (settings.type == ProbeSettings.ProbeType.PlanarProbe)
if (settings.type == ProbeSettings.ProbeType.ReflectionProbe)
{
for (int i = 0; i < 6; i++)
probeName[i] = $"Reflection Probe RenderCamera ({name}: {(CubemapFace)i})";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ float IntersectSphereProxy(EnvLightData lightData, float3 dirPS, float3 position
{
float sphereOuterDistance = lightData.proxyExtents.x;
float projectionDistance = IntersectRaySphereSimple(positionPS, dirPS, sphereOuterDistance);
projectionDistance = IsNaN(projectionDistance) ? -1.0f : projectionDistance; // Note that because we use IntersectRaySphereSimple, in case of a ill-set proxy, it could be that
// the determinant in the ray-sphere intersection code ends up negative, leading to a NaN.
// Rather than complicating the IntersectRaySphereSimple or switching to a more complex case, we cover that case this way.
projectionDistance = max(projectionDistance, lightData.minProjectionDistance); // Setup projection to infinite if requested (mean no projection shape)

return projectionDistance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c
cullingResults = req.cullingResults;
skipClearCullingResults.Add(req.index);
needCulling = false;
m_SkyManager.UpdateCurrentSkySettings(hdCamera);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,13 @@ internal static void Sanitize(ref FrameSettings sanitizedFrameSettings, Camera c
// When MSAA is enabled we disable Fptl as it become expensive compare to cluster
// In HD, MSAA is only supported for forward only rendering, no MSAA in deferred mode (for code complexity reasons)
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.FPTLForForwardOpaque] &= !msaa;

// We disable reflection probes and planar reflections in regular preview rendering for two reasons.
// - Performance: Realtime reflection are 99% not necessary in previews
// - Static lighting consistency: When rendering a planar probe from a preview camera it may induce a recomputing of the static lighting
// but with the preview lights which are different from the ones in the scene and will change the result inducing flickering.
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.ReflectionProbe] &= !preview;
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.PlanarProbe] &= !preview;
}

/// <summary>Aggregation is default with override of the renderer then sanitized depending on supported features of hdrpasset.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,18 @@ public void UpdateEnvironment( HDCamera hdCamera,
m_BuiltinParameters.frameIndex = frameIndex;
m_BuiltinParameters.skySettings = skyContext.skySettings;

// When update is not requested and the context is already valid (ie: already computed at least once),
// we need to early out in two cases:
// - updateMode is "OnDemand" in which case we never update unless explicitly requested
// - updateMode is "Realtime" in which case we only update if the time threshold for realtime update is passed.
if (IsCachedContextValid(skyContext) && !updateRequired)
{
if (skyContext.skySettings.updateMode.value == EnvironmentUpdateMode.OnDemand)
return;
else if (skyContext.skySettings.updateMode.value == EnvironmentUpdateMode.Realtime && skyContext.currentUpdateTime < skyContext.skySettings.updatePeriod.value)
return;
}

int skyHash = ComputeSkyHash(hdCamera, skyContext, sunLight, ambientMode, staticSky);
bool forceUpdate = updateRequired;

Expand All @@ -745,6 +757,7 @@ public void UpdateEnvironment( HDCamera hdCamera,
{
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.UpdateSkyEnvironment)))
{
// Debug.Log("Update Sky Lighting");
RenderSkyToCubemap(skyContext);

if (updateAmbientProbe)
Expand Down Expand Up @@ -823,7 +836,7 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC
if ((ambientMode == SkyAmbientMode.Static || forceStaticUpdate) && hdCamera.camera.cameraType != CameraType.Preview)
{
m_StaticLightingSky.skySettings = staticLightingSky != null ? staticLightingSky.skySettings : null;
UpdateEnvironment(hdCamera, renderContext, m_StaticLightingSky, sunLight, m_StaticSkyUpdateRequired, true, true, SkyAmbientMode.Static, frameIndex, cmd);
UpdateEnvironment(hdCamera, renderContext, m_StaticLightingSky, sunLight, m_StaticSkyUpdateRequired || m_UpdateRequired, true, true, SkyAmbientMode.Static, frameIndex, cmd);
m_StaticSkyUpdateRequired = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ static ProbeCapturePositionSettings ComputeFrom(
var result = new ProbeCapturePositionSettings();
var proxyToWorld = probe.proxyToWorld;
result.proxyPosition = proxyToWorld.GetColumn(3);

// If reference position and proxy position is exactly the same, we end up in some degeneracies triggered
// by engine code when computing culling parameters. This is an extremely rare case, but can happen
// in editor when focusing on the planar probe. So if that happens, we offset them 0.1 mm apart.
if(Vector3.Distance(result.proxyPosition, referencePosition) < 1e-4f)
{
referencePosition += new Vector3(1e-4f, 1e-4f, 1e-4f);
}

result.proxyRotation = proxyToWorld.rotation;
result.referencePosition = referencePosition;
result.referenceRotation = referenceRotation;
Expand Down