#Spot Lights flicker when camera enters their outer angle

1 messages · Page 1 of 1 (latest)

wise kettle
#

Realtime Spot Lights in my project 'flicker' when the camera is at a specific point (basically 'on top of' the outer spot angle). I can bandaid fix this by making the outer spot angle very high but this obviously changes the look of the light in an unwanted way. This still happens in the game, not just in the scene view.

It isn't due to the per vertex light limit since the test scene shown in the .gif only has 1 light and 1 mesh. I can also verify it isn't due to anything under Lighting Settings since it still happens in this scene which doesn't have a lighting settings asset selected. I also don't believe it is due to frustrum culling because it still happens when the lights are clearly visible by the camera.
I've played around with the lighting settings in the renderer asset and nothing seems to change this (screenshot of settings attached just in case).

stone pawn
#

Looking at the frame debugger, or PIX/RenderDoc might reveal the cause.
One thing that bothers me is that your gizmos get weird artifacts, which might point that these are issues with your environment rather than unity.

wise kettle
#

what do you mean by the gizmos getting artifacts?
if you mean the flickering on the gimbal I think that might just be the .gif colour limit crusting things up

stone pawn
wise kettle
#

hmm, in the frame debugger I can see that the artifacting is there from OnDrawOpaqueObjects onwards, (so it's not caused by post processing or a renderer feature, or anything like that.). the previous step (DrawDepthNormalPrepass) as well as the normals/SSAO also look fine so it isn't anything before OnDrawOpaqueObjects either.
which doesn't really tell me anything directly but does narrow it down a bit.

#

also, none of the details look different between a frame that has the issue and a normal frame, at least as far as I can see

#

looking at the mesh details for meshes that are clearly affected, their normals/uvs look fine so it's not that

stone pawn
#

Is that forward or deferred rendering?

wise kettle
#

Forward+

stone pawn
#

Then your mesh draw call must be missing the light source data for some reason. To investigate deeper, you'll need PIX or render doc and to output the shader debug symbols.

#

Something to check in the editor:

  • add a default unscaled sphere/cube in the light source area next to your object. See if it also stops being lit at the same time.