I'd like to be able to change the ambient light color in realtime, while using beast's baked ambient occlusion. So what I do is set my light to realtime only and the ambient light to white, which effectively creates a nice ambient occlusion bake.
The problem is that changing ambient lighting afterwards won't affect a thing - makes sense since normally you would have baked shadows / reflected light etc. in the lightmap, meaning you need to rebake when changing ambient light.
Is there any way to access the lightmap in the shader so i just can multiply the albedo with the lightmap color and ignore lightmapping during light calculation? I played around with using renderer.lightmapIndex and renderer.lightmapTilingOffset and putting the corresponding lightmap texture as a separate texture in the shader using the secondary uvs (they are the ones for lightmapping i suppose, turned on generate lightmap uvs in the importer), but the results are wrong - any ideas how to access it in the surface shader, or is there another way?
if you explicitely implement the lightmap support and don't let the auto add of surface shaders do it, then yes you could overwrite it. But as long as you rely on auto addition no, as it will not exist for your access in the surface shader code you write.
answered Jul 19 '11 at 03:48 PM