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.

Cam flickering (vibrate) every 2-5 seconds

Discussion in 'iOS and tvOS' started by scinfu, Dec 3, 2010.

  1. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404

    Attached Files:

  2. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
  3. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    A new test Tunnel runner exemple projet of unity !!! you can see the flick on device but also in editor but less
     

    Attached Files:

  4. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    other test , install on idevice and look at the bottom of the screen
     

    Attached Files:

  5. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,430
    I haven't checked but often a shaky camera is fixed if there is a physics sim in progress by putting it in FixedUpdate rather than Update.

    HTH
    BTH
     
  6. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    thank you for reply but i have already use FixedUpdate but is the result .
     
  7. KITT

    KITT

    Joined:
    Jul 17, 2009
    Posts:
    221
    Have u installed newest Unity build 3.1.4f I think ? I read somewhere that the hotfix cured some in editor flickering?
     
  8. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    yes i have , but this issue in also in 1.7 , 3.0 , 3.1 and now 3.1.0f4 (55865) ...

    Do you have install the test package ?
     
  9. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    New test using code founded in documentation :
    file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Material-mainTextureOffset.html

    Code (csharp):
    1.  
    2. var scrollSpeed : float = 0.5;
    3.  
    4. function Update() {
    5.     var offset : float = Time.time * scrollSpeed;
    6.     renderer.material.mainTextureOffset = Vector2 (offset, 0);
    7. }
    8.  
     

    Attached Files:

  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,091
    Use interpolation on physical objects to remove stutter or jerking.
     
  11. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    in the game there is not any physical objects , this is a bug in the rendering engine .

    in the last test the cam do not move , there is only a scrolling texture .
     
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,091
    1. check you are using floats to scroll
    2. make sure you multiply it by delta time

    If you don't, it'll look crap. Doesnt seem like a bug to me, just you're not coding it right.
     
    Last edited: Dec 5, 2010
  13. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    with this new code here the same result !!!

    Code (csharp):
    1.  
    2. private var speed : float = 1 ;
    3. private var offset : float = 0 ;
    4.  
    5. function Update() {
    6.     offset += Time.deltaTime*speed ;
    7.     renderer.material.mainTextureOffset = Vector2 (offset, 0);
    8. }
     
  14. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    Up Up Up Up
     
  15. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,430
    I haven't looked at the package but since it is intermittent and you are scrolling through a texture that perhaps it gets to the end and reloads the texture instead of reusing it? Just a shot to try and pinpoint the cause.

    HTH
    BTH
     
  16. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    the last package is only a test without moving the main camera ... in my game i move the Cam.

    Can you install it to see ?
     
  17. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,430
    I have it running right now with no flicker at all. It is three layers of checks moving past each other at different rates and I get 2500+ FPS. One draw call, Batched = 3, VRAM at 5.3MB. I am on OS X and this was with Unity 3.0f1.

    HTH
    BTH
     
  18. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    the problem is on device(ipod 4gen) but i undesrtand why make me this problem if i use 2d i neeed to use this setting on controllor.mm
     
unityunity