Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Teku-Studios · Aug 08, 2015 at 08:29 AM · graphicsparticlesspritesculling

[5.1.2f1] Unnecessarily agressive culling - how to tweak it?

Hi there!

I'm experiencing some trouble with some effects and graphics in the game we are currently developing. Some objects (particles and 2D sprites) cease to be rendered when they reach the border of the screen, even if they should still be visible. Since the camera barely zooms, we do not have any kind of LOD or custom culling zones in the game (and those objects are non-static, which should avoid culling calculations for them). I'll give you some visual examples:

Fog issue

Sprite issue

In the first screenshot, you can see how a fog particle effect is perfectly rendered but disappears when the camera is a few pixels ahead. In the second one, the medallion sprite is rendered but, as the camera moves a little bit, vanishes.

We have a Perspective camera because we do make use of the Z axis for a lot of things (and we have some Z movement in some specific areas of the game), maybe that's part of the problem? I haven't configured anything related to culling, so this is Unity working automatically. How can I deal with this issue? It gets very annoying when you are walking and see sprites and particles pop in suddenly. And we are working really hard on our game's art, so we really want to solve any erratic behaviour concerning visuals.

I've double-checked the scene setup and every gameObject's renderer has a unique sortingLayer value, so it's not a rendering issue. I've also tried setting mainCamera.TransparencySortMode to Ortographic, unchecking the Occlusion Culling flag in my camera and narrowing the Near and Far clipping plane values, but none of that worked either.

Thanks for your time.

Comment
Add comment · Show 20
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 l3fty · Aug 13, 2015 at 09:27 AM 1
Share

If you switch the camera to orthographic are they still being culled away?

avatar image l3fty · Aug 13, 2015 at 11:34 AM 1
Share

A hacky fix might be to ensure some significant scene depth is present for those elements in the background prone to order incorrectly (though I can see that being unworkable too). It's probably an optimisation in Unity's perpective camera code which is screwing up the render order at distance. Possibly worth submitting a bug report on it, and hopefully they don't just say they expect 2D sprites to use orthographic cameras.

I wonder if there are any settings to increase the z ordering fidelity, someone else might know of such a thing.

avatar image l3fty · Aug 13, 2015 at 11:39 AM 1
Share

Oh, perhaps try playing about with this too: http://docs.unity3d.com/ScriptReference/Camera-transparencySort$$anonymous$$ode.html?from=TransparencySort$$anonymous$$ode

avatar image Teku-Studios · Aug 13, 2015 at 12:02 PM 1
Share

Thanks a lot @l3fty, I'll submit a bug report and take a look at the docs. And yeah, transparency sorting might be the thing (we are using Transparent sprites with 2DToolkit after all).

I'll let you know what I find out.

avatar image _dns_ · Aug 13, 2015 at 03:25 PM 1
Share

Hi, the frame debugger may help to see if it's a Z order problem or if the object is culled (it allows to see each object rendered). It may also help to use a simple script in the Update that check the Renderer.IsVisible flag of a problematic object. If it's some Z order problem, make sure your camera Near & far clipping plane are as narrow as possible = $$anonymous$$imize (Far - Near) as it will increase precision (EDIT: it increases precision of the Z buffer but not of transparent object sorting).

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer Wiki

Answer by Teku-Studios · Aug 31, 2015 at 06:03 PM

Okay, found it! Although I do not know exactly why this happens.

The issue vanished when I changed those object's Zscale value. Some objects needed a smaller Z and others needed a bigger Z. I'm glad to see this solved, although I still don't know why scale in Z affects 2D sprites' rendering.

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

25 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

Related Questions

Culling part of a sprite in Sprite Manager 2 1 Answer

Problem with flipping ! 0 Answers

Greyscale shading 0 Answers

Make 2D sprites glow? 4 Answers

Unity drawing particles incorrectly 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