How to add lightmap support to the custom terrain shader?

I’ve got a problem adding lightmap support to the custom terrain shader (Lux Plus based).

Some patches do not receive light at all:
(Baked)

(Realtime)

How to fix this?

(This is on Unity 2019.2.0f1)

Sooo, I’ve just looked through terrain shader source and it has same instanced options as the one I’ve got, so that’s good. And that shader do not have a meta pass for the lightmapper, so I’m clueless here.

Also, I’ve tested standard shader terrain shader which bakes just fine without this issue.
This is probably not caused by lightmapping settings I assume, but the shader itself.

Bump,

@zeroyao I’m not sure if you can help me, but I saw some posts about terrain tech.

Can you please provide some information on how terrain shader interacts with the lightmapping process?
I’ve been looking through built-in source and hit a brick wall.

Okay, I think I’ve found out what’s causing this, and its related to the Lux source. Sorry for poking you guys.

Edit: Also, for the future reference - AddPass shader is used for processing lightmapped data.

1 Like

DUDE!
Thank you SO MUCH!