I have a good programming degree, and I’ve worked with shaders before, but I haven’t worked with them in Unity (or worked on Unity at all before now for that matter). I’m making my way through tutorials, examples, and such, but I was wondering if I could get someone to help me with a high-level overview of some shader constructs in Unity.
The above link steps through different steps of setting of different shader features (such as texturing, bump mapping, rim lighting, and so on). It’s extremely useful, and I’m learning quite a bit about how to work with Unity’s shader system by stepping my way through this, but I need just a pointer or two on at least what constructs are called so I can read up about what exactly it is that they do.
For example, in the second sample listed on the above page (“Texture”), it creates a “Properties” block (or something, not sure what to call it) with the line _MainTex ("Texture", 2D) = "white" {}
, creates a sampler2D
object also called _MainTex
, and samples it in the surf
function. How do these _MainTex
s work together? What do the strings do, look up some predefined data in Unity’s shader system to use? Where can I find a reference of what these strings and such are called and what they do?
Thanks in advance, any help is greatly appreciated.