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 anwserman · Aug 09, 2012 at 07:47 PM · shadermobileperformanceoptimize

Intensive Shaders + Dynamic Batching

So, I'm developing a game for mobile platforms, and I'm trying to come up with a cost-effective way to make the game cool cartoony without slaughtering mobile performance. I'm currently using two custom shaders to achieve this.

-unlit tinted alpha with alpha testing

-unlit tinted

These work fantastic but they don't allow blob shadows to work. So I imported the toon shaders for the heck of it, applied it to my game, and it supposedly ran as fast as before. All of my objects so far derive from a common atlas texture and are optimized for dynamic batching. However, I tested this out on my PC and not an actual mobile device. That being said, I think the objects are still being batch drawn.

I only plan on developing for iPhone3GS and later, so the device itself won't be a problem. But I know toon shading is an intensive shader compared to the ones listed above. Should I only worry about shader intensity only if I'm not using shared materials between objects? All of the objects in my game use one material, vehicles use another, NPCs will all share two materials, and level geometry another.

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
0

Answer by ScroodgeM · Aug 09, 2012 at 08:51 PM

if it is possible in your case, assign to shaders unique queue value, this will help unity engine to batch them. of course, queue changing should be done with knowledge what does it affects.

also, if it's possible, combine meshes to force them do draw in one draw call. for example, after placing static objects on scene, force them to combine geometry.

for all other objects, try to place object so that on sorting objects by distance groups that should be batched will be place in sequence.

one crazy idea: can you use your 'unlit tinted alpha with alpha testing' with some improvements to avoid unneeded calculations with alpha instead of 'unlit tinted'?

Comment
Add comment · Show 6 · 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 anwserman · Aug 09, 2012 at 09:46 PM 0
Share

Could you clarify? The alpha needs to be in there so that materials with an alpha channel get drawn correctly, and the tinting is used in case I want to set the theme of the level. It's my current idea to replace lightmaps and scene lighting, change the tint of the materials.

avatar image ScroodgeM · Aug 09, 2012 at 10:08 PM 0
Share

i mean where you use 'unlit tinted' just use 'unlit tinted alpha with alpha testing', but to avoid calculations of alpha in that materials make some improvements to shader that will let disable it. as i understood in 'unlit tinted' you don't use alpha?

avatar image anwserman · Aug 09, 2012 at 10:10 PM 0
Share

Ah yes. How would I go about doing that? It'd be easier just to manually reassign them :3

avatar image ScroodgeM · Aug 09, 2012 at 10:14 PM 0
Share

this crazy idea needs to be tested on target platform. can be inefficient in many cases. and don't forget to disable alpha-calcs in shader for non-transparent materials.

avatar image anwserman · Aug 11, 2012 at 03:44 AM 0
Share

ok, truth be told, I have no idea how to do any of this lol. could you point me in the direction so I could try to figure this out?

Show more comments

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I optimize this code? 2 Answers

Shader performance question. 0 Answers

Shader.WarmupAllShaders ? What it does? 0 Answers

Transparency issue on iOS 1 Answer

Color white does nothing consider mobile... really? 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