x


Unity iPhone: difference between shader and iPhone-shader?

Hi,

im working on a unity-iphone project right now and id like to know wheres exactly the differences between the standard shader and the special iphone-shader? Should i use only the iphone-shader oder whats going on with the standard shader? It would be great to have the same shader-manual for the iphone-sahder like it consists already for the non-iphone-version.

Thanks for your help, yosh

more ▼

asked Feb 15 '10 at 02:01 PM

yosh gravatar image

yosh
901 73 81 94

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The most important difference is that CG/GLSL is not supported in Unity iPhone. (The original GPU is fixed function only.) You can find more information here:

file:///Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/Manual/iphone-unsupported.html

Knowing that, nearly everything found in the ShaderLab Reference will work on the iPhone. I agree with you that the differences need to be documented, however. Here are a couple things, that I know of, that aren't listed as not working, but still don't work:

  • Cubemaps
  • SeparateSpecular command
  • Three-argument texture combiner functions (except Lerp)
  • GrabPass

Every shader included with Unity will work on the iPhone, but that's only because of Fallbacks. Generally, if you don't want to write your own shaders, it's a good idea to use the ones in the iPhone standard assets, because they are designed to run a little faster than the non-iPhone stuff.

Edit: Re-reading your question, I'm thinking perhaps you mean that the iPhone shaders should have documentation such as is found in the Built-in Shader Guide. Although I agree with that, the shaders that can run on the iPhone are much less complex than most of the other shaders, so it's to every Unity iPhone developer's benefit to learn the simple ShaderLab language, and write their own very fast shaders. As it is, a couple of us have begun adding this kind of extremely fast, simple shader, to the wiki. Glancing over them would probably be a good way to help yourself learn, if you're interested:

http://www.unifycommunity.com/wiki/index.php?title=Shader_Archive#iPhone

more ▼

answered Feb 15 '10 at 11:34 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

Thanks for your information, jessy. It helped me a lot and now i will have a look at the shader guide. thanks.

Feb 16 '10 at 09:05 AM yosh
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1999
x1649

asked: Feb 15 '10 at 02:01 PM

Seen: 7345 times

Last Updated: Feb 15 '10 at 02:01 PM