Search Unity

Screen position out of view frustum

Discussion in 'Editor & General Support' started by flatliner, Apr 3, 2008.

  1. flatliner

    flatliner

    Joined:
    Jan 21, 2008
    Posts:
    15
    Screen position out of view frustum (mouse pos 256.000000, 0.000000, 1000.000000) (Camera rect 0 0 256 256)
    UnityEngine.Camera:Render()
    Water:OnWillRenderObject() (at Assets/Pro Standard Assets/Water/Sources/Water.cs:97)

    [/Users/unity-build/Desktop/automatic-build-2/unity/Projects/../Runtime/Camera/Camera.cpp line 895]

    Hi,

    Can someone please explain what this error means, and what i have to do to get rid of it?

    It is driving me mental!

    Thanks
     
    ibyte likes this.
  2. DGuy

    DGuy

    Joined:
    Feb 7, 2007
    Posts:
    187
  3. enriqueflores

    enriqueflores

    Joined:
    Jul 25, 2014
    Posts:
    6
    aaronfranke likes this.
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  5. LucianoMacaDonati

    LucianoMacaDonati

    Joined:
    Dec 31, 2012
    Posts:
    10
    Right click on the Scene tab and close it, then right click on any other tab and open the scene tab again. That fixed it for me.
     
  6. UmbrAtroX

    UmbrAtroX

    Joined:
    Jul 25, 2012
    Posts:
    3
    My camera hasn't cero size and reopen Unity didn't work for me. My solution was to delete the main camera and create new one.
     
    AsclepiiusUnknown and lliviu like this.
  7. vikaspant619

    vikaspant619

    Joined:
    Jan 29, 2015
    Posts:
    1
    Created The new Camera and deleted the previous one..And the error seemed to go for now
     
  8. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    181
    This worked!
     
  9. zaibi299

    zaibi299

    Joined:
    May 6, 2016
    Posts:
    1
    THANKS THIS WORKED FOR ME :)
     
    shieldgenerator7 and nokkun0319 like this.
  10. simulism

    simulism

    Joined:
    May 11, 2016
    Posts:
    14
    Only works for me while the scene tab is closed, the error returns if I reopen the tab.
     
    Edelplastic likes this.
  11. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    in my movement script I use a Vector3 called moveDirection. Normally I would start by zero'ing this out. I added a line that was not zero'ing it out always, and the gravity line that applied gravity per Update was throwing the player + camera out of bounds in only a couple frames (it looks like) once I started zero'ing the moveDirection again the error went away.
     
    Last edited: Jun 8, 2016
    AsclepiiusUnknown likes this.
  12. H4CK3RD4WG

    H4CK3RD4WG

    Joined:
    Mar 31, 2015
    Posts:
    2
    This was the case for me as well. Must have something to do with the scene camera not liking what the game code is doing. Presumably the errors would go away if you built and ran the game... but still annoying for working in the editor. Any ideas on how to fix this?
     
  13. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    No, they would not, you will have same error in the build, as well.
     
  14. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    ...I get this only under SOME editor (& ingame) camera angles (regardless to water foam),
    and only at SOME editor (& ingame) camera heights (roughly from 1000m to 2500m above
    water foam(s) that i use... I get same tearing in the build, as well (the same).
    I assume it's: either (infamous) Intel's Z-buffer issue, or some of scripts causing it...
    Also: unity's editor, or engine has no any way (yet) of diagnosing / addressing such
    stuff, which will be essential to implement i guess: hey, it's work with Camera's !
    AND: none of things said above on this thread can help, in our case yet, in our scene.

    Unity5-EditorCamera-WaterFoamTearing.JPG
     
    Last edited: Aug 31, 2016
  15. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    English, please. If you run into any solution, explain it properly (this is not it).
     
  16. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    There are more than one causes for the same problem. In my case it was the camera going out of the bounds of the engine's math. My scripting initialy reset the Vector3 used to predict the camera's next location, but amidst a bunch of changes I accidentally commented that line out so the Vector3 was being multiplied against itself every frame and only took 3-4 frames to go way outside of the math boundaries.
    That was what was throwing the error for me, so fixing the math solved the problem.
    For other people using zero's in their math like a near clipping plane of zero throws the error, but some people seem to have non-math-related problems as well, so it's hard to tell what's going on without looking at each case.

    The tearing on your GameObjects is common and I never fixed it properly. If you up the near clipping plane to 20 just for testing you'll see a big change.... Of course that's not a solution, and I don't fully understand why that change fixes whatever math is being used to figure out which mesh comes first... sorry.
     
  17. ImranCh

    ImranCh

    Joined:
    Dec 30, 2016
    Posts:
    5
    Screen position out of view frustum (screen pos 0.000000, 0.000000, 46027.906250) (Camera rect 0 0 256 256)
    UnityEngine.Camera:Render()
    UnityStandardAssets.Water.Water:OnWillRenderObject() (at Assets/Water/Water/Scripts/Water.cs:109)
    UnityEditor.DockArea:OnGUI()

    Having this error in Water script, which is slowing down my game play very badly. Just switched my scene window into 3D view from 2D view. And got it resolved.
     
    graham30 and SyfyKitty like this.
  18. ImpOfThePerverse

    ImpOfThePerverse

    Joined:
    Sep 27, 2017
    Posts:
    1
    I was having this error when accidentally applying a huge force to the player (what the cameras were attached to.) I'd misplaced some parenthesis and was multiplying its magnitude by ~2000 instead of dividing.
     
  19. hardartcore

    hardartcore

    Joined:
    Jan 27, 2017
    Posts:
    43
    I've done all the other stuff which I found over internet, but never thought that the old GOLDEN rule from "IT CROWD" will be the best answer here!
    Nothing else worked, even deleted Unity and downloaded again, but I guess it kept it's settings somewhere...
     
    Last edited: Feb 1, 2018
  20. Nazowa

    Nazowa

    Joined:
    Oct 30, 2017
    Posts:
    15
    Getting thousands of these errors:

    Assertion failed: Screen position out of view frustum (screen pos 795.000000, 0.000000, 1000.000000) (Camera rect 0 0 795 415)
    UnityEngine.Camera:Render()

    Assertion failed: Screen position out of view frustum (screen pos 0.000000, 415.000000, 1000.000000) (Camera rect 0 0 795 415)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Any solution from Unity ?
     
  21. rew2402

    rew2402

    Joined:
    May 10, 2017
    Posts:
    2

    any updates on a solution for this problem?
     
    Ontario and AbgaryanFX like this.
  22. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    Getting these messages in WebGL...
     
  23. ProFive

    ProFive

    Joined:
    Jul 14, 2013
    Posts:
    1
    I have same the problem when export view to WebGL. I using two view to between view WebGL and data information. I want to keep content on WebGL. So I set style="display:none" to change view.

    blob:Screen position out of view frustum (screen pos 0.000000, 0.000000, 5000.000000) (Camera rect 0 0 0 0)
    (Filename: Line: 3124)

    Do you have any updates on a solution for this problem?
     
  24. HZ51

    HZ51

    Joined:
    Jul 28, 2016
    Posts:
    42
    The same problem here :(
     
  25. UXeyeway

    UXeyeway

    Joined:
    Jan 22, 2018
    Posts:
    10
    I'm also getting this error, tried all the suggested fixes with no success
     
  26. UXeyeway

    UXeyeway

    Joined:
    Jan 22, 2018
    Posts:
    10
    [SOLVED] - I found that the camera fov was set to 0 in code and that caused the error
     
    Ermdad likes this.
  27. LIFANOUG5

    LIFANOUG5

    Joined:
    Jan 29, 2018
    Posts:
    1

    like
     
  28. unity_Ks6ENYm8_Eqiqw

    unity_Ks6ENYm8_Eqiqw

    Joined:
    Feb 26, 2018
    Posts:
    1
    it works
     
  29. rugbbyli

    rugbbyli

    Joined:
    Mar 14, 2017
    Posts:
    6
    getting this error in our release product's log (android and ios), is this a unity bug?
     
  30. bharanidharan7897

    bharanidharan7897

    Joined:
    Jun 27, 2018
    Posts:
    1
    Screen position out of view frustum (screen pos 0.000000, 0.000000, 30.000000) (Camera rect 0 0 2416 1154)
    i can't solve this error any one please tell how to clear the error?? plz update soon
     
  31. Idanlau

    Idanlau

    Joined:
    Jul 12, 2018
    Posts:
    1
    thx bro it worked!
     
  32. tiagorpg

    tiagorpg

    Joined:
    Oct 24, 2016
    Posts:
    4
    i had this problem, in my case it was the camera size, that i set to 0 in a script
     
    mdimai666 likes this.
  33. mdimai666

    mdimai666

    Joined:
    Dec 12, 2017
    Posts:
    2
    Me too, that resolve problem
     
  34. writetoleopaul

    writetoleopaul

    Joined:
    Jul 6, 2018
    Posts:
    3
    Thanks a Lot .! Worked.
     
    strongBearCeo and Silvering like this.
  35. HeimerdingerBanana

    HeimerdingerBanana

    Joined:
    Dec 6, 2016
    Posts:
    1
    In my case error was caused by Unity Water free asset, it were spamming console while in scene 2D view. Solution for me was to change line 200 in PlanarReflection.cs file:

    reflectCamera.Render();

    to

    if (reflectCamera.rect.x != 0 && reflectCamera.rect.y != 0)
    {
    reflectCamera.Render();​
    }
     
    lameWorks, Melnikovv, chingwa and 5 others like this.
  36. jrock84

    jrock84

    Joined:
    Jan 13, 2016
    Posts:
    38
    For anyone getting this when using reflection in Aquas from the Asset Store, HeimerdingerBanana's solution also works for it. It's near line 100 in AQUAS_Reflection.cs if you want to modify that bit of code.
     
  37. Chris45215

    Chris45215

    Joined:
    Jan 30, 2016
    Posts:
    16
    I just got this problem after updating to version 2018.3, in a project that uses Oculus for VR. The Oculus SDK currently has its own compatibility issues with 2018.3 which may or may not be related (I resolved that by switching to SteamVR and removing all Oculus components). I tried all the above solutions where possible but none of them resolved the issue.
    The issue was resolved after I disabled the existing [CameraRig] in the hierarchy, and dropped a new instance of that prefab into it. I don't know why this worked, as the only differences I could see are two values in the Steam VR_Play Area script (in the new instance, Draw In Game was unchecked and Size was set to 300x225). Or it might be related to the fact that the SteamVR folder (for me) is a sub-folder of another asset that I purchased for the project. I can't think of any reason that these differences would be relevant, but maybe that information can help someone else facing the same issue. I'd suggest restarting Unity and trying the trick of closing then re-opening the Editor tab first, as those steps might have been necessary in the process.

    Also, for anyone else dropping the Oculus SDK for the SteamVR one, they need to go to Window->Package Manager and download the OpenVR standalone package from there - note that this is called OpenVR rather than SteamVR. You may also need to highlight the Oculus package in this window and click the Remove button to fully remove the Oculus components. If they encounter the additional issue that the Package Manager is not available from that Window button, I suggest closing Unity, starting Unity again, and creating a new project. Hopefully that new project will have the package manager available under Window; and when you switch back to your intended project the button may still be available. If that fix doesn't resolve it, then the problem is outside my experience.
     
  38. alexxx9799

    alexxx9799

    Joined:
    Jun 27, 2018
    Posts:
    30
    thanks!
     
  39. leedeedesigner

    leedeedesigner

    Joined:
    Jul 31, 2018
    Posts:
    3
    I was using the water4advanced and put this code into the planarreflection script and IT WORKED thank you sooo much :)
     
  40. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    This indeed removes the error, but sadly also removed the water reflection in my project.
     
    Willbkool_FPCS likes this.
  41. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    169
    Yes, the same thing happened to me. Only the sunlight shows on the water plane now.
     
  42. masterchop

    masterchop

    Joined:
    Oct 9, 2015
    Posts:
    39
    I have this problem but i am using a VR object so i cant remove oculus SDK from the VR settings. I need a solution to use the oculus SDK and a VR object.
     
  43. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    also having the same problem using aquas, i find it funny that the maker of aquas is saying this is a unity problem not aquas, so how come if i disable the reflection script in aquas i dont get the error. there is a code fix around the internet for the water.cs script of the unity water, this script is what the aquas reflection script seems to be part based on so maybe someone can convert it to work with the aquas reflection script i will include the fix for the original water script here.

    i found it on another thread and the heading was this: blenderbug

    "Screen position out of view frustum" error only shows up when at least 2 of the 3 rotation vectors are 0 on the mainCamera. Here's the fix inside of Water.OnWillRenderObject()

    Code (CSharp):
    1. Camera reflectionCamera, refractionCamera;
    2.             CreateWaterObjects(cam, out reflectionCamera, out refractionCamera);
    3.             // find out the reflection plane: position and normal in world space
    4.             Vector3 pos = transform.position;
    5.             Vector3 normal = transform.up;
    6.    
    7.             //avoid frustum error ugh
    8.             bool FrustumError = false;
    9.             int zeroVectors = 0;
    10.             if (cam.transform.rotation.x == 0)
    11.                 zeroVectors++;
    12.             if (cam.transform.rotation.y == 0)
    13.                 zeroVectors++;
    14.             if (cam.transform.rotation.z == 0)
    15.                 zeroVectors++;
    16.             if(zeroVectors >1){
    17.                 FrustumError = true;
    18.             }
    19.             // Optionally disable pixel lights for reflection/refraction
    20.             int oldPixelLightCount = QualitySettings.pixelLightCount;
    21.             if (disablePixelLights)
    22.             {
    23.                 QualitySettings.pixelLightCount = 0;
    24.             }
    25.             UpdateCameraModes(cam, reflectionCamera);
    26.             UpdateCameraModes(cam, refractionCamera);
    27.             // Render reflection if needed
    28.             if (mode >= WaterMode.Reflective && !FrustumError)
    29.             {
    30.                 //end of avoid frustum error ugh
    31.                 // Reflect camera around reflection plane
    32.                 float d = -Vector3.Dot(normal, pos) - clipPlaneOffset;
    33.                 Vector4 reflectionPlane = new Vector4(normal.x, normal.y, normal.z, d);
    34.  

    there must be a way to fix this for aquas cause how can we release a game with this bug, if this happens in a final build will it stop the game or will it be ignored?
     
  44. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    169
    This is definitely a game-buster issue. This post above Screen position out of view frustum fixes the error but removes the reflections.

    I'm not sure if it will happen in a build.
     
  45. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    I think this is very odd as it is claimed the error happens when 2 or more axis are at zero, but when your game starts the aquas reflection camera is already set to 0,0,0 and does not cause the error straight away,, i have tested a build of my project and it has runn for 90 minutes with no crash and i know that i have never been able to run the project for more than 10 minutes without the error in the console so i am sure that it is not a problem that will crash a game after build, but still annoying that there seems to be no fix for it
     
    Willbkool_FPCS likes this.
  46. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    I wish the developer could fix this... otherwise I'll need to find another water solution, despite having purchased Aquas. A pity but what else can we do.
     
  47. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    last night i did post on the unity aquas forum about this, the developer just says its a unity problem, but there is a fix for the water.cs script that he has used and adapted for the reflection script of aquas, so if a fix is available for the original, how come he can not fix his version.

    it is about time either the developer or unity sorted this out, they can not even give us asurance that the error will not cause a crash in a build, so how are we to sell a game with this problem, i do know that it can be present even using the unity standard water but it must be fixable somehow.
     
    Last edited: Sep 22, 2019
  48. Deleted User

    Deleted User

    Guest

    this error occured in my work because one of my scripts changed camera orthographic size to 0 or any unacceptable character
     
    dylan-hart likes this.
  49. diseno24horas

    diseno24horas

    Joined:
    Nov 19, 2019
    Posts:
    1
    buen día, leí tdos sus comentarios y le di muchas vueltas al programa para solucionarlo. Al final le di 2 clics seguidos al objeto en la "hierarchy" y la cámara regresó a como estaba antes de marcar el error.

    Good day, I read all your comments and went around the program many times to solve it. In the end I gave 2 clicks in a row to the object in the "hierarchy" and the camera returned to the way it was before marking the error.

    Saludos
     
  50. mallikebadata

    mallikebadata

    Joined:
    Sep 20, 2019
    Posts:
    2
    Hi, have you enabled the GIZMOS ?
    Try turning it off and see.