Unity: Minimal Lightmapped Shader

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[_LightMap] {
Combine previous * texture


Any suggestions for a good book about shader programming? I’d like to get into it some more eventually…

Bookmark the permalink. Follow any comments here with the RSS feed for this post. Trackbacks are closed, but you can post a comment.

One Comment

    Anonymous on December 11, 2010 at 23:49 | Permalink

    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.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>