- Home /
How to change texture based on light level
I am trying to construct a to scale model of the solar system and I wanted to change the texture of the light and dark side of earth so the user can see the lights of the cities. Is there any way to have the side facing away from the sun have one texture while the side facing toward it have another.
thanks
I'm a bit new to unity, I have little experience with coding(outside of python) @VesuvianPrime
This concept has been quite popular. You might very well find such a shader on t'internet.
Good luck on finding the right search terms though :/
Answer by tanoshimi · Feb 19, 2015 at 07:46 AM
Top hit for "Unity Planet Shader": http://wiki.unity3d.com/index.php?title=Earth/Planet ?
That looks like what I need, but when I create a shader with that exact code it doesn't work... @tanoshimi
I got the shader to work, but it lights the planet in a really funky way, ins$$anonymous$$d of lighting up half the sphere it lights it in a way like the seams on a baseball. The shader seams to pay little to no attention to the actual direction of the light.
EDIT
I just had to add a normal map and it fixed all the problems
Your answer
![](https://koobas.hobune.stream/wayback/20220613183708im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is it possible to apply attached png to dae in a good way? 0 Answers
Why does the lighting on my model look wrong? 3 Answers
What causes this? 1 Answer
Problem with shadows 1 Answer
Black marks glitching in model 0 Answers