- Home /
Best way to create lights on the dark side of an object but not visible in light?
What would the best way about going about this. I have looked everywhere and I can't think of where to start. Should I write a shader? lots of small lights on the planet? I tried a very crude method before where I had 2 models, one was slightly off center and had dark side textures but it created very jagged lines where they met and it was a very sudden change.
If you haven't got any response, perhaps you should think about whether your question could be phrased better or contain more information. What sort of lights... Point lights? Are you simply deter$$anonymous$$ing which is the dark side of your object based on a texture, or is it itself already lit by another light? What sort of light... directional? So you have a partially lit object, and you want to deter$$anonymous$$e areas of that object that are not lit and to create point lights arbitrarily in those areas, right? Or do you want all lights to be there, but simply to turn "off" when they are shone on by another, brighter light? If so, you can raycast from one light to another and see whether there are any colliders in the way or whether the distance has meant all the light has been attenuated.
Basically, it's a bit hard to follow exactly what you're asking. A picture might help.
Yea fair enough reading it now its as vague as it can be. I am trying to create planet lights, so on the dark side lights will be visible but on the light side they wont. I was thinking substitute an image on the opposite side but I don't even know if that's possible. I cant upload a picture for some reason as the site says it has to be smaller than 500$$anonymous$$B which is ridiculously small. Basically I want to know how to get the dark side of a planet to have a texture with lights on it.
So hang on, do.you actually want lights - i.e. emissive components that illu$$anonymous$$ate other gameobjects, cast shadows etc? Or do you just mean a texture
Answer by TangoNation · Nov 20, 2016 at 04:42 PM
Haven't got a response for any of my questions on so long....
Answer by jorrit5477 · Nov 20, 2016 at 08:17 PM
Have a look at http://wiki.unity3d.com/index.php?title=Earth/Planet
Step in the right direction thanks but the dark side isnt dark and doesn't support specular maps unfortunately.
Answer by tanoshimi · Nov 20, 2016 at 07:59 PM
With the additional information supplied, it sounds like you're looking for this shader from the wiki.
Thanks this is good but the dark side of the planet isn't dark, more of a blue light ish blue and it doesn't support specular maps. For some reason the light s are staying on in the day too :/
Your answer
Follow this Question
Related Questions
Odd Portional Screen Flickering 0 Answers
Shadow sprite rotation regardless of the light source 0 Answers
Finding object scale within a shader 1 Answer
Light Falloff Post Process Effect? 0 Answers
Unity Advanced Shader Help 0 Answers