Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by tyjkenn · Dec 08, 2020 at 08:00 AM · lightingpost processingambient occlusion

Ambient occlusion stops at certain camera angles/positions

I'm running Unity 2020.1.15f1, using the built-in renderer and the Post-Processing package. When I run the game, both in Play mode and when I build it, the ambient occlusion sometimes stops when I face certain directions/move to certain positions. I noticed that if I add a directional light to the scene, the problem goes away, but since the game takes place underground, I don't want directional lights. As a workaround, right now I have a directional light with an intensity set to 0.001, but I don't understand why the light is needed anyway. Is there something about how the ambient occlusion works that I'm missing?

Here's a video of what I'm talking about. I turned the intensity up to the extreme to make it easier to see. There's also a problem with the actual edges not being darkened, so if you happen to have a solution to that, that would also be great!)

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Namey5 · Dec 08, 2020 at 11:16 AM

My guess is that the depth texture isn't being generated properly (even though it really should be created automatically by the post-process renderer if using effects that rely on it, so maybe you have a script somewhere that is overriding it?). I would try adding a script to your camera, something along the lines of the following;

 private Camera m_Camera;
 
 private void OnPreCull ()
 {
     if (m_Camera == null)
         m_Camera = GetComponent<Camera>();
 
     m_Camera.depthTextureMode |= DepthTextureMode.Depth;
 }
Comment
Add comment · Show 2 · 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 tyjkenn · Dec 08, 2020 at 11:34 AM 0
Share

Thanks for the answer. I tried this out and got no change. I forgot to mention that I do have Next-Gen Soft Shadows installed. That's the only thing I can think of that might be overriding any camera settings, because none of my scripts are. Do you think NGSS could be the culprit? If so, I'll go digging into it when I have more time to see if it is messing with the depth texture mode.

avatar image Namey5 tyjkenn · Dec 08, 2020 at 08:21 PM 0
Share

It's possible, but I wouldn't think so (I've only used NGSS 1 but it never caused any issues). The only way to check what's going on is to use the frame debugger and take a look at what is and isn't being drawn when that happens (pay attention to shadows and the depth buffer, also check that the effect is being drawn at all or just skipped entirely).

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

182 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 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 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 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 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

Adjust Brightness Screen 3 Answers

Post Processing Stack making bloom brighter when light is toggled 1 Answer

New Unity Project "3d With Extras" . Grey fog/mist type effect undesired ... How to remove/alter it? 1 Answer

AO Giving Different Colours to Surfaces 0 Answers

Unity Fog Problem 0 Answers


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