diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs index 768763c681d..8c4af06740a 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs @@ -23,18 +23,18 @@ public struct TextureHandle internal TextureHandle(int handle, bool shared = false) { this.handle = new ResourceHandle(handle, RenderGraphResourceType.Texture, shared); } /// - /// Cast to RTHandle + /// Cast to RenderTargetIdentifier /// /// Input TextureHandle. - /// Resource as a RTHandle. - public static implicit operator RTHandle(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null; + /// Resource as a RenderTargetIdentifier. + public static implicit operator RenderTargetIdentifier(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : default(RenderTargetIdentifier); /// - /// Cast to RenderTargetIdentifier + /// Cast to Texture /// /// Input TextureHandle. - /// Resource as a RenderTargetIdentifier. - public static implicit operator RenderTargetIdentifier(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : default(RenderTargetIdentifier); + /// Resource as a Texture. + public static implicit operator Texture(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null; /// /// Cast to RenderTexture @@ -43,6 +43,13 @@ public struct TextureHandle /// Resource as a RenderTexture. public static implicit operator RenderTexture(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null; + /// + /// Cast to RTHandle + /// + /// Input TextureHandle. + /// Resource as a RTHandle. + public static implicit operator RTHandle(TextureHandle texture) => texture.IsValid() ? RenderGraphResourceRegistry.current.GetTexture(texture) : null; + /// /// Return true if the handle is valid. /// diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs index 10d84198c55..7e0979b7b96 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs @@ -62,18 +62,13 @@ internal RTHandle(RTHandleSystem owner) } /// - /// Implicit conversion operator to RenderTexture + /// Implicit conversion operator to RenderTargetIdentifier /// /// Input RTHandle - /// RenderTexture representation of the RTHandle. - public static implicit operator RenderTexture(RTHandle handle) + /// RenderTargetIdentifier representation of the RTHandle. + 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); } /// @@ -92,13 +87,18 @@ public static implicit operator Texture(RTHandle handle) } /// - /// Implicit conversion operator to RenderTargetIdentifier + /// Implicit conversion operator to RenderTexture /// /// Input RTHandle - /// RenderTargetIdentifier representation of the RTHandle. - public static implicit operator RenderTargetIdentifier(RTHandle handle) + /// RenderTexture representation of the RTHandle. + 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) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl index 9ac26f0fc6a..51dfd6dffac 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl @@ -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 * @@ -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__ diff --git a/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl index d470640c7ad..72b831d61cd 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl @@ -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. @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl index 60134b1f17f..3f09066ebeb 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl @@ -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" //----------------------------------------------------------------------------- @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index f3c2e25d8f5..c2c63e30940 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -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 @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl index cb7e9064bce..dfc73c49963 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl @@ -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 @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl index 9307f64d2c9..397e2ff537b 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl @@ -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 //----------------------------------------------------------------------------- @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl index 4232dcaba07..57193b60ec4 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl @@ -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" @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl index 7deb639d6ec..48fe074f506 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl @@ -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" @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl index ef6802d9b30..bd297c3d7b4 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl @@ -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 //----------------------------------------------------------------------------- @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Fibonacci.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Fibonacci.hlsl index 80ffef36e98..0fa2682f2af 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Fibonacci.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Fibonacci.hlsl @@ -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 @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Hammersley.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Hammersley.hlsl index 21789e86568..56a60a4bc7f 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Hammersley.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Hammersley.hlsl @@ -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) { @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl index 62c8ffca972..009e2b432ce 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl @@ -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 //----------------------------------------------------------------------------- @@ -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 diff --git a/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl index c1484607d35..52903b13e55 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl @@ -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) @@ -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 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md b/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md index 7e6b6d6281f..2e4bb8e5a55 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md @@ -21,7 +21,7 @@ Here is the list of Material properties that you can access with the AOV API. | **Normal** | Outputs the surface albedo. | | **Albedo** | Outputs the surface normal. | | **Smoothness** | Outputs the surface smoothness. | -| **Ambient Occlusion** | Outputs the ambient occlusion (N/A for AxF). | +| **Ambient Occlusion** | Outputs the ambient occlusion (N/A for AxF). **Note**: the ambient occlusion this outputs does not include ray-traced/screen-space ambient occlusion from the [Ambient Occlusion override](Override-Ambient-Occlusion.md). It only includes ambient occlusion from materials in the Scene. | | **Specular** | Outputs the surface specularity. | | **Alpha** | Outputs the surface alpha (pixel coverage). | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md index d40991fc269..f6e6880134f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md @@ -228,7 +228,11 @@ You can find a small ray tracing project that contains all the effects mention a https://github.com/Unity-Technologies/SmallOfficeRayTracing This Project is already set up with ray tracing support. -## Unsupported features of ray tracing +## Limitations + +This section contains information on the limitations of HDRP's ray tracing implementation. Mainly, this is a list of features that HDRP supports in its rasterized render pipeline, but not in its ray-traced render pipeline. + +### Unsupported features of ray tracing There is no support for ray tracing on platforms other than DX12 for now. @@ -244,27 +248,13 @@ HDRP ray tracing in Unity 2020.2 has the following limitations: - Does not support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). - Ray tracing is not supported when rendering [Reflection Probes](Reflection-Probe.md). -## Unsupported features of path tracing - -There is no support for path tracing on platforms other than DX12 for now. - -HDRP path tracing in Unity 2020.2 has the following limitations: - -- Does not support 3D Text and TextMeshPro. -- Does not support Shader Graph nodes that use derivatives (ex : normal from textures). -- Does not support decals. -- Does not support tessellation. -- Does not support Tube and Disc shaped Area Light. -- Does not support Translucent Opaque Materials. -- Does not support several of HDRP's Materials. This includes Fabric, Eye, StackLit, Hair, Decal. -- Does not support per-pixel displacement (parallax occlusion mapping, height map, depth offset). -- Does not support MSAA. -- For renderers that have [LODs](https://docs.unity3d.com/2019.3/Documentation/Manual/LevelOfDetail.html), the ray tracing acceleration structure only includes the highest level LOD and ignores the lower LODs. -- Does not support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). - -## Unsupported shader graph nodes for ray tracing +### Unsupported shader graph nodes for ray tracing When building your custom shaders using shader graph, some nodes are incompatible with ray tracing. You need either to avoid using them or provide an alternative behavior using the ray tracing shader node. Here is the list of the incompatible nodes: - DDX, DDY and DDXY nodes. - All the nodes under Inputs > Geometry (Position, View Direction, Normal, etc.) in View Space mode. - Checkerboard node. + +### Unsupported features of path tracing + +For information about unsupported features of path tracing, see [Path tracing limitations](Ray-Tracing-Path-Tracing.md#limitations). diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md index bf792c51283..4d46e34ebb4 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md @@ -51,3 +51,26 @@ Path tracing uses the [Volume](Volumes.md) framework, so to enable this feature, ![](Images/RayTracingPathTracing6.png) **Minimum Depth** set to 2, **Maximum Depth** set to 2: indirect lighting only (1 bounce) + +## Limitations + +This section contains information on the limitations of HDRP's path tracing implementation. Mainly, this is a list of features that HDRP supports in its rasterized render pipeline, but not in its path-traced render pipeline. + +### Unsupported features of path tracing + +There is no support for path tracing on platforms other than DX12 for now. + +HDRP path tracing in Unity 2020.2 has the following limitations: + +- Does not support 3D Text and TextMeshPro. +- Does not support Shader Graph nodes that use derivatives (ex : normal from textures). +- Does not support decals. +- Does not support tessellation. +- Does not support Tube and Disc shaped Area Light. +- Does not support Translucent Opaque Materials. +- Does not support several of HDRP's Materials. This includes Fabric, Eye, StackLit, Hair, Decal. +- Does not support per-pixel displacement (parallax occlusion mapping, height map, depth offset). +- Does not support MSAA. +- For renderers that have [LODs](https://docs.unity3d.com/Documentation/Manual/LevelOfDetail.html), the ray tracing acceleration structure only includes the highest level LOD and ignores the lower LODs. +- Does not support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). +- Does not support [Streaming Virtual Texturing](https://docs.unity3d.com/Documentation/Manual/svt-streaming-virtual-texturing.html). diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs index 10b5e9904ff..b64580a4c67 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs @@ -187,9 +187,8 @@ static void DrawSpotlightWireframe(Vector3 outerAngleInnerAngleRange, float shad if (shadowPlaneDistance > 0) { - var shadowDiscRadius = shadowPlaneDistance * Mathf.Sin(outerAngle * Mathf.Deg2Rad * 0.5f); - var shadowDiscDistance = Mathf.Cos(Mathf.Deg2Rad * outerAngle / 2) * shadowPlaneDistance; - Handles.DrawWireDisc(Vector3.forward * shadowDiscDistance, Vector3.forward, shadowDiscRadius); + var shadowDiscRadius = shadowPlaneDistance * Mathf.Tan(outerAngle * Mathf.Deg2Rad * 0.5f); + Handles.DrawWireDisc(Vector3.forward * shadowPlaneDistance, Vector3.forward, shadowDiscRadius); } }