Adding lightmap to a "vertexblend" shader

Hi guys,

I recently stumpled upon this fantastic shader that blends between two textures using vertexpainting.
I want to add a lightmap to this shader (this way I can bake lightmaps in an external application).

Here is a video of the vertex-blending shader:

Here is the shader code:
https://dl.dropboxusercontent.com/u/700791/Vertex%20Material/VertexBlend.shader

Here is a 2 minutes video showing what I am after (takes a few seconds to start): http://coindrop.dk/unityforum/shader_problem.mp4

Hope someone’s got a minute to help a graphic guy in deep water :slight_smile:

I think one of the following two thread has your solution;

http://forum.unity3d.com/threads/92258-Custom-lightmap-Surface-Shader
^ In case you want to use the normal material UV for your lightmap

http://forum.unity3d.com/threads/76298-Custom-lightmapping-shader
^ In case you want to use the UV2 for lightmapping.

I have tried using neither, just remembered having read these topic before when i wanted to figure out how lightmap behaviour is (first link mainly) and how to implement it with beast compatibility (second link)

Hope it helps you out a bit!

Hi Annihilator thanks for your reply. I will take a look at it later today - although I fear that I will run into a dead end again since my programming skills are somewhat limited :wink: