- Home /
U3: Beast Lightmapping + Nature / Soft Occlusion Shader
Hi all,
I used to bake my lightmaps for my environment within a 3D modelling app and apply them within my Unity project via a basic Lightmap shader (Diffuse + Lightmap). Now I stumpled upon the integrated Beast lightmapping in Unity which would serve me better as I like to manage all my objects within Unity.
Problem now is:
I have trees which consists of 2 materials / textures which I have defined as having "Nature/Soft Occlusion Bark" and "Nature/Soft Occlusion Leaves". My floor is having a normal diffuse shader.
Floor as well as trees are marked as "static".
I will then select my directional light within the scene and open the lightmapping window and press on "Bake" which would generate lightmaps for the full scene.
Once the process of baking is finished, I will have a nice shadow on my floor, generated by the static trees, however the trees have disappeared. Further investigation reveals that the objects are still there, but the texture is transparent.
If I change the shader of the trees to anything other than Nature/Soft Occlusion the textures are visible again.
Is this a bug with the shaders in U3 or am I missing something during this process. To add, I also played around with the "Generate Lightmap UVs" during model import but it does not seem to make any difference.
Thanks for any help on this one.
Kind regards, Ron.
This problem is really driving me crazy :)
I've tried the builtin tree shaders from the Unity 3 beta with the same effect. Also trees generated by the new generator with the Optimized Bark and Leaf materials "dissappear" from the scene once I perform the lightmapping.
During my testing I deleted the generated LightmapFar-n.exr which belonged to the bark and leaves shaders and the textures (trees) were correctly shown again.
I'm already really confused because of this behaviour. Anyone experienced something similar with the Unity 3 Lightmapping?
Any response highly appreciated, thanks!
I've been having the exact same issue on a project I'm working on, and unfortunately haven't been able to find a solution either. Have you gotten any further with figuring it out?
Hi $$anonymous$$, I didn't further look into it. What I did was perform the Beast lightmap generation, take the lightmaps and applied them manually where I needed them. I left the tree shaders as they are, so no lightmapping on them. I don't know if there is a way by now, I didn't spend to much time to continue working on this topic. I will get back to it soon I think, so let me know if you find out an easier workaround.
Answer by DocSWAB · Nov 08, 2010 at 09:33 PM
What I've seen is that if you have a manually placed tree (not in a terrain) that uses the unity 2.x AO shaders, you can mark it static, with lightmap resolution of 0 in the lightmapping pane. (It sounds like you did the first thing but not the second).
Then when you bake, the tree shadows will bake ONTO the other objects, but won't have lightmaps baked for them (AO shaders can't be lightmapped.)
Then uncheck static on those trees to have the realtime AO lighting be correct at runtime.
Unfortunately right now the static property is not exposed to scripting in the Editor class, so this is a manual operation.
Is there a way to use different shaders in place of the AO shaders on for the bark and leaves in order to be able to use light mapping with them?