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 Orangy-Tang · Sep 01, 2015 at 07:25 AM · androidlightingmobilebatchingvertexlit

Manually configure light bounds? / Optimising lighting for dynamic batching

Here's the quick background, my project has:
- Lots of dynamic objects
- 4 dynamic lights
- Mobile/VertexLit shader
- Targetting Android

All the dynamic objects are sharing a single material, so I'm relying on Unity's dynamic batching to bring the draw calls down to a sensible amount on Android. And in theory, Mobile/VertexLit can do 4 lights simultaneously (via vector ops) so this can all be done via a single draw call.

Problem: Since the lights all cover different areas, some objects fall under light 1, some under 1+2, some under 3, some under 3+4, etc. etc.

Unity (in it's infinite wisdom) is trying to make dynamic batches for each combination of lights, which means in my test scene, 6 objects each fall under a different lighting permutation and end up as 6 batches (bad!). Really, I want to (somehow) force Unity to only consider one lighting permutation (all 4 lights) and then create one dynamic batch for this, so all 6 objects become one dynamic batch.

Ways I can think of doing this:
1. Somehow force the light bounds to be huge, so that Unity thinks all objects are lit by all lights.
2. Disable light culling for dynamic batch generation somehow
3. Mess with my object's bounds so that they appear to be intersecting all of the lights (but will this then mess up frustum culling?)
4. Ditch Unity lighting and write my own shaders (ugh. super time sink).
5. Something else.

Unfortunately, I do not know how to actually do any of these in Unity, as it appears I can't dig deep enough into the renderer. Anyone any suggestions? Thanks.

Comment
Add comment · Show 2
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 Ultroman · May 12, 2016 at 09:26 AM 0
Share

Dude, your 2D dynamic lighting article clearly shows, that you are the best candidate, to make a good asset that accomplishes believable 2D dynamic lighting. None of the assets out there do it right. I'd gladly pay €30-40 for an asset like that. $$anonymous$$aybe more. Is there no way to take advantage of your methods, by drawing to a texture, and then overlay the camera with that texture?

avatar image Ultroman · May 12, 2016 at 10:57 AM 0
Share

Though I did find this beautiful per-pixel solution: https://www.assetstore.unity3d.com/en/#!/content/38682

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Mobile Build Spotlight Problem 1 Answer

Shadows problem on mobile 0 Answers

How to fix spotLight problom in android ? 0 Answers

Lighting won't extend far on Android,Lighting won't extend far on mobile? 0 Answers

lighting heavy mobile game optimization 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