Hello all,
I’m working on a WebGl project and I really should use screen space reflections.
I know that SSR can work on WebGl (just give a look to Babylon.js documentation, for example).
So, since HDRP is not suitable for WebGl, and URP does not have SSR on its post processing task,
I had to use for my project the built in render
So I’ve downloaded the post process V2, and I’ve applied the “Screen Space Reflection” component to my PostProcessVolume.
Everything work fine in editor, but when I publish for WebGl, I get (in Chrome) many error messages about post process, and particularly I get this message:
Hidden/PostProcessing/ScreenSpaceReflections shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
Is there a way to have SSR working on WebGl with Unity?
Many thanks!
Same question here. Anyone can confirm this?
Looking at the postprocessing package, in
UnityProjectProject\Library\PackageCache\com.unity.postprocessing@3.0.2\PostProcessing\Shaders\Builtins\ScreenSpaceReflections.shader, it starts out with
Shader "Hidden/PostProcessing/ScreenSpaceReflections"
{
// We need to use internal Unity lighting structures and functions for this effect so we have to
// stick to CGPROGRAM instead of HLSLPROGRAM
CGINCLUDE
#include "UnityCG.cginc"
#pragma target 5.0
Here the “target 5.0” line specifies the minimum graphics capabilities that are needed. Referring to Unity - Manual: Targeting shader models and GPU features in HLSL it means:
#pragma target 5.0
- DX11 shader model 5.0.
- Not supported on DX11 before SM5.0, OpenGL before 4.3 (i.e. Mac), OpenGL ES 2.0/3.0/3.1, Metal.
- Supported on DX11+ SM5.0, OpenGL 4.3+, OpenGL ES 3.1+AEP, Vulkan, Metal (without geometry), PS4/XB1 consoles.
So this means that the SSR implementation currently requires one of those platforms, and WebGL 1 and WebGL 2 are not supported
WebGL 1 supports #pragma target 2.0 and 2.5
WebGL 2 supports #pragma target 2.0, 2.5, 3.0 and 3.5
Unfortunately I don’t know why Unity requires Shader Model 5.0. It could be a different algorithm that is employed that leans on some SM5.0 specific features for performance, graphical quality, combinability, or some other reason. I’ve asked around a little bit and see if I can dig up an answer.
3 Likes