Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by McMayhem · Oct 15, 2015 at 10:56 AM · uicanvasimage effectshudbloom

Render UI on a Separate Camera without losing Image Effects?

I'm having the worst time trying to figure out how to do this. I currently need Canvas - Screen Space Camera set so that I can apply a bloom effect to my HUD. The problem is, when that mode is set, objects can occlude the UI which is very bad. I cant use overlay, because that doesn't work with the image effects.

I've tried creating a separate camera to render just the UI, setting it to Clear Depth Only and setting it's depth higher than the main camera, but as has been the case since Unity 3, this clears all image effects on the main camera. I can get bloom on the UI camera to work just fine, and it works in the scene from the main camera as well, but SSAO doesn't work because it requires depth information from the main camera, not the UI camera.

Is there any way I can do this? Is there a way to force UI to draw on top of everything while in Screen Space Camera mode? I've been able to sort of achieve this effect with setting the shader to ZTest Always, but then that destroys the ability to do stencil masking, which I need for the circular minimap.

Here is the way I need the UI to look: alt text

uibloom.jpg (75.1 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by McMayhem · Oct 15, 2015 at 04:29 PM

As it turns out, setting ZTest Always is the best approach here. Now the reason I didn't like this approach before is becaus on its own, it ignores masking. This became an issue for my radial minimap. However, I was able to create a solution to this as well by creating a second shader that handles masking of elements, uses ZTest Always to draw over geometry and additionally uses the Render Queue tag to make sure the mask doesn't draw on top of the elements within its hierarchy.

The result is a HUD that can be drawn on the Main Camera using Screen Space Camera Canvas setting.

It's hard to show how this works since the UI now doesn't get occluded with geometry, but here's the final product:

[Can't currently use URL link for image attachments?] http://www.viewpointgames.net/Downloads/uisuccess.jpg

I'm going to use this to answer some questions that other people have had regarding this specific issue. Hopefully it will work for their situations as well!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jjbish · Mar 01, 2017 at 11:54 PM

@McMayhem Thanks for the suggestions.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

40 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Canvas scaling for triple monitor setups (NVIDIA Surround / AMD Eyefinity) 0 Answers

Prevent World Space canvas render mode to overlay other game objects 0 Answers

how do i update specific Canvas Ui text? 1 Answer

Why button changes canvas group alpha value? 0 Answers

How would I Consistantly 'Snap' a UI Element to the Edge of a Camera? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges