Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

screenviewcoord[1] < 0 || screenviewcoord[3] < 0

Discussion in 'Editor & General Support' started by mayekol, Sep 17, 2009.

  1. mayekol

    mayekol

    Joined:
    Oct 23, 2007
    Posts:
    115
  2. eduardo-pons

    eduardo-pons

    Joined:
    Mar 31, 2009
    Posts:
    176
    Same problem here!
    I`m calling for GL.SetViewport but I`m watching the Rect values in order to avoid negative/zero values...

    Yet it occurs!
     
  3. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    When you see the word "assert" in an error message, it means an internal error with Unity itself. It would be very helpful if you could use the Report Bug app to notify the developers of this problem.
     
  4. eduardo-pons

    eduardo-pons

    Joined:
    Mar 31, 2009
    Posts:
    176
    Yep I saw that it was internal...

    Unfortunally that assert is giving my application nice milisseconds of lag as many of my elements sets the viewport...

    Well.. sending Bug Notification anyway!

    Thanks!
     
  5. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    So, you're saying the assert even fires in the built application, not just the editor?
     
  6. eduardo-pons

    eduardo-pons

    Joined:
    Mar 31, 2009
    Posts:
    176
    If the StackTraceUtility is called inside unity and this generates a outputlog.txt then it's possible that this warning/error of viewport can be called in both Editor or .exe version!

    I have around 200 assets being drawn in the scene.. and all of then sets the viewport in order to push/pop display state.. so if every one generates this warning.. 200 "Debug.Log"-like calls will be made.. even on a .exe player I think...
     
  7. kijun

    kijun

    Joined:
    Jul 26, 2010
    Posts:
    8
    I've also reported this issue, but haven't received the feedback yet. Has anyone gotten updates on this?
     
  8. JRL

    JRL

    Joined:
    Sep 2, 2010
    Posts:
    8
    Hi. I've been having the same error message with some dire consequences. Unity stops working, my computer freezes and on reboot I get a corrupted disk message and the computer freezes. The only option is to reboot in safe mode and do a system restore. This solves the problem. Anyway I found the problem in my app so maybe it will help you all.
    I am new to Unity and have been evaluating/messing with it using the car tutorial. I moved the main camera into the car(car is parent) to create a FP view. The car.js creates a camera cubemap inside the car and the C# script "Generate 2D Reflection.cs" (a standard asset??) manually renders it in the UpdateReflection() routine. There's a coding error that makes 2 calls to:
    go.transform.position = transform.position + Vector3.up * 0.5f;
    go.transform.LookAt(Camera.main.transform);

    What seems to be happening is the two cameras are on top of each other and the LookAt function goes foobar. If I move the main camera far enough away, the problem doesn't happen. I move it back and problem recurs. Hope this helps.
     
  9. eduardo-pons

    eduardo-pons

    Joined:
    Mar 31, 2009
    Posts:
    176
    First the cause!

    1) It occurs when we call GL.Viewport()
    2) It is related to the "y" attribute of the passed Rect
    3) If you specify any viewport height and you set the viewport y to a position bigger than (Screen.height + viewport.height)

    100% sure that you will get this error

    So to fix it I clamp the viewport.y in this way

    viewport.y = Mathf.Min(viewport.y,Screen.height+viewport.height);


    Now I'm happy.. after at least one year :)
     
  10. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    i'm having this problem too but I'm not calling GL.Viewport!

    I've just updated to 3.2.0 and it happens on every single scene in my project as soon as i open it for 2/3 times and continuosly when I hit the play button!

    it's really annoying, the project was working just fine without a single error before the update

    here's my error
    Code (csharp):
    1.  
    2. screenviewcoord[1] < 0 || screenviewcoord[3] < 0
    3.  
    4. Assert in file: C:/BuildAgent/work/f724c1acfee760b6/Runtime/Camera/CameraUtil.cpp at line: 38
    5.  
    when i open a scene i get this error too

    Code (csharp):
    1. screenviewcoord[1] < 0 || screenviewcoord[3] < 0
    2. UnityEditor.DockArea:OnGUI()
    3.  
    4. Assert in file: C:/BuildAgent/work/f724c1acfee760b6/Editor/MonoGenerated/Editor/AssetDatabase.cs at line: 106
    5.  
    I think I'll have to revert back to 3.1.0 until this won't be fixed, cannot do a build with this error spammed continuosly at runtime.
    any link for it?

    EDIT:

    I've found out that is because of a rendertexture.
    I've got an additional camera in all my scenes that render to texture leaving the camera in the scene and just removing the target texture will fix the error!

    any thoughts?

    EDIT 2:
    it's the render texture height, i've tried with a new rendertexture and the height have to be set <=256, any value above it will produce the error.
    no problems with the width
     
    Last edited: Feb 16, 2011
  11. JFo

    JFo

    Joined:
    Dec 9, 2007
    Posts:
    217
    We just hit this also after upgrading to 3.2. It is related the use of render to texture as you have found out.
    Have not yet tested to set the height <= 256 as that will broke our scenes.

    Any ideas, Unity Team?

    BR,
    Juha
     
  12. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    Having the same problem here with rendertexture height 256 and higher.
     
  13. Thelo

    Thelo

    Joined:
    Sep 13, 2009
    Posts:
    98
    I also get this problem, and yes it's tied to large RenderTextures. There is no problem when published to webplayer, but within the editor, the console gets spammed with that assert.

    Here's what it looks like on my project:

    screenviewcoord[1] < 0 || screenviewcoord[3] < 0
    UnityEngine.Camera:Render()
    CardRenderer:RenderCard(RenderTexture, Boolean) (at Assets/Scripts/CardRenderer.cs:1401)
    CardRenderer:RenderCard(RenderTexture, Boolean, Card) (at Assets/Scripts/CardRenderer.cs:1392)
    YomiGameViewer:UpdateAllTexScale() (at Assets/Scripts/YomiGameViewer.cs:2188)
    YomiGameViewer:Update() (at Assets/Scripts/YomiGameViewer.cs:944)
     
    Last edited: Feb 10, 2011
  14. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    any official answer on this?
    should we expect an update in the short term or it's better to revert to 3.1 for the time being?
     
  15. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    I'm also getting this error in 3.2, when I try to use rendertexture. Everything was working fine in 3.1
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    In my case, any renderTexture over 512pixels gives me this error.
     
  17. JFo

    JFo

    Joined:
    Dec 9, 2007
    Posts:
    217
    Has anyone sent an official bug report about this issue?
    Or heard any info from Unity support?
     
  18. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
  19. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    still no answer from unity? really?
    I've reported a bug last week, no sample was attached but it's quite easy to add a rendertexture in a scene...

    does anyone have a link to the latest 3.1?
    this is blocking me to do new builds of the game.
     
    Last edited: Feb 14, 2011
  20. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    another day has passed by and still no a single answer...
    is it maybe because the starter post is from 2009?

    should we open a new thread with "3.2" in the title to ask for some attention?
    is anyone reading this?
     
  21. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Do you call your Rendertexture's Camera.Render outside of a Update/Start loop ?
     
  22. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    I'm not calling any Camera.Render
    as I'm not the only one with this issue, it seems like that with unity 3.2 you can't simply use rendertexture with an height >256
     
  23. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Ok. Sorry I dont' know what's going on, but just FYI I'm using 512x512 textures (by packs of 6) with rendertextures, and there is still no problem at all for me in 3.2.
     
  24. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    yeah for another user too in the previous page it works up to 512, anything above will produce the error.

    don't why for some of us the limit it's 256 and for some other ones it's 512.
     
  25. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    I'm running Unity on a 1920x1080 desktop if it can help.
     
  26. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    can you please try setting the rendertexture height to 1024 (or even 2048) and see if it cause the error? cheers
     
  27. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Would be better to file a bug case I think.
     
  28. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    I've already done it a week ago, still no answer here..
     
  29. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
  30. Angrycrow

    Angrycrow

    Joined:
    Jan 29, 2011
    Posts:
    34
    Maaan! I can't even see objects in my scene because of this viewport issue!
     
  31. yuzu_drink

    yuzu_drink

    Joined:
    Jan 15, 2012
    Posts:
    14
    I get this message when I STOP the simulation, and I'm not doing any render-to-texture or viewport access or anything like that. :\

    --edit-----
    It is caused when I set a constant aspect ratio to either 16:10 or 16:9, and none of the other preset ratios.
     
    Last edited: Feb 2, 2012
  32. thesfid

    thesfid

    Joined:
    Oct 19, 2010
    Posts:
    12
    Having this same error with "screenviewcoord". I am not using RenderTexture in any of my scripts. There are, however, a handful of cameras that are activated/deactivated with buttons clicks (not sure if that helps).

    It only pops occasionally and I can't consistently reproduce it, also doesn't seem to be affecting performance at all.

    It only happens when I stop the preview/play of my scene.

    Running Unity Pro 3.5.2f2 on Windows7 64 bit with nVidia Quadro FX 3700M.