With some nice help from the #unity3d IRC channel, I managed to build a Minimal Lightmapped shader. All it does is multiply a lightmap with a texture. And nothing else. No lighting, nothing.
Shader "Minimal Lightmapped" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_LightMap ("Lightmap (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
SetTexture[_MainTex]
SetTexture[_LightMap] {
Combine previous * texture
}
}
}
}
Any suggestions for a good book about shader programming? I’d like to get into it some more eventually…
One Comment
there is a video, Digital Tutors XNA shaderlab CD that is supposed to be good… I havent gotten around to it yet but i'd like to learn more about shaders as well.