Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen when rendering with two cameras and depth testing #51

Open
mihakrajnc opened this issue Dec 10, 2021 · 4 comments
Open

Black screen when rendering with two cameras and depth testing #51

mihakrajnc opened this issue Dec 10, 2021 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@mihakrajnc
Copy link

mihakrajnc commented Dec 10, 2021

I'm using URP, and two cameras (in a stack, second one is set to overlay). First camera is the one that has the objects where the outline shuld be drawn. The OutlineFeature is set up with Use Layer Mask and Enable Depth Testing. My Render Pass Event is set to After Rendering.

With this setup, my screen is rendered black. If I disable Enable Depth Testing, it renders fine (including the outline).

If I set the Render Pass Event to After Rendering Pre Passes, it also renders fine, but when the objects move the outline jumps around / looks glitchy.

Any ideas? Not sure if I'm doing something wrong.

Note: I could solve this issue by using two renderers in URP settings, having the second camera on a separate renderer, without the outline feature. But this adds quite a bit of overhead, especially on low end mobile devices, and isn't an option unfortunately :(

@Arvtesh Arvtesh self-assigned this Jan 5, 2022
@Arvtesh Arvtesh added the question Further information is requested label Jan 5, 2022
@Arvtesh
Copy link
Owner

Arvtesh commented Jan 5, 2022

Hey @mihakrajnc. I apologize for the delay with answer. Were you able to resolve the issue? If not, the first thing that comes to mind is something similar to #49. The fix for it is not released yet and visually it looks like you describe. What rendering API do you use (OpenGL/Vulcan etc.)?

@bsoglin
Copy link

bsoglin commented Feb 10, 2023

Hello! I wanted to ask if there was any progress on this fix, as I just ran into this issue today. Exact same situation as described above--I only run into problems when depth testing is enabled for an outline layer and I'm rendering to a camera stack. When that happens I see a black screen (see screenshot, the white shape of a bird in the bottom center of the screen is the object that's supposed to be outlined.)

I'm using Unity 2021.3.2f1, URP 12.1.6. I haven't changed any settings around the rendering API, so I'd assume I'm using the defaults there
image

@Arvtesh
Copy link
Owner

Arvtesh commented Feb 11, 2023

Hey, I am very busy at the office and not sure when I will have time to look into this. So no ETA, sorry for this.

@bsoglin
Copy link

bsoglin commented Feb 11, 2023

Gotcha, no worries! By the way, thank you so much for this tool, it's really wonderful. It's saved me so much time

For anyone else who runs into this problem, I found that it can be worked around: this bug only occurs when you've got the outline effect attached to a camera that is rendering as an overlay. So if you use your outline effect camera as your "base" camera in the stack, this is not an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants