Forum Discussion
Anonymous
5 years agoPassthrough and post processing
Good afternoon.
I am in a student research group working on a game/Passthrough showcase, that shows factory building and prototyping in vr.
We have been struggling a lot with getting Passthrough working, over the last 4 months. Now we had an issue again where it would not work at all in underlay mode when post processing was enabled on the camera using a global volume.
Any advice? As we need the post processing for our product.
Unity: 2020.3.22f1 URP
XR plugin managment: 4.2.0
Oculus integrations: 34.0
31 Replies
Replies have been turned off for this discussion
- kyboonHonored Guest
I'm facing the same problem, using same setup(unity version, plugin version, etc). The background is just black if the post-processing on the camera component is turned on. Doesn't matter if there's a global post-processing volume or not.
Currently I'm just turning off the post processing on the camera when using passthrough, but I would really like to have bloom in passthrough environment.
- CelicularHonored Guest
Same here... Would be great to use both in combination.
- SynergizProtege
Same problem, Integration SDK v 54.1. No one's got a solution ?
- TheDaddisStart Partner
I had this problem a while ago, back then it was caused by the post-processing shader not reading the alpha from the framebuffer texture you had generated while rendering your frame. It put an alpha of 1 for every pixel, which means the passthrough texture (at least in Underlay mode) won't blend with the texture output from post-processing.
A hack that worked back then was to go to your UberPost.shader, and on line 238, instead of:
return half4(color, 1.0);
Use the alpha from the source texture, like this:
return half4(color, _SourceTexture.a);
This is mostly from memory, not sure if it still works! Also it will have issues with blending because now you have kind of a 'cutout' where the stuff you've rendered is drawn, you won't get effects in areas where you hadn't rendered anything before the post-processing was done. _Also_, this is a change to the URP package so you'll need to make your own branch of URP, either in your /Packages directory, or by some other cunning hack.
Good luck!
- SynergizProtege
Thank you so much !
I managed to do it, getting the alpha needed a little bit more code but it's the idea. For anyone who runs into the same problem, here's the solution :
- Make a copy of UberPost.shader file into your assets
- Modify line 238 (return half4(color, 1.0);) by :half alpha = SAMPLE_TEXTURE2D_X(_SourceTex, sampler_LinearClamp, uvDistorted).w; return half4(color, alpha);- Create a new PostProcessData asset (or modify a custom one)
- Turn the inspector into debug mode, and set your custom UberPost shader in the corresponding frame
And this should work !
- simdevsExplorer
Can't find '_SourceTex' in the shader.
Tried to use _UserLut & _OverlayUITexture, but the result is transparent. 😓
- tortoise_ysfHonored Guest
Thanks! I have checked the UberPost.shader in the package, and only used by the default PostProcessData.asset which is unable to be deleted. I have changed the post-process data to my custom post-process data which has changed the shader also. But the post-processing still does not work with passthrough.
I am using Unity 2022.3.14 with URP version 14.0.9 and 2022.3.14 Unity- simdevsExplorer
What happens if you edit the actual UberPost.shader in the package and save it - will it work then?
I also deleted all possible Quality settings and left only the one with the custom PostProcessData.asset- tortoise_ysfHonored Guest
The post-processing should work with passthrough with the solution mentioned above!!! Seems other settings are causing the issue!
After I disabled different features of post-processing, I found out the HDR caused the black background. This means I can't use the bloom effect in passthrough mode, while others should be working. This is quiet important to my current project, does anyone have tried before?☹️
- SandstedtStart Partner
This worked for me using Unity 2022.3.19f1 and URP com.unity.render-pipelines.universal@14.0.10:
Copy the com.unity.render-pipelines.universal@14.0.10 folder from \Library\PackageCache to \Packages.
In UberPost.shader, change (on row 287):return half4(color, 1.0);
To:
half alpha = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uvDistorted).w;
return half4(color, alpha);
Adding post-processing tick on only the center camera in a OVR Camera rig. Make sure Universal Render Data file has Post-processing and HDR enabled. Add a global volume with bloom with some good settings. Now all HDR material with enough emission will bloom just fine. Not the most performant solution though. (The classic DOOM Volumetric Bloom trick is more performant)
But are probably better solutions in the thread, so you don't have to copy the entire URP package, but havn't tried 😄
Example: https://x.com/jonassandstedt/status/1765683987408711904?s=20- xalsbassHonored Guest
Thanks! I managed to run your solution, but in my case fail as soon as I active HDR. I checked the _blitTexture and is full 1.0 on every channel if HDR is enabled. Any idea?
- maoshmellowExplorer
Did you ever resolve this?
- guydmiHonored Guest
Hi everyone!
I'm looking as well for this problem to be solved. I have been trying the solutions but I can't find one that matches my use case. Giving some details : I want to do some post-processing effects on the image of the camera I access with passthrough (post processing the reality).Following your advice, I can have some bloom on the virtual objects in the scene, but it does not seem to affect the rest of it (and that's what was really interesting me in the first place). Do anyone have a solution or idea how we can this work? thx a lot !
Unity Version : 2022.3.21
URP: 14.0 - maoshmellowExplorer
Hi SanCity,
Thank you for documenting everything so thoroughly! I followed the same steps and I'm getting the black screen still - do you know if there was anything else you did to get it to work?
- YoirglStart Partner
I'm desperately trying to get some bloom on top of passthrough but unfortunately your solution didn't work for me.
(unity 2022.3.20f1)
Update : I fixed it (bloom on top of pass-through) by going trough all the places where HDR is mentioned and manually set it to explicit OFF. it seems when i set the tick box for post process, it automatically reactivates the HDR for the camera even if the camera's settings is set to follow URP settings and URP settings are HDR off.- maoshmellowExplorer
Hi Yoirgl,
Can you elaborate on "going through all the places where HDR is mentioned and setting it to OFF"?
I thought you needed HDR in order to have bloom so I'm a bit confused on what you did to get it to work.- terragame-devHonored Guest
Hello,
Well, there are certainly some smarter people than me who will correct me if I'm wrong but it is my understanding than in SDR mode you can't get a pixel intensity beyond 1.
So usually bloom is configured to be above 1, in HDR.
In my case, I wanted to use the passthrough and bloom but was forced out of HDR by Meta's incompatibility.
What I did was to configure postprocess's bloom to trigger above the treshold of 0.9 or 0.95.
Therefore all elements lit close to max intensity will emit bloom. It is a bit tricky as it applies not only to emissive but to all materials. It's therefore important to adjudt light and material settings to be sure the bloom doesn't affect items that are not required to emit bloom.
For example, i had to get all my UI text to show in a pale white instead of full white.
It's annoying but it kinda works.
I really hope passthrough will get some HDR compatibility, tho as it's an unnecessary burden.
I just had to make sure hdr was explicitly off on camera, urp settings and all places in the settings i could find.
I hope this helps.
Yoirgl
(Edit:sorry I replied with wrong account)
- gb1982gbExplorer
In Unity I use Meta -> Tools -> Building Blocks -> Passthrougth template. I do not know what is global volume for you, but for me all works with this template.
- ConduitXRProtege
Following this for further testing
- BradleyNewmanProtege
Haven't tried it, but looks like this is possible in Unity 6: https://www.youtube.com/watch?v=G6p8E2GMi-E
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 7 years ago
- 2 years ago
- 3 months ago