Skip to content

Commit

Permalink
com.unity.render-pipelines.core@11.0.0 in Unity 2021.1.4f1
Browse files Browse the repository at this point in the history
## [11.0.0] - 2020-10-21

### Added
- Support for the PlayStation 5 platform has been added.
- Support for the XboxSeries platform has been added.
- New API in DynamicResolutionHandler to handle multicamera rendering for hardware mode. Changing cameras and resetting scaling per camera should be safe.
- New API functions with no side effects in DynamicResolutionHandler, to retrieve resolved drs scale and to apply DRS on a size.

### Fixed
- Fixed the default background color for previews to use the original color.
- Fixed a bug in FreeCamera which would only provide a speed boost for the first frame when pressing the Shfit key.
- Fixed spacing between property fields on the Volume Component Editors.
- Fixed ALL/NONE to maintain the state on the Volume Component Editors.
- Fixed the selection of the Additional properties from ALL/NONE when the option "Show additional properties" is disabled
- Fixed ACES tonemaping for Nintendo Switch by forcing some shader color conversion functions to full float precision.
- Fixed missing warning UI about Projector component being unsupported (case 1300327).
- Fixed the display name of a Volume Parameter when is defined the attribute InspectorName
- Fixed ACES tonemaping on mobile platforms by forcing some shader color conversion functions to full float precision.
- Fix crash on VolumeComponentWithQualityEditor when the current Pipeline is not HDRP
- Calculating correct rtHandleScale by considering the possible pixel rounding when DRS is on
  • Loading branch information
Unity Technologies committed Apr 15, 2021
1 parent 9e639bd commit 82d5b10
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 19 deletions.
19 changes: 13 additions & 6 deletions Runtime/RenderGraph/RenderGraphResourceTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ public struct TextureHandle
internal TextureHandle(int handle, bool shared = false) { this.handle = new ResourceHandle(handle, RenderGraphResourceType.Texture, shared); }

/// <summary>
/// Cast to RTHandle
/// Cast to RenderTargetIdentifier
/// </summary>
/// <param name="texture">Input TextureHandle.</param>
/// <returns>Resource as a RTHandle.</returns>
public static implicit operator RTHandle(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null;
/// <returns>Resource as a RenderTargetIdentifier.</returns>
public static implicit operator RenderTargetIdentifier(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : default(RenderTargetIdentifier);

/// <summary>
/// Cast to RenderTargetIdentifier
/// Cast to Texture
/// </summary>
/// <param name="texture">Input TextureHandle.</param>
/// <returns>Resource as a RenderTargetIdentifier.</returns>
public static implicit operator RenderTargetIdentifier(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : default(RenderTargetIdentifier);
/// <returns>Resource as a Texture.</returns>
public static implicit operator Texture(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null;

/// <summary>
/// Cast to RenderTexture
Expand All @@ -43,6 +43,13 @@ public struct TextureHandle
/// <returns>Resource as a RenderTexture.</returns>
public static implicit operator RenderTexture(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null;

/// <summary>
/// Cast to RTHandle
/// </summary>
/// <param name="texture">Input TextureHandle.</param>
/// <returns>Resource as a RTHandle.</returns>
public static implicit operator RTHandle(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null;

/// <summary>
/// Return true if the handle is valid.
/// </summary>
Expand Down
26 changes: 13 additions & 13 deletions Runtime/Textures/RTHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,13 @@ internal RTHandle(RTHandleSystem owner)
}

/// <summary>
/// Implicit conversion operator to RenderTexture
/// Implicit conversion operator to RenderTargetIdentifier
/// </summary>
/// <param name="handle">Input RTHandle</param>
/// <returns>RenderTexture representation of the RTHandle.</returns>
public static implicit operator RenderTexture(RTHandle handle)
/// <returns>RenderTargetIdentifier representation of the RTHandle.</returns>
public static implicit operator RenderTargetIdentifier(RTHandle handle)
{
// If RTHandle is null then conversion should give a null RenderTexture
if (handle == null)
return null;

Debug.Assert(handle.rt != null, "RTHandle was created using a regular Texture and is used as a RenderTexture");
return handle.rt;
return handle != null ? handle.nameID : default(RenderTargetIdentifier);
}

/// <summary>
Expand All @@ -92,13 +87,18 @@ internal RTHandle(RTHandleSystem owner)
}

/// <summary>
/// Implicit conversion operator to RenderTargetIdentifier
/// Implicit conversion operator to RenderTexture
/// </summary>
/// <param name="handle">Input RTHandle</param>
/// <returns>RenderTargetIdentifier representation of the RTHandle.</returns>
public static implicit operator RenderTargetIdentifier(RTHandle handle)
/// <returns>RenderTexture representation of the RTHandle.</returns>
public static implicit operator RenderTexture(RTHandle handle)
{
return handle != null ? handle.nameID : default(RenderTargetIdentifier);
// If RTHandle is null then conversion should give a null RenderTexture
if (handle == null)
return null;

Debug.Assert(handle.rt != null, "RTHandle was created using a regular Texture and is used as a RenderTexture");
return handle.rt;
}

internal void SetRenderTexture(RenderTexture rt)
Expand Down
8 changes: 8 additions & 0 deletions ShaderLibrary/ACES.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef __ACES__
#define __ACES__

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

/**
* https://github.com/ampas/aces-dev
*
Expand Down Expand Up @@ -1316,4 +1320,8 @@ half3 ODT_P3DCI_48nits(half3 oces)
return outputCV;
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // __ACES__
9 changes: 9 additions & 0 deletions ShaderLibrary/BSDF.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_BSDF_INCLUDED
#define UNITY_BSDF_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"

// Note: All NDF and diffuse term have a version with and without divide by PI.
Expand Down Expand Up @@ -637,4 +641,9 @@ real3 D_KajiyaKay(real3 T, real3 H, real specularExponent)

return dirAttn * norm * PositivePow(sinTHSq, 0.5 * n);
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_BSDF_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Color.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_COLOR_INCLUDED
#define UNITY_COLOR_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl"

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -731,4 +735,8 @@ half3 DecodeRGBM(half4 rgbm)
return rgbm.xyz * rgbm.w * kRGBMRange;
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_COLOR_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Common.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_COMMON_INCLUDED
#define UNITY_COMMON_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

// Convention:

// Unity is Y up and left handed in world space
Expand Down Expand Up @@ -1341,4 +1345,8 @@ float SharpenAlpha(float alpha, float alphaClipTreshold)
// These clamping function to max of floating point 16 bit are use to prevent INF in code in case of extreme value
TEMPLATE_1_REAL(ClampToFloat16Max, value, return min(value, HALF_MAX))

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_COMMON_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/CommonLighting.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_COMMON_LIGHTING_INCLUDED
#define UNITY_COMMON_LIGHTING_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

// Ligthing convention
// Light direction is oriented backward (-Z). i.e in shader code, light direction is -lightData.forward

Expand Down Expand Up @@ -455,4 +459,8 @@ bool IsMatchingLightLayer(uint lightLayers, uint renderingLayers)
return (lightLayers & renderingLayers) != 0;
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_COMMON_LIGHTING_INCLUDED
9 changes: 9 additions & 0 deletions ShaderLibrary/CommonMaterial.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_COMMON_MATERIAL_INCLUDED
#define UNITY_COMMON_MATERIAL_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

//-----------------------------------------------------------------------------
// Define constants
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -329,4 +333,9 @@ real3 LerpWhiteTo(real3 b, real t)
real oneMinusT = 1.0 - t;
return real3(oneMinusT, oneMinusT, oneMinusT) + b * t;
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_COMMON_MATERIAL_INCLUDED
7 changes: 7 additions & 0 deletions ShaderLibrary/EntityLighting.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_ENTITY_LIGHTING_INCLUDED
#define UNITY_ENTITY_LIGHTING_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"

Expand Down Expand Up @@ -355,5 +359,8 @@ real3 SampleDirectionalLightmap(TEXTURE2D_LIGHTMAP_PARAM(lightmapTex, lightmapSa
return bakeDiffuseLighting;
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_ENTITY_LIGHTING_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/ImageBasedLighting.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_IMAGE_BASED_LIGHTING_INCLUDED
#define UNITY_IMAGE_BASED_LIGHTING_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl"
Expand Down Expand Up @@ -738,4 +742,8 @@ float InfluenceFadeNormalWeight(float3 normal, float3 centerToPos)
return saturate((-1.0f / 0.4f) * dot(normal, centerToPos) + (0.6f / 0.4f));
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_IMAGE_BASED_LIGHTING_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Packing.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_PACKING_INCLUDED
#define UNITY_PACKING_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

//-----------------------------------------------------------------------------
// Normal packing
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -581,4 +585,8 @@ float2 Unpack8ToFloat2(float f)
return float2(x, y);
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_PACKING_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Sampling/Fibonacci.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_FIBONACCI_INCLUDED
#define UNITY_FIBONACCI_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

// Computes a point using the Fibonacci sequence of length N.
// Input: Fib[N - 1], Fib[N - 2], and the index 'i' of the point.
// Ref: Efficient Quadrature Rules for Illumination Integrals
Expand Down Expand Up @@ -295,4 +299,8 @@ real2 SampleSphereFibonacci(uint i, uint sampleCount)
return real2(1 - 2 * f.x, TWO_PI * f.y);
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_FIBONACCI_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Sampling/Hammersley.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_HAMMERSLEY_INCLUDED
#define UNITY_HAMMERSLEY_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

// Ref: http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
uint ReverseBits32(uint bits)
{
Expand Down Expand Up @@ -420,4 +424,8 @@ real2 Hammersley2d(uint i, uint sampleCount)
}
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_HAMMERSLEY_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/Sampling/Sampling.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_SAMPLING_INCLUDED
#define UNITY_SAMPLING_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

//-----------------------------------------------------------------------------
// Sample generator
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -305,4 +309,8 @@ void SampleCone(real2 u, real cosHalfAngle,
rcpPdf = TWO_PI * (1 - cosHalfAngle);
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif // UNITY_SAMPLING_INCLUDED
8 changes: 8 additions & 0 deletions ShaderLibrary/SpaceTransforms.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef UNITY_SPACE_TRANSFORMS_INCLUDED
#define UNITY_SPACE_TRANSFORMS_INCLUDED

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (disable : 3205) // conversion of larger type to smaller
#endif

// Caution: For HDRP, adding a function in this file requires adding the appropriate #define in PickingSpaceTransforms.hlsl

// Return the PreTranslated ObjectToWorld Matrix (i.e matrix with _WorldSpaceCameraPos apply to it if we use camera relative rendering)
Expand Down Expand Up @@ -236,4 +240,8 @@ real3 TransformObjectToTangent(real3 dirOS, real3x3 tangentToWorld)
return TransformWorldToTangent(normalWS, tangentToWorld);
}

#if SHADER_API_MOBILE || SHADER_API_GLES || SHADER_API_GLES3
#pragma warning (enable : 3205) // conversion of larger type to smaller
#endif

#endif

0 comments on commit 82d5b10

Please sign in to comment.