- Home /
What is causing the Abs(dist - shadowRadius ) error?
The error doesn't seem to happen while I'm preview/playing my scene, only when I'm navigating my scene in the editor. Since it's an "assert in file" error I'm having a hard time tracking down the culprit.
The error doesn't seem to affect performance (since the scene isn't running when the error pops), and I can clear the error from the console immediately after it pops.
Haven't been able to find any info on this error in my web and forum searches. Any help is greatly appreciated.
Here is the complete error:
Abs(dist - shadowRadius) < 0.001f * shadowRadius
UnityEditor.Handles:Internal_DrawCameraWithGrid(Camera, Int32, DrawGridParameters&) UnityEditor.Handles:DrawCameraImpl(Rect, Camera, DrawCameraMode, Boolean, DrawGridParameters, Boolean) (at C:/unity/Editor/MonoGenerated/Editor/EditorHandles.cs:596) UnityEditor.Handles:DrawCameraStep1(Rect, Camera, DrawCameraMode, DrawGridParameters) (at C:/unity/Editor/MonoGenerated/Editor/EditorHandles.cs:612) UnityEditor.SceneView:OnGUI() (at C:/unity/Editor/Mono/SceneView/SceneView.cs:680) System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&) System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) UnityEditor.HostView:Invoke(String, Object) (at C:/unity/Editor/Mono/GUI/DockArea.cs:228) UnityEditor.HostView:Invoke(String) (at C:/unity/Editor/Mono/GUI/DockArea.cs:221) UnityEditor.DockArea:OnGUI() (at C:/unity/Editor/Mono/GUI/DockArea.cs:649) [C:/unity/Runtime/Camera/Shadows.cpp line 606]
edit
Discovered it's the one light that casts shadows in my scene that's causing the issue. I'd like to keep the shadows. There's got to be a setting somewhere that will alleviate this issue, right?
EDIT
My system info. I should have included this in the original post...
Unity Pro versions 3.5.2f2 and 3.3.0f3 (0) Dell Precision M6400, Win 7 Pro > 64 bit SP1 x2 Intel Q9100 @ 2.26 GHz , > 8GB RAM NVIDIA Quadro FX 3700M, 4GB > RAM, DirectX 11.0
I suppose this doesn't happen in a empty scene? I'm not sure what the problem is, Camera is mentioned in the error, maybe double-check the camera properties. If not, then there might be an asset that Unity doesn't like. $$anonymous$$aybe duplicate the scene and start deleting objects until the error goes away to see what's wrong?
Thanks for the reply Jessespike.
It's a pretty well-populated scene. I've been collaborating with another developer on this particular project, and he's not sure what the issue is either. This scene involves some camera switching from the main (perspective) view to L, R, F, B, and T (orthographic) views.
I'll try your suggestion on duplicating the scene and deleting things, however the error doesn't appear consistently. Sometimes it pops while working in the scene view of the editor, other times it pops as soon as I end the preview/play of my scene.
Just discovered one way I can get this error to show up. Clicking the Scene Gizmo to change the view causes this error to pop, sometimes 2, 3, or 4 instances of the same error with one click. edit Error only pops when going between ortho and perspective views.
It's a light in my scene. Still not sure why it's causing the error.
It's a Directional Light. Disabling shadows alleviates the error, but I want to be able to keep the shadows. $$anonymous$$ust be some setting somewhere to fix it...
I will upload a screenshot of this light's settings to the original question, maybe it will help.
Sorry for the barrage of comments on this...
Could it possibly be that some of the piping or support beams near the ceiling are too small to cast a shadow from that far away from the floor?
Answer by Loius · Nov 02, 2012 at 04:51 PM
I have literally no experience with this, but my one suggestion:
Is the light in exactly the same position as something else? Try nudging it to the side a bit. It sounds like something is trying to render a shadow within (too close) of the light source.
If that doesn't do anything, is the light aligned along an axis? (X/Y/Z rotations = multiples of 90) Try rotating it by a degree, maybe there's a divide-by-zero-style thing going on.
Thanks, Loius.
No, the light isn't overlapping any geometry. Interestingly enough moving the light around causes the error to pop constantly until the movement stops (using both the gizmo and entering values in the inspector).
Same story with the rotation. It was at 90,0,0 so I rotated it slightly.
Seems that any translation or rotation changes on this light will cause the error to pop (in addition to the scene viewport thing in a previous comment).
@Loiuzein, I may have to take back my previous comment. It looks like your solution (along with disabling a lot of objects' cast/receive shadows) has cleared the error up... mostly.
Rotated the directional light to (57, -23, 0) and I only get one error when I stop preview/play of the scene. The single error is
screenviewcoord[1] < 0 || screenviewcoord[3] < 0
This is much better than having 4 errors per second anytime I move the camera. Will do some more testing, then mark your answer as complete unless something else crazy happens. Cross your fingers for me!
That sounds like a low-level camera-render issue, but if it only happens when you go from the preview mode back to the editor, I'd say you shouldn't worry too much about it. You might send the project as a bug to Unity, especially if it's down to one error, and they might be able to solve whatever's going on.
Fingers crossed :)
What a strange and random solution. Though the errors have not completely stopped, they aren't flooding the console during runtime which makes me feel much better about things. Thanks for the suggestion, Loiuzein! I'm glad I tried this a second time.
I still get a blast of 6 or 12 Abs(dist - shadowRadius < 0.00af * shadowRadius errors when I use the viewport gizmo in the editor to switch from perspective to orthographic views. But again, those errors don't show up during runtime so they shouldn't affect the final build.
I may end up submitting a bug if I can get my Help>Report a Bug button to work (does nothing when I click it), and if my bosses clear me to send out these project files.
Thanks again!