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 siddharth3322 · Jun 27, 2015 at 07:19 AM · shadermobileperformance optimizationspecular

Check performance of shader for mobile

If I use specular shader for mobile device then I got following message on inspector. Whether I have to use specular effect for mobile device or not? But I want to use this shader. I want your suggestion in this. Whether it consumes more resources?

alt text

screen-shot-2015-06-27-at-124114-pm.png (25.1 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

1 Reply

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

Answer by DaDonik · Jun 27, 2015 at 08:51 AM

That shader will certainly run poor on mobile. Make sure to use the specular shader for mobile, which is optimized for ... mobile :D

Let me try to explain that whole shader thing:

Those shaders are pixel shaders. That means they are basically a small program that is run on each pixel. The more complex a shader is, the longer the program for each pixel gets and the more time it needs to render it to the screen. That also means that the screen resolution is a large factor, since the shaders are run for each pixel.

As you most likely know, PC's have much more graphics power than mobile devices, so you really should use the shaders that are optimized for mobile.

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 siddharth3322 · Jun 27, 2015 at 09:12 AM 0
Share

@DaDonik, Thanks for help and awesome explanation. I have one question, how to decide shader is vertex or fragment shader?

avatar image DaDonik · Jun 27, 2015 at 09:27 AM 1
Share

The fragment/pixel shader will run on each pixel as i said above. This is the better looking but slower version.

The vertex shader works on the actual mesh of your 3D object. It's much faster but you can't expect much from it. You can't have nice specular on your mesh if only the vertices are used for the calculations. All it can do is interpolate the look of the surface of each polygon depending on it's vertices. That means you will have problems getting a sphere to look round if you don't use many polygons, which is not really good for mobile.

Note that vertex shaders in general can also move vertices in your mesh, but those shaders on Unity's materials are purely for visuals and do not affect the mesh. So these vertex shaders can be considered the old way to show a 3D object on the screen, while fragment/pixel shaders are the new way.

Hope that helps =)

avatar image siddharth3322 · Jun 27, 2015 at 09:33 AM 0
Share

@DaDonik, Thanks for all of above. One more thing, If I want to use reflective shader then in mobile section we don't have that shader then how to get same effect for mobile?

avatar image DaDonik · Jun 27, 2015 at 09:37 AM 1
Share

Reflection is a really(!) expensive thing to do. Thats why Unity doesn't have a mobile version for it. I'm afraid you have to wait a few years until mobile devices can handle that without problems.

You can try to use the non-mobile version, but it's not guaranteed to work on every device and it will most likely be slow as hell if it works at all.

avatar image Girish-sruthkia · Aug 01, 2015 at 12:27 PM 1
Share

@ siddharth3322 U can use reflective and non mobile shaders but selectively and for most important objects/elements, it will have less impact than using them for all the objects in the scene. You can check unity docs, what they had mentioned is "use mobile shaders wherever u can". In now a days we are seeing more powerful mobile devices which can handle them without any problems.

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

21 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

Related Questions

Fake specular shader for a sphere? 1 Answer

[FOUND] Mobile shader with those mixed effects : Transparency, specular, diffuse, cubemap reflection ? 2 Answers

Which specular shader to use on mobile? 0 Answers

How to tint the specular map in Unity5 0 Answers

Help with planet shader. 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