- Home /
Terrain lighting issue...
I have a day/night cycle fully working however at night when i have my point lights turn on from torches this happens: 
Answer by tanoshimi · Mar 01, 2017 at 09:47 PM
Many possible explanations but at a guess you've exceeded your pixel light count so those torches are lighting per-vertex rather than per-pixel, and the light intensity is therefore getting interpolated along that line because it's the side of a triangle in your terrain.
so my terrain is to big and if i add more lights i'll just have a bigger problem? hmmm....guess i'll have to add a loading aoe around the player for lighting effects? would this work?
you were right i did a check:
bool InArea;
private void OnTriggerEnter(Collider other)
{
InArea = true;
}
private void OnTriggerExit(Collider other)
{
InArea = false;
}
and bam it works it is because to much is being done at once. on top of that...got to keep 100fps
So I guess you are using forward rendering? If you need several lights you could try out deferred rendering. It might give you both better fps and better results.
Answer by Mikael-H · Mar 02, 2017 at 12:55 PM
If you have many (dynamic) lights in your scene you might want to switch rendering path to deferred rendering. Doing so will allow each pixel to be correctly lit by the lights that are in a position where they have a "field of view" of that pixel. There is a higher performance cost for deferred rendering but it is more performant when you have several lights som in some cases your FPS might actually go up when you switch to deferred rendering.
You can select rendering path in the graphics settings. There is a comparison of the different rendering paths in the manual
Your answer