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 hexdump · Nov 19, 2012 at 11:09 PM · shaderscghlslglsl

what would you choose to write unity shaders GLSL, HLSL/CG or Surface lang?

Hi!,

I'm pretty new to shader programming. I want to start to write some of them but have a little problem about what language to choose. I have read a bunch of threads, have seen a bunch of videos and read some tutorials.

I have seen people using Surface shaders, others like the book at wikibooks use GLSL and others HLSL/CG. What language do you recomend to start to write shaders in unity? I really prefer a low level language at first to understand everything so, I think surface shaders is not what I'm looking for. On the other hand after reading a post on unity blog, it seems they translate all to GLSL shaders, so, it GLSL my best option? It seems there are an orange book that seems to be a nice book about GLSL shaders. What do you think? Could you give a hand here with all this mess?

Thanks in advance.

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 Martin-Kraus · Dec 05, 2012 at 08:14 PM

If you prefer a low-level approach then the wikibooks "GLSL Programming" and "Cg Programming" (an adaptation of the former to Cg/HLSL) are probably your best choices.

In general, it makes sense to use Cg/HLSL instead of GLSL in Unity, because Cg/HLSL shaders are compiled to GLSL when necessary (e.g. on mobile devices) but not the other way around (i.e. a game with a GLSL shader just won't render correctly in a web browser on Windows). If you are sure that you NEVER want to run your game in a web browser on Windows, then you might consider GLSL because it can potentially offer better performance, in particular on mobile platforms.

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

10 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

Related Questions

Shader Variable Types 2 Answers

Can this shader run in unity? 1 Answer

Grabpass refraction masking 0 Answers

How to prevent shader optimizations? 1 Answer

Can a CG shader fail to work on hardware? 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