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 Jessespike · Oct 28, 2012 at 09:52 PM · shadermobilegraphicssm2

Fixed Functions or Shaders, which one to prefer?

I'm trying to understand the differences between these two shader pipelines. Getting_Started_with_Shaders mentions that Fixed functions is meant for compatibility for older hardware. I also read FFP may have less features compared to SM2, which is understandable. But if I could get away with all shaders as fixed function, should I? Is there any performance difference?

I'm just a little confused, because if a shader can be either. Which one should I be preferring?

Edit: My device uses Android, Arm7, OpenGL-ES 2.0

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 Jessespike · Nov 12, 2012 at 08:28 AM

Been doing some research, I think I have found enough related information to answer myself. To help others in the future whom may have the same question, I've provided links to the most helpful web pages.

In the Unity Shader Manual:

Fixed Function Shaders need to be written for old hardware that doesn't support programmable shaders. 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.

http://docs.unity3d.com/Documentation/Manual/Shaders.html

Also found an interesting forum post that discusses the topic and more:

maik's Question: So, does this means that it would be better to always code my own Cg shaders? (i.e. replace all the default shaders with my own ones in cg?)

Jessy's Reply: Non-surface shader Cg can be faster, but the device runs GLSL. If performance is an issue, GLSL is the way to go, unless the Cg auto-translates into optimized GLSL. Sometimes it will, sometimes it won't. If you find GLSL to run faster than the translated Cg, you should report a bug. I don't have time for that (the auto-translated GLSL looks like garbage, so comparisons are too time-consuming), so I use GLSL directly, but that's not the approach Unity steers you into.


Fixed function shaders will always be translated to the programmable hardware in a way that yields suboptimal performance.


SubShaders should be added, so they work on obsolete hardware, and faster on modern hardware. You can find threads here from the past year or so in which I detail this.

http://forum.unity3d.com/threads/124826-Shaders-Which-ones-%28fixed-surface-cg-%29

and some more links:

http://www.gamedev.net/topic/382659-do-you-still-support-fixed-function-pipeline/

http://forum.unity3d.com/threads/86846-Worth-dropping-fixed-function-support

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

9 People are following this question.

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

Related Questions

How do I modify this shader to receive shadows ??? 0 Answers

Mobile: Diffuse Cutout shader with NormalMap. Very bad performance. 0 Answers

How to project a line over objects 2 Answers

(Shader Graph) Output resolution/ setting resolution of the main preview window 0 Answers

Mali-G76 ShaderGraph PBR Shader,when shadervariant missing cause crash 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