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 dog_funtom · May 07, 2014 at 12:22 AM · 2dshaderspriteshadersmobile

Why Sprites-Default shader hasn't any fallback?

I downloaded source code for standard shaders and discovered that Sprites-Default has no fallback. (Also Sprites-Diffuse has fallback to Alpha-VertexLit.)

You probably think why would I want it. That's because I recently read about shaders in Manual, and it states that if you code has CGPROGRAM in it, then it's surface (or vertex) shader. And when you have surface (or vertex) shader then:

"You will probably want to write fixed function shaders as an n-th fallback to your fancy fragment or surface shaders, to make sure your game still renders something sensible when run on old hardware or simpler mobile platforms."

So, if my game is running on such mobile platform that Sprites-Diffuse will fallback, will Sprites-Default still work properly? If yes, why? If no, what should I do?

Comment
Add comment · Show 1
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 Eric5h5 · May 07, 2014 at 01:18 AM 2
Share

If you're running a platform that can't handle the Sprites-Default shader, I doubt you'd be able to make anything in Unity that would run on it anyway.

1 Reply

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

Answer by Bunny83 · May 07, 2014 at 03:33 AM

Like Eric said, the "Sprites-Diffuse" is one of the simplest shaders in Unity, it doesn't cull, it doesn't use lighting, it just uses alpha-blending. In the rare case that your target platform / device doesn't support alpha blending, to what kind of shader should it "fall-back" to? You can't display a sprite without alpha blending or every sprite would be a rectangle with solid background color.

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 dog_funtom · May 07, 2014 at 10:52 AM 0
Share

Since it's so simple, why is it even CG shader? Why not just fixed function shader?

avatar image golonko · Apr 15, 2015 at 11:51 AM 1
Share

dog_funtom - because fixed function shaders are not supported on some platforms

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

22 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

Related Questions

Double sided pass? 2 Answers

2D Sprite Highlight 0 Answers

Is it possible to have multiple stencil reference values in one shader? 0 Answers

Outline set of tiled sprites 0 Answers

2D Sprite Always Visible - Shader / Material not working (ZTest, ZWrite, Culling) 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