Browse Source

Upgraded to PPV2 version 3.4.0 with WebGPU support and several bug fixes

master
Nico de Poel 2 years ago
parent
commit
f399aaee4f
  1. 5
      Packages/com.unity.postprocessing@3.2.2/.buginfo
  2. 54
      Packages/com.unity.postprocessing@3.2.2/.gitattributes
  3. 13
      Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md
  4. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs
  5. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AutoExposureEditor.cs
  6. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs
  7. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AutoExposure.cs
  8. 99
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs
  9. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Monitors/Monitor.cs
  10. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs
  11. 22
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs
  12. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/ACES.hlsl
  13. 52
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/API/WebGPU.hlsl
  14. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/API/WebGPU.hlsl.meta
  15. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/FinalPass.shader
  16. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVODownsample1.compute
  17. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute
  18. 59
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVOUpsample.compute
  19. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/Uber.shader
  20. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Colors.hlsl
  21. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/StdLib.hlsl
  22. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Textures/Cubes/.gitignore
  23. 2
      Packages/com.unity.postprocessing@3.2.2/package.json

5
Packages/com.unity.postprocessing@3.2.2/.buginfo

@ -0,0 +1,5 @@
system: jira
server: jira.unity3d.com
issuetype: Bug
package: PostProcessing
project: PPB

54
Packages/com.unity.postprocessing@3.2.2/.gitattributes

@ -0,0 +1,54 @@
* text=auto eol=lf
# Unity assets are always serialized using lf endings
LightingData.asset binary
*.unitypackage filter=lfs diff=lfs merge=lfs -text
*.[pP][sS][dD] filter=lfs diff=lfs merge=lfs -text
*.[jJ][pP][gG] filter=lfs diff=lfs merge=lfs -text
*.[pP][nN][gG] filter=lfs diff=lfs merge=lfs -text
*.[gG][iI][fF] filter=lfs diff=lfs merge=lfs -text
*.[bB][mM][pP] filter=lfs diff=lfs merge=lfs -text
*.[tT][gG][aA] filter=lfs diff=lfs merge=lfs -text
*.[tT][iI][fF][fF] filter=lfs diff=lfs merge=lfs -text
*.[tT][iI][fF] filter=lfs diff=lfs merge=lfs -text
*.[iI][fF][fF] filter=lfs diff=lfs merge=lfs -text
*.[pP][iI][cC][tT] filter=lfs diff=lfs merge=lfs -text
*.[dD][dD][sS] filter=lfs diff=lfs merge=lfs -text
*.[xX][cC][fF] filter=lfs diff=lfs merge=lfs -text
*.[mM][pP]3 filter=lfs diff=lfs merge=lfs -text
*.[oO][gG][gG] filter=lfs diff=lfs merge=lfs -text
*.[wW][aA][vV] filter=lfs diff=lfs merge=lfs -text
*.[aA][iI][fF][fF] filter=lfs diff=lfs merge=lfs -text
*.[aA][iI][fF] filter=lfs diff=lfs merge=lfs -text
*.[mM][oO][dD] filter=lfs diff=lfs merge=lfs -text
*.[iI][tT][tT] filter=lfs diff=lfs merge=lfs -text
*.[sS]3[mM] filter=lfs diff=lfs merge=lfs -text
*.[xX][mM] filter=lfs diff=lfs merge=lfs -text
*.[mM][oO][vV] filter=lfs diff=lfs merge=lfs -text
*.[aA][vV][iI] filter=lfs diff=lfs merge=lfs -text
*.[aA][sS][fF] filter=lfs diff=lfs merge=lfs -text
*.[mM][pP][gG] filter=lfs diff=lfs merge=lfs -text
*.[mM][pP][eE][gG] filter=lfs diff=lfs merge=lfs -text
*.[mM][pP]4 filter=lfs diff=lfs merge=lfs -text
*.[fF][bB][xX] filter=lfs diff=lfs merge=lfs -text
*.[oO][bB][jJ] filter=lfs diff=lfs merge=lfs -text
*.[mM][aA][xX] filter=lfs diff=lfs merge=lfs -text
*.[bB][lL][eE][nN][dD] filter=lfs diff=lfs merge=lfs -text
*.[dD][aA][eE] filter=lfs diff=lfs merge=lfs -text
*.[mM][bB] filter=lfs diff=lfs merge=lfs -text
*.[mM][aA] filter=lfs diff=lfs merge=lfs -text
*.3[dD][sS] filter=lfs diff=lfs merge=lfs -text
*.[dD][fF][xX] filter=lfs diff=lfs merge=lfs -text
*.[cC]4[dD] filter=lfs diff=lfs merge=lfs -text
*.[lL][wW][oO] filter=lfs diff=lfs merge=lfs -text
*.[lL][wW][oO]2 filter=lfs diff=lfs merge=lfs -text
*.[aA][bB][cC] filter=lfs diff=lfs merge=lfs -text
*.3[dD][mM] filter=lfs diff=lfs merge=lfs -text
*.[dD][lL][lL] filter=lfs diff=lfs merge=lfs -text
*.[pP][dD][bB] filter=lfs diff=lfs merge=lfs -text
*.[mM][dD][bB] filter=lfs diff=lfs merge=lfs -text
*.[zZ][iI][pP] filter=lfs diff=lfs merge=lfs -text
*.7[zZ] filter=lfs diff=lfs merge=lfs -text
*.[gG][zZ] filter=lfs diff=lfs merge=lfs -text
*.[rR][aA][rR] filter=lfs diff=lfs merge=lfs -text
*.[tT][aA][rR] filter=lfs diff=lfs merge=lfs -text

13
Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md

@ -4,11 +4,18 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [3.3.1] - 2023-06-02
## [3.4.0] - 2023-12-11
### Added
- Added WebGPU support
### Fixed ### Fixed
- Fixed obsolete FormatUsage bug
- Disabled compute based effects not supported on WebGL and Android OpenGL
- Fixed obsolete FormatUsage error
- Fixed non-scalar logical operation error
- Fixed MSVO to support platforms with limited storage texture support
- Fixed compute based effects not supported on WebGL and Android OpenGL (IN-2999)
- Fixed grid gizmo is visible through geometry when Post Process Layer is enabled (IN-10318)
- Fixed transparent objects rendering incorrectly when TAA is disabled (IN-31494)
## [3.3.0] - 2023-05-11 ## [3.3.0] - 2023-05-11

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs

@ -49,10 +49,14 @@ namespace UnityEditor.Rendering.PostProcessing
} }
else if (aoMode == (int)AmbientOcclusionMode.MultiScaleVolumetricObscurance) else if (aoMode == (int)AmbientOcclusionMode.MultiScaleVolumetricObscurance)
{ {
if (!SystemInfo.supportsComputeShaders || EditorUtilities.isTargetingWebGL)
if (!SystemInfo.supportsComputeShaders)
{ {
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support which is not available on this platform.", MessageType.Error); EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support which is not available on this platform.", MessageType.Error);
} }
else if (EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
}
else if(EditorUtilities.isTargetingAndroid) else if(EditorUtilities.isTargetingAndroid)
{ {
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (Vulkan) when running on Android.", MessageType.Warning); EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AutoExposureEditor.cs

@ -31,10 +31,14 @@ namespace UnityEditor.Rendering.PostProcessing
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
if (!SystemInfo.supportsComputeShaders || EditorUtilities.isTargetingWebGL)
if (!SystemInfo.supportsComputeShaders)
{ {
EditorGUILayout.HelpBox("Auto exposure requires compute shader support which is not available on this platform.", MessageType.Error); EditorGUILayout.HelpBox("Auto exposure requires compute shader support which is not available on this platform.", MessageType.Error);
} }
else if (EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
}
else if (EditorUtilities.isTargetingAndroid) else if (EditorUtilities.isTargetingAndroid)
{ {
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (Vulkan) when running on Android.", MessageType.Warning); EditorGUILayout.HelpBox("Auto exposure requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs

@ -196,7 +196,7 @@ namespace UnityEngine.Rendering.PostProcessing
state &= SystemInfo.supportsComputeShaders state &= SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL && !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
&& !RuntimeUtilities.isWebNonWebGPU
#if UNITY_2023_2_OR_NEWER #if UNITY_2023_2_OR_NEWER
&& SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render) && SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render)
&& SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.Render) && SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.Render)

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AutoExposure.cs

@ -85,7 +85,7 @@ namespace UnityEngine.Rendering.PostProcessing
return enabled.value return enabled.value
&& SystemInfo.supportsComputeShaders && SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL && !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
&& !RuntimeUtilities.isWebNonWebGPU
&& RenderTextureFormat.RFloat.IsSupported() && RenderTextureFormat.RFloat.IsSupported()
&& context.resources.computeShaders.autoExposure && context.resources.computeShaders.autoExposure
&& context.resources.computeShaders.exposureHistogram; && context.resources.computeShaders.exposureHistogram;

99
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs

@ -1,4 +1,5 @@
using System; using System;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Rendering.PostProcessing namespace UnityEngine.Rendering.PostProcessing
{ {
@ -53,6 +54,10 @@ namespace UnityEngine.Rendering.PostProcessing
// command buffer warning // command buffer warning
RenderTexture m_AmbientOnlyAO; RenderTexture m_AmbientOnlyAO;
RenderTextureFormat m_R8Format;
RenderTextureFormat m_R16Format;
bool float4Texture = false;
readonly RenderTargetIdentifier[] m_MRT = readonly RenderTargetIdentifier[] m_MRT =
{ {
BuiltinRenderTextureType.GBuffer0, // Albedo, Occ BuiltinRenderTextureType.GBuffer0, // Albedo, Occ
@ -62,6 +67,46 @@ namespace UnityEngine.Rendering.PostProcessing
public MultiScaleVO(AmbientOcclusion settings) public MultiScaleVO(AmbientOcclusion settings)
{ {
m_Settings = settings; m_Settings = settings;
// R16 is not supported on all platforms as a storage texture format
// R8 is not supported on all platforms as a storage texture format
m_R8Format = RenderTextureFormat.R8;
m_R16Format = RenderTextureFormat.RHalf;
#if UNITY_2023_2_OR_NEWER
if (!SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(m_R8Format, false), GraphicsFormatUsage.LoadStore))
{
if (SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.ARGB32, false), GraphicsFormatUsage.LoadStore))
{
m_R8Format = RenderTextureFormat.ARGB32;
float4Texture = true;
}
}
if (!SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(m_R16Format, false), GraphicsFormatUsage.LoadStore))
{
if (SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.RFloat, false), GraphicsFormatUsage.LoadStore))
{
m_R16Format = RenderTextureFormat.RFloat;
}
}
#else
if (!SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(m_R8Format, false), FormatUsage.LoadStore))
{
if (SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.ARGB32, false), FormatUsage.LoadStore))
{
m_R8Format = RenderTextureFormat.ARGB32;
float4Texture = true;
}
}
if (!SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(m_R16Format, false), FormatUsage.LoadStore))
{
if (SystemInfo.IsFormatSupported(GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.RFloat, false), FormatUsage.LoadStore))
{
m_R16Format = RenderTextureFormat.RFloat;
}
}
#endif
} }
public DepthTextureMode GetCameraFlags() public DepthTextureMode GetCameraFlags()
@ -237,26 +282,26 @@ namespace UnityEngine.Rendering.PostProcessing
} }
else else
{ {
Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.LinearDepth, MipLevel.Original, m_R16Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); Alloc(cmd, ShaderIDs.LowDepth1, MipLevel.L1, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); Alloc(cmd, ShaderIDs.LowDepth2, MipLevel.L2, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); Alloc(cmd, ShaderIDs.LowDepth3, MipLevel.L3, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled); Alloc(cmd, ShaderIDs.LowDepth4, MipLevel.L4, RenderTextureFormat.RFloat, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, RenderTextureFormat.RHalf, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth1, MipLevel.L3, m_R16Format, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth2, MipLevel.L4, m_R16Format, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth3, MipLevel.L5, m_R16Format, true, dynamicResolutionEnabled);
AllocArray(cmd, ShaderIDs.TiledDepth4, MipLevel.L6, m_R16Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion1, MipLevel.L1, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion2, MipLevel.L2, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion3, MipLevel.L3, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Occlusion4, MipLevel.L4, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, RenderTextureFormat.R8, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined1, MipLevel.L1, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined2, MipLevel.L2, m_R8Format, true, dynamicResolutionEnabled);
Alloc(cmd, ShaderIDs.Combined3, MipLevel.L3, m_R8Format, true, dynamicResolutionEnabled);
} }
} }
@ -292,12 +337,11 @@ namespace UnityEngine.Rendering.PostProcessing
cmd.SetComputeTextureParam(cs, kernel, "LinearZ", ShaderIDs.LinearDepth); cmd.SetComputeTextureParam(cs, kernel, "LinearZ", ShaderIDs.LinearDepth);
cmd.SetComputeTextureParam(cs, kernel, "DS2x", ShaderIDs.LowDepth1); cmd.SetComputeTextureParam(cs, kernel, "DS2x", ShaderIDs.LowDepth1);
cmd.SetComputeTextureParam(cs, kernel, "DS4x", ShaderIDs.LowDepth2);
cmd.SetComputeTextureParam(cs, kernel, "DS2xAtlas", ShaderIDs.TiledDepth1); cmd.SetComputeTextureParam(cs, kernel, "DS2xAtlas", ShaderIDs.TiledDepth1);
cmd.SetComputeTextureParam(cs, kernel, "DS4xAtlas", ShaderIDs.TiledDepth2);
cmd.SetComputeVectorParam(cs, "ZBufferParams", CalculateZBufferParams(camera)); cmd.SetComputeVectorParam(cs, "ZBufferParams", CalculateZBufferParams(camera));
cmd.SetComputeTextureParam(cs, kernel, "Depth", depthMapId); cmd.SetComputeTextureParam(cs, kernel, "Depth", depthMapId);
cmd.SetComputeTextureParam(cs, kernel, "DS4x", ShaderIDs.LowDepth2);
cmd.SetComputeTextureParam(cs, kernel, "DS4xAtlas", ShaderIDs.TiledDepth2);
cmd.DispatchCompute(cs, kernel, m_ScaledWidths[(int)MipLevel.L4], m_ScaledHeights[(int)MipLevel.L4], 1); cmd.DispatchCompute(cs, kernel, m_ScaledWidths[(int)MipLevel.L4], m_ScaledHeights[(int)MipLevel.L4], 1);
if (needDepthMapRelease) if (needDepthMapRelease)
@ -384,7 +428,9 @@ namespace UnityEngine.Rendering.PostProcessing
// Set the arguments for the render kernel. // Set the arguments for the render kernel.
var cs = m_Resources.computeShaders.multiScaleAORender; var cs = m_Resources.computeShaders.multiScaleAORender;
int kernel = isMSAA ? cs.FindKernel("MultiScaleVORender_MSAA_interleaved") : cs.FindKernel("MultiScaleVORender_interleaved");
string kernelName = isMSAA ? "MultiScaleVORender_MSAA_interleaved" : "MultiScaleVORender_interleaved";
if (float4Texture) kernelName += "_Float4";
int kernel = cs.FindKernel(kernelName);
cmd.SetComputeFloatParams(cs, "gInvThicknessTable", m_InvThicknessTable); cmd.SetComputeFloatParams(cs, "gInvThicknessTable", m_InvThicknessTable);
cmd.SetComputeFloatParams(cs, "gSampleWeightTable", m_SampleWeightTable); cmd.SetComputeFloatParams(cs, "gSampleWeightTable", m_SampleWeightTable);
@ -411,17 +457,27 @@ namespace UnityEngine.Rendering.PostProcessing
int kernel = 0; int kernel = 0;
if (!isMSAA) if (!isMSAA)
{ {
kernel = cs.FindKernel(highResAO == null ? invert
string kernelName = highResAO == null ? invert
? "MultiScaleVOUpSample_invert" ? "MultiScaleVOUpSample_invert"
: "MultiScaleVOUpSample" : "MultiScaleVOUpSample"
: "MultiScaleVOUpSample_blendout");
: "MultiScaleVOUpSample_blendout";
if (float4Texture)
{
kernelName += "_Float4";
}
kernel = cs.FindKernel(kernelName);
} }
else else
{ {
kernel = cs.FindKernel(highResAO == null ? invert
string kernelName = highResAO == null ? invert
? "MultiScaleVOUpSample_MSAA_invert" ? "MultiScaleVOUpSample_MSAA_invert"
: "MultiScaleVOUpSample_MSAA" : "MultiScaleVOUpSample_MSAA"
: "MultiScaleVOUpSample_MSAA_blendout");
: "MultiScaleVOUpSample_MSAA_blendout";
if (float4Texture)
{
kernelName += "_Float4";
}
kernel = cs.FindKernel(kernelName);
} }
@ -491,8 +547,7 @@ namespace UnityEngine.Rendering.PostProcessing
if (AOUpdateNeeded) if (AOUpdateNeeded)
{ {
RuntimeUtilities.Destroy(m_AmbientOnlyAO); RuntimeUtilities.Destroy(m_AmbientOnlyAO);
m_AmbientOnlyAO = new RenderTexture(context.width, context.height, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear)
m_AmbientOnlyAO = new RenderTexture(context.width, context.height, 0, m_R8Format, RenderTextureReadWrite.Linear)
{ {
hideFlags = HideFlags.DontSave, hideFlags = HideFlags.DontSave,
filterMode = FilterMode.Point, filterMode = FilterMode.Point,

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Monitors/Monitor.cs

@ -48,7 +48,7 @@ namespace UnityEngine.Rendering.PostProcessing
return requested return requested
&& SystemInfo.supportsComputeShaders && SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL && !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
&& !RuntimeUtilities.isWebNonWebGPU
&& ShaderResourcesAvailable(context); && ShaderResourcesAvailable(context);
} }

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

@ -265,7 +265,9 @@ namespace UnityEngine.Rendering.PostProcessing
#if UNITY_2019_1_OR_NEWER #if UNITY_2019_1_OR_NEWER
// We always use a CommandBuffer to blit to the final render target // We always use a CommandBuffer to blit to the final render target
// OnRenderImage is used only to avoid the automatic blit from the RenderTexture of Camera.forceIntoRenderTexture to the actual target // OnRenderImage is used only to avoid the automatic blit from the RenderTexture of Camera.forceIntoRenderTexture to the actual target
#if !UNITY_EDITOR
[ImageEffectUsesCommandBuffer] [ImageEffectUsesCommandBuffer]
#endif
void OnRenderImage(RenderTexture src, RenderTexture dst) void OnRenderImage(RenderTexture src, RenderTexture dst)
{ {
if (finalBlitToCameraTarget && !m_CurrentContext.stereoActive && DynamicResolutionAllowsFinalBlitToCameraTarget()) if (finalBlitToCameraTarget && !m_CurrentContext.stereoActive && DynamicResolutionAllowsFinalBlitToCameraTarget())
@ -472,6 +474,10 @@ namespace UnityEngine.Rendering.PostProcessing
#endif #endif
} }
} }
else
{
m_Camera.nonJitteredProjectionMatrix = m_Camera.projectionMatrix;
}
#if (ENABLE_VR_MODULE && ENABLE_VR) #if (ENABLE_VR_MODULE && ENABLE_VR)
if (m_Camera.stereoEnabled) if (m_Camera.stereoEnabled)

22
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs

@ -862,14 +862,28 @@ namespace UnityEngine.Rendering.PostProcessing
/// Returns <c>true</c> if the target platform is WebGL, /// Returns <c>true</c> if the target platform is WebGL,
/// <c>false</c> otherwise. /// <c>false</c> otherwise.
/// </summary> /// </summary>
public static bool isWebGL
public static bool isWebNonWebGPU
{ {
get {
#if UNITY_WEBGL
get
{
#if UNITY_EDITOR
#if UNITY_WEBGL
#if UNITY_2023_2_OR_NEWER
return PlayerSettings.GetGraphicsAPIs(BuildTarget.WebGL).First() != GraphicsDeviceType.WebGPU;
#else
return true; return true;
#else
#endif
#else
return false; return false;
#endif
#else
return Application.platform == RuntimePlatform.WebGLPlayer
#if UNITY_2023_2_OR_NEWER
&& SystemInfo.graphicsDeviceType != GraphicsDeviceType.WebGPU
#endif
;
#endif #endif
} }
} }

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/ACES.hlsl

@ -220,7 +220,9 @@ half3 ACES_to_ACEScc(half3 x)
x = clamp(x, 0.0, HALF_MAX); x = clamp(x, 0.0, HALF_MAX);
// x is clamped to [0, HALF_MAX], skip the <= 0 check // x is clamped to [0, HALF_MAX], skip the <= 0 check
return (x < 0.00003051757) ? (log2(0.00001525878 + x * 0.5) + 9.72) / 17.52 : (log2(x) + 9.72) / 17.52;
return half3((x.x < 0.00003051757) ? (log2(0.00001525878 + x.x * 0.5) + 9.72) / 17.52 : (log2(x.x) + 9.72) / 17.52,
(x.y < 0.00003051757) ? (log2(0.00001525878 + x.y * 0.5) + 9.72) / 17.52 : (log2(x.y) + 9.72) / 17.52,
(x.z < 0.00003051757) ? (log2(0.00001525878 + x.z * 0.5) + 9.72) / 17.52 : (log2(x.z) + 9.72) / 17.52);
/* /*
return half3( return half3(
@ -678,7 +680,9 @@ half roll_white_fwd(
half3 linear_to_sRGB(half3 x) half3 linear_to_sRGB(half3 x)
{ {
return (x <= 0.0031308 ? (x * 12.9232102) : 1.055 * pow(x, 1.0 / 2.4) - 0.055);
return half3(x.x <= 0.0031308 ? (x.x * 12.9232102) : 1.055 * pow(x.x, 1.0 / 2.4) - 0.055,
x.y <= 0.0031308 ? (x.y * 12.9232102) : 1.055 * pow(x.y, 1.0 / 2.4) - 0.055,
x.z <= 0.0031308 ? (x.z * 12.9232102) : 1.055 * pow(x.z, 1.0 / 2.4) - 0.055);
} }
half3 linear_to_bt1886(half3 x, half gamma, half Lw, half Lb) half3 linear_to_bt1886(half3 x, half gamma, half Lw, half Lb)

52
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/API/WebGPU.hlsl

@ -0,0 +1,52 @@
#define UNITY_UV_STARTS_AT_TOP 1
#define UNITY_REVERSED_Z 1
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName
#define TEXTURE2D(textureName) Texture2D textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define TEXTURE3D(textureName) Texture3D textureName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURE3D_ARGS(textureName, samplerName) Texture3D textureName, SamplerState samplerName
#define TEXTURE3D_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define LOAD_TEXTURE2D(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, lod))
#define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2)
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r
#define UNITY_BRANCH [branch]
#define UNITY_FLATTEN [flatten]
#define UNITY_UNROLL [unroll]
#define UNITY_LOOP [loop]
#define UNITY_FASTOPT [fastopt]
#define CBUFFER_START(name) cbuffer name {
#define CBUFFER_END };
#if UNITY_GATHER_SUPPORTED
#define FXAA_HLSL_5 1
#define SMAA_HLSL_4_1 1
#else
#define FXAA_HLSL_4 1
#define SMAA_HLSL_4 1
#endif

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/API/WebGPU.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9597bf0cd70376447ace14a366b40fe8
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/FinalPass.shader

@ -99,7 +99,7 @@ Shader "Hidden/PostProcessing/FinalPass"
Pass Pass
{ {
HLSLPROGRAM HLSLPROGRAM
#pragma exclude_renderers gles vulkan switch
#pragma exclude_renderers gles vulkan webgpu switch
#pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET #pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET
#pragma target 5.0 #pragma target 5.0
@ -115,7 +115,7 @@ Shader "Hidden/PostProcessing/FinalPass"
Pass Pass
{ {
HLSLPROGRAM HLSLPROGRAM
#pragma exclude_renderers gles vulkan switch
#pragma exclude_renderers gles vulkan webgpu switch
#pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET #pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET
#pragma target 3.0 #pragma target 3.0
@ -147,7 +147,7 @@ Shader "Hidden/PostProcessing/FinalPass"
Pass Pass
{ {
HLSLPROGRAM HLSLPROGRAM
#pragma only_renderers gles vulkan switch
#pragma only_renderers gles vulkan webgpu switch
#pragma multi_compile __ STEREO_DOUBLEWIDE_TARGET //not supporting STEREO_INSTANCING_ENABLED #pragma multi_compile __ STEREO_DOUBLEWIDE_TARGET //not supporting STEREO_INSTANCING_ENABLED
ENDHLSL ENDHLSL

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVODownsample1.compute

@ -29,11 +29,11 @@
#ifdef MSAA #ifdef MSAA
// Output textures // Output textures
RWTexture2D<float2> DS4x;
RWTexture2DArray<float2> DS4xAtlas;
RWTexture2D<float2> LinearZ; RWTexture2D<float2> LinearZ;
RWTexture2D<float2> DS2x; RWTexture2D<float2> DS2x;
RWTexture2DArray<float2> DS2xAtlas; RWTexture2DArray<float2> DS2xAtlas;
RWTexture2D<float2> DS4x;
RWTexture2DArray<float2> DS4xAtlas;
// Input textures // Input textures
Texture2D<float4> Depth; Texture2D<float4> Depth;
@ -42,11 +42,11 @@ Texture2D<float4> Depth;
groupshared float2 g_CacheW[256]; groupshared float2 g_CacheW[256];
#else #else
// Output textures // Output textures
RWTexture2D<float> DS4x;
RWTexture2DArray<float> DS4xAtlas;
RWTexture2D<float> LinearZ; RWTexture2D<float> LinearZ;
RWTexture2D<float> DS2x; RWTexture2D<float> DS2x;
RWTexture2DArray<float> DS2xAtlas; RWTexture2DArray<float> DS2xAtlas;
RWTexture2D<float> DS4x;
RWTexture2DArray<float> DS4xAtlas;
// Input textures // Input textures
Texture2D<float> Depth; Texture2D<float> Depth;
@ -122,7 +122,6 @@ void main(uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Group
uint slice = ((st.x & 3) | (st.y << 2)) & 15; uint slice = ((st.x & 3) | (st.y << 2)) & 15;
DS2x[st] = w1; DS2x[st] = w1;
DS2xAtlas[uint3(st >> 2, slice)] = w1; DS2xAtlas[uint3(st >> 2, slice)] = w1;
if ((GI & 011) == 0) if ((GI & 011) == 0)
{ {
st = DTid.xy >> 1; st = DTid.xy >> 1;
@ -130,7 +129,6 @@ void main(uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Group
DS4x[st] = w1; DS4x[st] = w1;
DS4xAtlas[uint3(st >> 2, slice)] = w1; DS4xAtlas[uint3(st >> 2, slice)] = w1;
} }
} }
#endif #endif

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVORender.compute

@ -27,6 +27,12 @@
#pragma kernel MultiScaleVORender_MSAA MAIN=MultiScaleVORender_MSAA MSAA #pragma kernel MultiScaleVORender_MSAA MAIN=MultiScaleVORender_MSAA MSAA
#pragma kernel MultiScaleVORender_MSAA_interleaved MAIN=MultiScaleVORender_MSAA_interleaved MSAA INTERLEAVE_RESULT #pragma kernel MultiScaleVORender_MSAA_interleaved MAIN=MultiScaleVORender_MSAA_interleaved MSAA INTERLEAVE_RESULT
#pragma kernel MultiScaleVORender_Float4 MAIN=MultiScaleVORender_Float4 FLOAT4
#pragma kernel MultiScaleVORender_interleaved_Float4 MAIN=MultiScaleVORender_interleaved_Float4 INTERLEAVE_RESULT FLOAT4
#pragma kernel MultiScaleVORender_MSAA_Float4 MAIN=MultiScaleVORender_MSAA_Float4 MSAA FLOAT4
#pragma kernel MultiScaleVORender_MSAA_interleaved_Float4 MAIN=MultiScaleVORender_MSAA_interleaved_Float4 MSAA INTERLEAVE_RESULT FLOAT4
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl" #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
#ifndef INTERLEAVE_RESULT #ifndef INTERLEAVE_RESULT
@ -68,7 +74,11 @@
#endif #endif
// Output texture // Output texture
#ifdef FLOAT4
RWTexture2D<unorm float4> Occlusion;
#else
RWTexture2D<float> Occlusion; RWTexture2D<float> Occlusion;
#endif
// Shared memory // Shared memory
groupshared float DepthSamples[TILE_DIM * TILE_DIM]; groupshared float DepthSamples[TILE_DIM * TILE_DIM];

59
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/MultiScaleVOUpsample.compute

@ -34,6 +34,19 @@
#pragma kernel MultiScaleVOUpSample_MSAA_blendout MAIN=MultiScaleVOUpSample_MSAA_blendout MSAA BLEND_WITH_HIGHER_RESOLUTION #pragma kernel MultiScaleVOUpSample_MSAA_blendout MAIN=MultiScaleVOUpSample_MSAA_blendout MSAA BLEND_WITH_HIGHER_RESOLUTION
#pragma kernel MultiScaleVOUpSample_MSAA_premin_blendout MAIN=MultiScaleVOUpSample_MSAA_premin_blendout MSAA COMBINE_LOWER_RESOLUTIONS BLEND_WITH_HIGHER_RESOLUTION #pragma kernel MultiScaleVOUpSample_MSAA_premin_blendout MAIN=MultiScaleVOUpSample_MSAA_premin_blendout MSAA COMBINE_LOWER_RESOLUTIONS BLEND_WITH_HIGHER_RESOLUTION
#pragma kernel MultiScaleVOUpSample_Float4 MAIN=MultiScaleVOUpSample_Float4 FLOAT4
#pragma kernel MultiScaleVOUpSample_invert_Float4 MAIN=MultiScaleVOUpSample_invert_Float4 INVERT FLOAT4
#pragma kernel MultiScaleVOUpSample_premin_Float4 MAIN=MultiScaleVOUpSample_premin_Float4 COMBINE_LOWER_RESOLUTIONS FLOAT4
#pragma kernel MultiScaleVOUpSample_blendout_Float4 MAIN=MultiScaleVOUpSample_blendout_Float4 BLEND_WITH_HIGHER_RESOLUTION FLOAT4
#pragma kernel MultiScaleVOUpSample_premin_blendout_Float4 MAIN=MultiScaleVOUpSample_premin_blendout_Float4 COMBINE_LOWER_RESOLUTIONS BLEND_WITH_HIGHER_RESOLUTION FLOAT4
#pragma kernel MultiScaleVOUpSample_MSAA_Float4 MAIN=MultiScaleVOUpSample_MSAA_Float4 FLOAT4
#pragma kernel MultiScaleVOUpSample_MSAA_invert_Float4 MAIN=MultiScaleVOUpSample_MSAA_invert_Float4 MSAA INVERT FLOAT4
#pragma kernel MultiScaleVOUpSample_MSAA_premin_Float4 MAIN=MultiScaleVOUpSample_MSAA_premin_Float4 MSAA COMBINE_LOWER_RESOLUTIONS FLOAT4
#pragma kernel MultiScaleVOUpSample_MSAA_blendout_Float4 MAIN=MultiScaleVOUpSample_MSAA_blendout_Float4 MSAA BLEND_WITH_HIGHER_RESOLUTION FLOAT4
#pragma kernel MultiScaleVOUpSample_MSAA_premin_blendout_Float4 MAIN=MultiScaleVOUpSample_MSAA_premin_blendout_Float4 MSAA COMBINE_LOWER_RESOLUTIONS BLEND_WITH_HIGHER_RESOLUTION FLOAT4
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl" #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
@ -67,7 +80,11 @@
#endif #endif
// Ouput textures // Ouput textures
#ifdef FLOAT4
RWTexture2D<unorm float4> AoResult;
#else
RWTexture2D<float> AoResult; RWTexture2D<float> AoResult;
#endif
// Shared memory // Shared memory
groupshared float DepthCache[256]; groupshared float DepthCache[256];
@ -416,15 +433,41 @@ void MAIN(uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Group
int2 OutST = DTid.xy << 1; int2 OutST = DTid.xy << 1;
#ifdef INVERT #ifdef INVERT
AoResult[OutST + int2(-1, 0)] = 1.0 - BilateralUpsample(HiDepths.x, HiSSAOs.x, LoDepths.xyzw, LoSSAOs.xyzw);
AoResult[OutST + int2( 0, 0)] = 1.0 - BilateralUpsample(HiDepths.y, HiSSAOs.y, LoDepths.yzwx, LoSSAOs.yzwx);
AoResult[OutST + int2( 0, -1)] = 1.0 - BilateralUpsample(HiDepths.z, HiSSAOs.z, LoDepths.zwxy, LoSSAOs.zwxy);
AoResult[OutST + int2(-1, -1)] = 1.0 - BilateralUpsample(HiDepths.w, HiSSAOs.w, LoDepths.wxyz, LoSSAOs.wxyz);
float x = 1.0 - BilateralUpsample(HiDepths.x, HiSSAOs.x, LoDepths.xyzw, LoSSAOs.xyzw);
float y = 1.0 - BilateralUpsample(HiDepths.y, HiSSAOs.y, LoDepths.yzwx, LoSSAOs.yzwx);
float z = 1.0 - BilateralUpsample(HiDepths.z, HiSSAOs.z, LoDepths.zwxy, LoSSAOs.zwxy);
float w = 1.0 - BilateralUpsample(HiDepths.w, HiSSAOs.w, LoDepths.wxyz, LoSSAOs.wxyz);
#ifdef FLOAT4
AoResult[OutST + int2(-1, 0)] = float4(x, x, x, x);
AoResult[OutST + int2(0, 0)] = float4(y, y, y, y);
AoResult[OutST + int2(0, -1)] = float4(z, z, z, z);
AoResult[OutST + int2(-1, -1)] = float4(w, w, w, w);
#else #else
AoResult[OutST + int2(-1, 0)] = BilateralUpsample(HiDepths.x, HiSSAOs.x, LoDepths.xyzw, LoSSAOs.xyzw);
AoResult[OutST + int2( 0, 0)] = BilateralUpsample(HiDepths.y, HiSSAOs.y, LoDepths.yzwx, LoSSAOs.yzwx);
AoResult[OutST + int2( 0, -1)] = BilateralUpsample(HiDepths.z, HiSSAOs.z, LoDepths.zwxy, LoSSAOs.zwxy);
AoResult[OutST + int2(-1, -1)] = BilateralUpsample(HiDepths.w, HiSSAOs.w, LoDepths.wxyz, LoSSAOs.wxyz);
AoResult[OutST + int2(-1, 0)] = x;
AoResult[OutST + int2(0, 0)] = y;
AoResult[OutST + int2(0, -1)] = z;
AoResult[OutST + int2(-1, -1)] = w;
#endif
#else
float x = BilateralUpsample(HiDepths.x, HiSSAOs.x, LoDepths.xyzw, LoSSAOs.xyzw);
float y = BilateralUpsample(HiDepths.y, HiSSAOs.y, LoDepths.yzwx, LoSSAOs.yzwx);
float z = BilateralUpsample(HiDepths.z, HiSSAOs.z, LoDepths.zwxy, LoSSAOs.zwxy);
float w = BilateralUpsample(HiDepths.w, HiSSAOs.w, LoDepths.wxyz, LoSSAOs.wxyz);
#ifdef FLOAT4
AoResult[OutST + int2(-1, 0)] = float4(x, x, x, x);
AoResult[OutST + int2(0, 0)] = float4(y, y, y, y);
AoResult[OutST + int2(0, -1)] = float4(z, z, z, z);
AoResult[OutST + int2(-1, -1)] = float4(w, w, w, w);
#else
AoResult[OutST + int2(-1, 0)] = x;
AoResult[OutST + int2(0, 0)] = y;
AoResult[OutST + int2(0, -1)] = z;
AoResult[OutST + int2(-1, -1)] = w;
#endif
#endif #endif
#endif #endif
} }

4
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/Uber.shader

@ -275,7 +275,7 @@ Shader "Hidden/PostProcessing/Uber"
Pass Pass
{ {
HLSLPROGRAM HLSLPROGRAM
#pragma exclude_renderers gles vulkan switch
#pragma exclude_renderers gles vulkan webgpu switch
#pragma multi_compile __ COLOR_GRADING_LDR_2D COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D #pragma multi_compile __ COLOR_GRADING_LDR_2D COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D
#pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET #pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET
@ -290,7 +290,7 @@ Shader "Hidden/PostProcessing/Uber"
Pass Pass
{ {
HLSLPROGRAM HLSLPROGRAM
#pragma only_renderers vulkan switch
#pragma only_renderers vulkan webgpu switch
#pragma multi_compile __ COLOR_GRADING_LDR_2D COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D #pragma multi_compile __ COLOR_GRADING_LDR_2D COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D
#pragma multi_compile __ STEREO_DOUBLEWIDE_TARGET // disabled for Vulkan because of shader compiler issues in older Unity versions: STEREO_INSTANCING_ENABLED #pragma multi_compile __ STEREO_DOUBLEWIDE_TARGET // disabled for Vulkan because of shader compiler issues in older Unity versions: STEREO_INSTANCING_ENABLED

4
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Colors.hlsl

@ -179,7 +179,7 @@ half3 SRGBToLinear(half3 c)
#else #else
half3 linearRGBLo = c / 12.92; half3 linearRGBLo = c / 12.92;
half3 linearRGBHi = PositivePow((c + 0.055) / 1.055, half3(2.4, 2.4, 2.4)); half3 linearRGBHi = PositivePow((c + 0.055) / 1.055, half3(2.4, 2.4, 2.4));
half3 linearRGB = (c <= 0.04045) ? linearRGBLo : linearRGBHi;
half3 linearRGB = half3((c.x <= 0.04045) ? linearRGBLo.x : linearRGBHi.x, (c.y <= 0.04045) ? linearRGBLo.y : linearRGBHi.y, (c.z <= 0.04045) ? linearRGBLo.z : linearRGBHi.z);
return linearRGB; return linearRGB;
#endif #endif
} }
@ -212,7 +212,7 @@ half3 LinearToSRGB(half3 c)
#else #else
half3 sRGBLo = c * 12.92; half3 sRGBLo = c * 12.92;
half3 sRGBHi = (PositivePow(c, half3(1.0 / 2.4, 1.0 / 2.4, 1.0 / 2.4)) * 1.055) - 0.055; half3 sRGBHi = (PositivePow(c, half3(1.0 / 2.4, 1.0 / 2.4, 1.0 / 2.4)) * 1.055) - 0.055;
half3 sRGB = (c <= 0.0031308) ? sRGBLo : sRGBHi;
half3 sRGB = half3((c.x <= 0.0031308) ? sRGBLo.x : sRGBHi.x, (c.y <= 0.0031308) ? sRGBLo.y : sRGBHi.y, (c.z <= 0.0031308) ? sRGBLo.z : sRGBHi.z);
return sRGB; return sRGB;
#endif #endif
} }

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/StdLib.hlsl

@ -27,6 +27,8 @@
#include "API/Metal.hlsl" #include "API/Metal.hlsl"
#elif defined(SHADER_API_PSP2) #elif defined(SHADER_API_PSP2)
#include "API/PSP2.hlsl" #include "API/PSP2.hlsl"
#elif defined(SHADER_API_WEBGPU)
#include "API/WebGPU.hlsl"
#else #else
#include "API/OpenGL.hlsl" #include "API/OpenGL.hlsl"
#endif #endif

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Textures/Cubes/.gitignore

@ -0,0 +1,2 @@
*.asset
*.asset.meta

2
Packages/com.unity.postprocessing@3.2.2/package.json

@ -1,6 +1,6 @@
{ {
"name": "com.unity.postprocessing", "name": "com.unity.postprocessing",
"version": "3.3.1",
"version": "3.4.0",
"displayName": "Post Processing", "displayName": "Post Processing",
"unity": "2019.4", "unity": "2019.4",
"unityRelease": "19f1", "unityRelease": "19f1",

Loading…
Cancel
Save