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 /
avatar image
0
Question by U2-84 · Nov 22, 2019 at 12:55 AM · collidersnot workingflickeringlens-flare

Lens flare - wrong behaviour

Hello, as the title says I'm experiencing a weird behaviour with the lens flare component. Basically I have 2 issues: 1 - big colliders (e.g. planets), at a certain distance, stop occluding the flare. 2 - when moving (interpolated rigidbody), the occlusion is not smooth... it looks flickering. The 2 videos below eplain it better. Am I the one experiencing these issues? Any ideas to get them fixed? They're driving me nuts. Thank you in advance. Video: flare and collider issue - Video: flickering flare

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

Answer by VicciGames · Nov 22, 2019 at 03:30 AM

  • would try using a smaller size of units.*


Currently, I am witnessing a x10000 scale than normal. Which is HUGE. I am almost positive the post-processing layer has some sort of unit limitation or distance limitation.


If you scale to 1/1000 to get a size of 100 for the object, your flickering problem should be solved.


You can still work with a smaller scale, just be respectful with your Physics calculations and use FixedUpdate when possible to adhere to FPS scaling.


Let me know if this worked.

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 U2-84 · Nov 23, 2019 at 03:33 PM 0
Share

Scaling works. As I said, I'm still sure it's a wanted (then coded) behaviour, like a distance limit: beyond that limit, lens flare stops getting occluded. I would still like to know how to alter/modify that behaviour.


Regarding the flickering issue, I can confirm it's nothing related to scaling. If the occluding object (in this case, the player's ship) is a rigidbody and its movements are interpolated, when it slowly reaches the "source" of the lens flare (a 1x1 point), the engine doesn't exactly know if it is occluding that point or not (unless it's covering it with a bigger part of its shape). Without interpolation, the occluding object's position is exactly defined so it is definitely occluding (or not) the point source of the lens flare: in this case, the flicker doesn't occour.


I'm surprised nobody spotted this obvious behaviour (or talked about it) before: I don't think I'm the only one using rigidbodies with interpolation + lens flare.

avatar image U2-84 · Nov 27, 2019 at 04:57 PM 0
Share

A little update on the 2nd issue (flickering flare): I finally dropped interpolation and made the un-interpolated rigidbody look smooth by lowering the fixed timestep to 0.01667, so now everything running in FixedUpdate updates 60 times per second. Interpolated movements AND lens flare don't get along.

avatar image
0

Answer by U2-84 · Nov 22, 2019 at 10:01 AM

Hi @VicciGames, thanks for your reply. I'll try it and let you know as soon as I come back home, but I'm sure it will work. I think it's a distance problem, more than size. The same huge sphere occludes the lens flare perfectly when it's about <6500-7000 units far from the camera. Scaling everything, I'll shrink sizes and consequently distances, so it should work.


I am wondering: what if it's a wanted behaviour? I mean: very distant colliders should not occlude the lens flare (imagine a very tiny asteroid, far far away, so far that you can't even spot it. Would be weird to see the flare hiding for no reason... But we know that the flare is centered on a single pixel point (1x1), so even the smallest distant object might occlude it. I think they voluntarily designed it to avoid occlusion from little distant objects). So there must be a "distance" variable somewhere that enables or disables flare occlusion. Maybe in the lens flare script? If so, how can I access the built-in lens flare script?


Talking about the 2nd issue (the flickering flare when I slowly occlude it), I think it's not related to sizes or distances. If you look at the video, it flickers only when the occluding object (player ship) is moving - changing coordinates. If I stop moving and I just rotate (in the video, you can see when I move forward because there's "space dust" floating around me), the flare hides smoothly. This strange behaviour only occours if interpolation is enabled on the rigidbody. Without interpolation, everything works fine (but I don't want to drop interpolation... I like how it smooths the overall movements. Without interpolation, there's a constant "micro-stuttering / jitter" that makes the game look like it's running at 30fps even if it's 100+).

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

118 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

Related Questions

physics.OverlapSphere colliders 1 Answer

Blender Meshes not colliding Unity 4. 1 Answer

Terrain not generating tree colliders 4 Answers

Issues scaling a object with children colliders 1 Answer

Load a level at a specific point 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