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. Dismiss Notice

Major Lag with Shader on Android

Discussion in 'Scripting' started by Mashimaro7, Nov 30, 2020.

  1. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    723
    I have a fairly basic shader, I made it following Unity's 2D shader tutorial, with a few minor adjustments. But when I tested it on my phone, I probably get 10fps, if even. Here's my shader graph

    https://imgur.com/a/atFlWIk

    It's only really 2 noise textures and a main texture. It could very well be just because my phone is terrible lol, it runs just fine on my friend's phone, but does anyone have any ideas on how to improve performance, preferably without lower the quality of the shader? I tried disconnecting some parts, the main lag seems to be coming from the bottom set, with the simple noise, but even with it disabled it doesn't improve performance too much. I've tried going through and disabling/enabling specific nodes, it seems to be causing lag no matter what I do, but if I remove the background(which the shader is attached to) it runs fine.

    Thanks
     
  2. Ervo

    Ervo

    Joined:
    May 26, 2016
    Posts:
    8
    Same problem here, I think Android doesn't like procedurally generated noises
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,004
    It's not about Android not liking stuff, it's about this stuff being fairly performance intensive and I doubt the shader graph generates optimal "cheat-y" code to make this stuff viable on mobile.
     
    Ervo likes this.