- Home /
Simple emission shader for beast lightmaps
I need a simple shader that displays a model with vertex colors, and emits that vertex color for use when lightmapping with beast.
So far I got this, but it only emits white color, not any of the vertex-colors added to the model.
Shader "Self-Illumin/Vertex Color" {
Properties {
_EmissionLM ("Emission (Lightmapper)", Float) = 1
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float4 color : COLOR; // Get vertex color
};
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = IN.color.rgb;
o.Emission = IN.color.rgb; // Always results in white?!?
}
ENDCG
}
}
What am I doing wrong here?
Also, Is this shader really that simple? I mean, the only reason its even a surface shader is that I need to emit light from it. Otherwise a vertex color only shader would work fine. Is there perhaps a way I could tell Unity to bake using one shader, and then swap that shader for a simpler one when actually playing?
Thanks!
Answer by stevesan · Nov 12, 2013 at 01:55 AM
Maybe this will help: http://answers.unity3d.com/questions/308141/lightmapper-with-custom-shader-emission-map.html?sort=oldest