- Home /
Is there a shader with 3 inputs as texture, light map, and uv?
I am wondering if there is a shader with texture, lightmap and gameObject's uv information as inputs. With this shader, the gameObject can be rendered as baked.
Anyhelp is really appreciated!!!!
for uv not sure of , but you can try Bump$$anonymous$$apping . It should be in the default shaders
Answer by Navigatron · Apr 01, 2015 at 10:35 PM
No, I'm afraid not. Bump-mapped is the shader you are looking for; it uses the texture and UV map.
As for lightmapping, I have had some unfortunate experiences and know more than I should have to. If you have the lightmap already defined from somewhere (How would you do that?) you can assign the lightmap to the lightmap settings using LightmapSettings.lightmaps = LightmapData[]{....};
where the LightmapData array is composed of LightmapData objects, each one consisting of a LightmapData.lightmapFar and a LightmapData.lightmapNear.
I advise against this, because in addition to loading in your custom lightmaps you will have to assign a lightmapIndex to every renderer in the scene, along with each ones custom normalized coords.
I'm pretty sure this next thing is what you want.
At the top of the screen choose Window>Lightmapping. This opens Unity's built-in lightmapper. The Docs have some very good documentation on what each setting does. If you're new, defualts should be fine. In the bottom right, hit "Bake scene". This will render all the shadows from everything in the scene into a lightmap, assign indexes to every mesh, load it all and remember it for you. No scripting needed.
Best of luck
hi, Navigatron. Thanks for your reply. I think I'd better tell more about my project
1) I got the light map of my scene 2) I got the one uv containning every object's uv in the scene 3) I got a texture containing every object's texture, of cause, located as the uv descripted 4) Every object in the scene will use the shader, which can map the lightmap and texture to the object according to the uv. Could you plz give me hand to solve my problem?
I also checked the unity shaders, but cant find a shader called bump-mapped shader. It is a shader built in unity?
Your answer
