ShaderLab in Unity3D – iOS

Shader is a computer program that is used primarily to calculate rendering effects on graphics hardware with a high degree of flexibility.
Shaders are used to program the graphics processing unit (GPU) programmable rendering pipeline, which has mostly superseded the fixed-function pipeline that allowed only common geometry transformation and pixel-shading functions; with shaders, customized effects can be used.
– Wikipedia

Those who are not from the 3D Background are not aware of the Shaders, Materials and other related stuffs. This Post is for those people.
So, In simple terms, Shader is a Script which controls how the materials will look after assigning it to the 3D Objects. Shader is found in all the 3D application for example Maya, 3DS Max, Blender, zBrush, etc and is very very important in terms of the output of the the final Scene.
Similarly we have Shaders in Unity3D also which is very powerful and many kind of VFX related effects can be achieved using the shaders. There is very good article by MadFinger Games (http://madfingergames.com) who demonstrates how they have achieved some of the effects in their game ShadowGun using Shaders. (I will add a link to that article in the end)

As currently I am working on an iOS game, I found it useful to look into shader scripting in order to understand how exactly it works and make my own shader, if required.
I have just started my research and there’s lot yet to discover.
I would still like to list down some of the things which I have understood and would appreciate if someone can add more to it.

Every Shader must have a SubShader assign to it and the Shader used in iPhone should’nt have more than two SubShaders as there is only 2 GPUS available.
Shader controls how exactly we want to display our object. We can have variety of effects such as :
– We can add properties to the Materials
– Combine it with two or three textures and produce the mix result
– Can add Alpha Blending and also mix different Attributes like diffuse, specular, ambient etc to make a new look alltogether
I am still in learning stage and there many things to explore. This Post is just to give a rough idea about shaders and to make people aware that Shaders are not to be neglected as it plays a big part in Game Development.

I would ask you to have a look at JessyUV Youtube video to understand more about iOS Shaders in Unity3D. I have also been following those videos and have learned a lot from there.

Also do read this Article by Madfinger Games. I am sure it will help you understand much more in terms of Optimization in Unity3D
http://blogs.unity3d.com/2012/03/23/shadowgun-optimizing-for-mobile-sample-level/

Please feel free to contact me if incase of any doubt. I will try to resolve your query or will be able to guide you towards more such valuable links.
Thanks for your valuable time.
Happy Gaming 🙂

  1. No trackbacks yet.

You must be logged in to post a comment.