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

Question Sprites Leaves trace on screen!

Discussion in '2D' started by hoshicameron, Jan 16, 2023.

  1. hoshicameron

    hoshicameron

    Joined:
    Dec 20, 2015
    Posts:
    14
    Hi, I Have this weird problem with Android Build of my game on low spec phones,
    Settings :
    - Render Pipeline: URP
    - Post Processing effects: Only bloom
    - Sprites has 2 shaders: Glow and Inner Out Line
    - Quality Settings: Low Quality (Unity Default)
    - Player Settings: Fixed Dpi(240) - Gamma color space- OpenGLES3-IL2CPP-Armv7
    I tried various setting (Volkan-OpenGLES2)-(all Quality Settings) but problem still exists.
    IMG-20230115-WA0030.jpg Screenshot (352).png IMG-20230115-WA0030.jpg Screenshot (352).png IMG-20230115-WA0030.jpg Screenshot (352).png IMG-20230115-WA0030.jpg Screenshot (352).png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,954
    Feels like maybe your camera (or one of your cameras) isn't set to clear fully to either background color or skybox?

    What is in the scene if you press pause while playing and go look around? How about it if while paused you drag a cube in place and wiggle it in front of the Camera? Does that leave streaks?
     
  3. hoshicameron

    hoshicameron

    Joined:
    Dec 20, 2015
    Posts:
    14
    It's only happening on android build and low spec phones, There is no problem in unity and windows build or mid/high spec phones, So I can't do the test that you mention above. the camera clear flag set to Solid Color and I tested background color with full alpha also but no difference! Sorry I'm not good at English.
     
  4. hoshicameron

    hoshicameron

    Joined:
    Dec 20, 2015
    Posts:
    14
    I Also tried it with default sprite lit shader and no post processing and problem still exists.
     
  5. hoshicameron

    hoshicameron

    Joined:
    Dec 20, 2015
    Posts:
    14
    I found the Solution and the problem is the Noise (Basic Multi Channel Perlin) that I used for Simulating Shake feedback, without this feedback there is no problem and everything is run so smooth. I really appreciate if someone from cinemachine development team consider this bug ( if it's a bug!) and help me with this. maybe I want to use this feedback in another game.

    Shake script:

    Code (CSharp):
    1. public class ShakeCinemachineFeedback : Feedback
    2.     {
    3.         [SerializeField]
    4.         private CinemachineVirtualCamera cinemachineCamera;
    5.         [SerializeField]
    6.         [Range(0,5)]
    7.         private float amplitude = 1, intensity = 1;
    8.         [SerializeField]
    9.         [Range(0,1)]
    10.         private float duration = 0.1f;
    11.  
    12.         private CinemachineBasicMultiChannelPerlin noise;
    13.      
    14.         private void Awake()
    15.         {
    16.             if (cinemachineCamera == null)
    17.                 cinemachineCamera = FindObjectOfType<CinemachineVirtualCamera>();
    18.             noise = cinemachineCamera.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
    19.         }
    20.         public override void CompletePreviousFeedback()
    21.         {
    22.             StopAllCoroutines();
    23.             noise.m_AmplitudeGain = 0;
    24.         }
    25.  
    26.         public override void CreateFeedback()
    27.         {
    28.             noise.m_AmplitudeGain = amplitude;
    29.             noise.m_FrequencyGain = intensity;
    30.             StartCoroutine(ShakeCoroutine());
    31.         }
    32.  
    33.         IEnumerator ShakeCoroutine()
    34.         {
    35.             for (float i = duration; i > 0; i-=Time.deltaTime)
    36.             {
    37.                 noise.m_AmplitudeGain = Mathf.Lerp(0, amplitude, i / duration);
    38.                 yield return null;
    39.             }
    40.             noise.m_AmplitudeGain = 0;
    41.         }
    42.     }
     
    Last edited: Jan 17, 2023