ShaderLab

Is there a manual somewhere which describes ShaderLab for the iPhone.

There have been queries elsewhere on the list, and the responses “just like a 1999-era graphics card” arent terribly illuminating for someone not versed in programming 1999 era graphics cards.

A detailed ShaderLab manual for the iPhone would be great.

Such a detailed explaination should fit on a single page:

What you can not use: anything where include and cg are mentioned :slight_smile:
Also nothing where cubemaps are needed, render texture and related things.

What you can use: You are restricted to the combiners. Commonly you see them used in the fallback shaders. There is thought an additional restriction here: you can only use 2 textures per pass. With more than 2 textures you need to split them into passes. A pass per 2 textures that are meant to be combined

Can I really not use CubeMaps? Can I use SphereMaps?

Can I use one texture to provide coordinates to look up another texture?

Going through the manual, which of these are enabled for iPhone?

ShaderLab syntax: Color, Material, Lighting
Color Color
Material { Material Block }
Lighting On | Off
SeperateSpecular On | Off
Diffuse Color
Ambient Color
Specular Color
Shininess Number
Emission Color

ShaderLab syntax: Culling Depth Testing
Cull Back | Front | Off
ZWrite On | Off
ZTest Less | Greater | LEqual | GEqual | Equal | NotEqual | Always
Offset Factor , Units

ShaderLab syntax: Texturing
SetTexture [TexturePropertyName] { Texture Block }
combine src1 * src2
combine src1 + src2
combine src1 - src2
combine src1 ± src2
combine src1 lerp (src2) src3
combine src1 * src2 + src3
combine src1 * src2 ± src3
combine src1 * src2 - src3
<<where is dot3 described in the manual?>>

ShaderLab syntax: Fog
Fog { Fog Commands }
Mode Off | Linear | Exp | Exp2
Color ColorValue
Density FloatValue
Range FloatValue , FloatValue

ShaderLab syntax: Alpha testing
AlphaTest Off
AlphaTest comparison AlphaValue

ShaderLab syntax: Blending
Blend Off
Blend SrcFactor DstFactor