Shader performance tips and best-practices?

Are there any performance tips people can provide for shaderlab? I suppose they would be the same as “regular” shaders (hlsl, glsl, cg, etc.) aside from syntax.

What should I avoid? What should I prefer? Is using the same sampler for all 4 splat textures in the terrain shader better than using 4 different samplers? Is it good practice to always have a SM2.0 compatible fallback for SM3.0 shaders?

Thanks for any info!

I think definately good practise to fall all the way back to fixed function, but I would like more info too on how thats done :slight_smile:

The fallbacks you need depend entirely on your target hardware. There’s no point in writing shaders that won’t get used.