Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
5
Question by gregroberts · Apr 16, 2015 at 05:48 PM · lightingunity5shadowflickeringz-fighting

how to stop real time shadows in Unity5 from blinking flickering and fritzing

We are building a flying simulation with a large multi-kilometer city model. simple shader : standard opaque. simple lighting : single directional light and skybox.

The buildings are exhibiting what looks like z-fighting errors with what appear to be the real-time shadows on them. souped up system, Intel i5 / 16gb ram / Radeon 7990 6gb gpu. Windows 7, DirectX 11.

The screenshots below were taken from a stationery vantage point as the buildings flickered.

does anyone know how to fix this? alt text alt text

20150415-191525.jpg (200.4 kB)
20150415-191531.jpg (173.5 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

4 Replies

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

Answer by gregroberts · Apr 21, 2015 at 03:49 PM

We solved it. We had clipping planes on the camera between 0.1 near and 10000 far. We had this because the flyer sits on the back of a robot and we want them to see both the robot and distant terrain. The terrain + asset set is quite large, about a 10k x 10k swath of land, sea, and buildings.

turns out this extreme focal range messes with most GPUs capabilities.

A simple modification of the camera's near clipping plane from 0.1m to 0.4m completely solved this problem.

Here's where we found the hints: http://forum.unity3d.com/threads/terrain-flickering-really-annoying-please-help.164936/

Comment
Add comment · Show 1 · 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 Cherno · Apr 21, 2015 at 04:04 PM 1
Share

Good question & answer. I have the problem so it's good that you found a solution.

avatar image
8

Answer by mephistonight · Jan 07, 2018 at 02:17 PM

I know this is an old thread but it's high up when searching for this problem so am adding some info that helped me:

Setting the near clipping plane to 0.4m also solved this for me, except that it's not a good solution for me as it allows a first person camera to see through walls, clip the top of arms moving infront of the camera etc.

What worked for me was my changing some settings on my directional light's shadow settings. By increasing the Bias from the default 0.05 to 0.5 I was able to retain the camera's near clipping plane at 0.1 and also prevent the flickering. I think the shadows were effectively shadowing themselves, so it created the flickering. Increasing the bias pushes the shadows away from the source, preventing self shadowing.

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 DenisGLabrecque · Jan 03, 2019 at 04:52 PM 0
Share

This is by far the best answer! I've long have issues with this problem, but they are now solved! Thank you.

avatar image SomeGuy22 · Mar 08, 2020 at 04:25 AM 0
Share

Thanks a ton! Totally forgot about shadow bias, adjusting it to .2 solved my flickering issues on terrain while also letting me use a far clipping plane, perfect!

avatar image
0

Answer by darkhog · Sep 22, 2018 at 01:13 PM

Before you do anything anyone else suggested, try changing the Shadow Projection (Under quality settings, do it for every quality level) from close fit to stable fit. It completely fixed the issue for me, while other suggestions merely decreased the rate at which shadows flicker @gregroberts

Comment
Add comment · Show 1 · 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 Sludgemonster · Dec 01, 2019 at 02:00 PM 0
Share

Using 2019.2.11..."stable fit" appears to already be the default setting. $$anonymous$$ephisTonight's answer with the bias increase definitely decreased the flickering but some still exist.

avatar image
0

Answer by jmarcos007 · Jun 10, 2019 at 04:40 AM

I solve my problem just bringing back my gameobject (player) close to word origin (0,0,0). I'm using a huge map (70 Km x 70 Km). Far away from origin, the problem appear. Using near clipping planes solve the problem too, but only at values bigger than 7 (that is not good for my project).

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

24 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

Related Questions

Huge unknown shadow in scene [android] 1 Answer

Unity 5 Spot Light no shadows or break in the light 2 Answers

More detailed terrain shadow 0 Answers

Blob Shadows - Reversing Shadow Effect? 2 Answers

Dynamic objects lighting and rendering (exterior scene) 3 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