- Home /
UV Map, change texture color (lighter/darker)
I'm trying to figure out how I could make my own lighting system for my UV map in Unity. I have the theory nailed down (I believe) but I'm having problems on the practical side.
I have a voxel (minecraft-like) map object that is generated at runtime. Let's say the UV map for a face is done as such:
UVm.Add(new Vector2 (0, 1)); // 1
UVm.Add(new Vector2 (1, 1)); // 2
UVm.Add(new Vector2 (1, 0)); // 3
UVm.Add(new Vector2 (0, 0)); // 4
How could I go ahead and make the texture on that particular face lighter or darker?
Answer by livevlad · Feb 24, 2014 at 01:43 PM
What you need seems to be a light effect. In your custom shader just use Fallback "Diffuse" to use the diffuse shader (lightning).
You will be able to create your shader and keep the light effect. See the following examples : http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaderExamples.html
Hope it helps !
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Voxel texturing with single texture instead of texturesheet? 0 Answers
Texture uv's offest in distance? 0 Answers
A way to "fold" a texture on a mesh? 1 Answer
Wrong import of UV from blender 1 Answer