#Spout Transparency Output with Post Processing (Bloom) in Unity 2022.3.22f1 and URP 14.0.10

1 messages · Page 1 of 1 (latest)

kindred moat
#

It's possible to get transparency output by modifying the URP UberPost.shader by replacing the line:
return half4(color, 1.0);
with:
half alpha = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uvDistorted).w;
return half4(color, alpha);

Then as long as you have a duplicate camera outputting to a render texture using background color rgba 0,0,0,0 (make sure you turn off the audio listener or you will leak memory), you can use that texture in the spout sender with alpha and OBS will pick it up under premultiplied alpha mode.

earnest reef
#

ur right this is possible and this is what I did initially

#

there were some complications with my exact urp setup

#

and the fact that swapping to the modified shader did not work very well

#

i might use this to switch back to lts if I can get it to play nicely

#

the way you're supposed to get it to work without just modifying the package cache is by modifying the post process data of the urp renderer that you're using

#

but its so janky

kindred moat
#

fair enough, getting the spout output to work on any given day in a project is like 50% chance it just blows up

earnest reef
#

ive actually found the spout outputs to be super reliable for me tbf

#

maybe I got lucky with the settings

kindred moat
#

the correct way of copying the post process data, the shader and shader include files somewhere into assets and then linking the post process data to the fixed shader and then the urp renderer to point to the copy is pretty simple as well, just have to switch to debug property view on the post process data

#

and the spout thing was mostly because I was dumb and made custom render textures instead of regular render texture, and also I had some weird directX texture format errors and stuff, but maybe I'm thinking of the receiver actually with that issue

#

still some weird banding with the bloom output, but idk enough about shaders to fix that

earnest reef
earnest reef
kindred moat
#

The banding in the output in Spout was from using the default texture color format R8G8B8A8 Unsigned-Normalized, swapping to SRGB for both Output and Input fixes quite a lot, but looks like the OBS spout receiver uses UNORM.

#

The other thing that makes it weird is that post processing doesn't change alpha (for good reasons), but it makes fully transparent space difficult to handle sometimes since it now has color without alpha floating around that needs rendered along side normal images with alpha channel.

earnest reef