We have a custom render pass for blurring targeted for mobile platforms and has been working great. Now, as we want to target WebGL, this rendering feature is not working in WebGL builds, rendering everything to black. Turning off the render feature in the forward renderer data and playing it in WebGL renders everything properly but without the wanted effect.
Is there something you generally need to avoid when targeting WebGL in custom renderer features or is it a problem with WebGL itself? The blur shader does not go against any of the recommendations for WebGL shaders (i.e dynamic indexing of arrays, etc…).
Thanks for the help, if more information is required in order to orient me to a solution please ask!
I’ve been using custom render features with a post process effect in URP since about 7.6, it should work fine. Is there any useful information in the brower developer console? If it’s coming up black, perhaps your shader is not compiling correctly and it is falling back to a diffuse shader with black _MainTex?
There is no additional info in the console sadly, no warnings or logs. Usually when a shader fails to run in webGL unity throws a log saying which shader will go into fallback
Is your shader added to the always included shaders in the build settings? (I don’t understand why it might work for mobile and not webGL if exclusion at build time was a problem, but worth checking)
At the moment it is added to the always include array. Trying to debug the problem, I’ve also tried building to windows and there works fine as well. Something that is also happening that is quite strange is that disabling post-processing in the editor shows a similar problem, everything rendering with the camera that has the render feature renders black.
Googling more about the problem I’ve found this post in the forum , which seems like a similar issue, but doesn’t solve it
Running it in Opera and Chrome, via uploading to itchio is still the same, presented with black screen even tho everything loads and initializes correctly
It’s possible that the render texture you are using in your post-process shader is using a depth test. Temporary Render Textures have an undefined depth. Ensure that you have ZTest Always enabled in your shader or that you properly clear the temporary render texture before using it.