12 agosto 2013

Achieving dynamic pass for lightmapped objects

For long time I thought it was impossible. Took me several months to find the way. Indeed, its already implemented, so I didn't have to do anything by myself.
For now, the method I've found consists in a few easy steps.

1. Set lightmap mode to Dual and check "Use in forwar render"

2. Add dualforward directive: #pragma surface surf TriAce dualforward
3. In case you want to make something different when using lighmaps, this is available:

        #ifdef LIGHTMAP_OFF
final.rgb= BRDF*Light;

And as extra, a Beast setup file that looks fantastic and does the job very fast.

3 comentarios:

  1. Is this possible in deferred rendering mode?

    1. Humm, who knows. I guess in deferred mode this option will run in forward.

  2. So what is the point of all this? Second lightmap gives bump ? If you use onlu one lightmap what is the disadvantage?