Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im having problems with area light and spotlight. When adjusting parameters the change is not consistent and sometimes the light grows tstronger and then dissapears and then reappears very strong, when increasong the strength.

Also i have a spotlight that only affects the 3d meshes that is the environemnt but not the ground, which is textured plane.

Wehn playing the game some area lights switch on or off depending on what angle and distance from it i am at the moment. Are the lights supposed to be able to be used dynamically ?

Im using the free version of Unity. Could this be affecting?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I think it depends on how many per pixel lights are illuminating your objects. Unity, at least in forward rendering path, uses several additional shading passes while rendering your objects.

It renders before the lights marked as RenderMode: important (or RenderMode:auto and promoted as important by the engine itself). This kind of lights are rendered per pixel. The maximum number of those lights is set in Quality Settings-> Pixel Light Count (the engine allows up to 4 per pixel light).

The other lights are rendered per vertex.

Spotlights need to be rendered per pixel to actually see the spot (well..it depends on the geometry of the lighted object, but for example a spotlight can't light correctly with a per vertex shading on a quad).

So if your lights are popping on/off this might due to:

  • In certain angle/position of the camera relative to the object, the number of lights overcomes the per pixel light quality settings and unity decides that some of them will be renderered per vertex.
  • Certain spot lights are not marked as important in the inspector, and unity decide autonomously which should be important which not, depedening on the situation.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.