1
\$\begingroup\$

i create a simple 2d scene in unity 2017.3.1f1

I changed the size (height and width) in the Game View and proflie to see how it affects the rendering.. (below photo) enter image description here

I saw that the rendering time increases by increasing size, and now if this happens when playing the game on a different resolution android phone, each The higher the resolution of the phone, the more likely it is to get gpu bound !???

And i do not understand Cpu graph in the two situations in above photo(lower GPU ---> higher CPU !!!)

I tested my game on the "huawei mate 10 lite"(android device) with a resolution of 1080 x 2160 and it looks like there is a lot of rendering time.(a simple scene with only 5 sprite renderer)

(unity dosen't show GPU profiling when game run on android device and we can't check these...)

I did all the optimizations I heard, like:

DynamicBatching, Sprite Atlas , Quality Setting , sprite Texture Comprestion Override for Android.. What can be done to ensure that rendering time does not exceed a specified limit on different phones ??

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You should really brush up on how graphics processing works. Of course with screen "resolution" it will take more time to process the graphics since there are more data points. This doesn't mean that you have a bigger screen though, a 1080p resolution can be used on almost any device nowadays. Your computer with a 30 inch monitor doesn't use more resources than a 6 inch screen that your phone has if they are using the same resolution (for graphics processing). For your last part, you should look closer at the graphs. Your CPU is basically using the same amount of time in both cases. \$\endgroup\$ Jan 28, 2019 at 5:36
  • \$\begingroup\$ @JohnHamilton thank john ... the scene is very simple And has only 3 batch !! how can i optimize for higher resolution? \$\endgroup\$
    – sam
    Jan 28, 2019 at 8:38
  • \$\begingroup\$ There's a minimum amount of time it will take for the GPU to update graphics, even if you optimize everything, there's a number you cannot go below for every resolution. Try a blank scene, you will most likely get a similar performance change between 1440p and 480p. Some things are just not in the realm of optimization by the coder's part. I'm not saying you can't optimize things further, you seem to get spikes periodically on the "other" part of your GPU process, maybe look into that and try to optimize that part. Though overall (imo) if you have 60fps on 1440p then that's as good as it gets. \$\endgroup\$ Jan 28, 2019 at 10:21
  • \$\begingroup\$ @JohnHamilton ok maybe a blank scene can show some GPU usage but i ask myself : if i can't do nothing for this simple scene how could i think about more complex scene?! i see some complex game that run smoothly on high resolution mobile ! Did I ignore a point? \$\endgroup\$
    – sam
    Jan 28, 2019 at 15:59

1 Answer 1

1
\$\begingroup\$

In your GPU there's a thing called fragment shader which gets executed for each pixel. Fragment shader does some calculation to determine the colour for a pixel. The complexity of this shader varies based on what you are trying to achieve. Generally It has to consider the lighting in the scene and everything that affects the look of the pixel.

so if you are running your game at 5x5 resolution then 25 fragments shader will get executed. You see, Processing takes time so the more pixel you will throw to the GPU the more fragment shader will get processed.

You should take a look into this awesome tutorial before jumping into profilers and stuff : https://learnopengl.com

\$\endgroup\$
2
  • \$\begingroup\$ Thank you for that link. I will check it out, I know that high resolution means more pixels for drawing, but I do not know what can i do for it !? \$\endgroup\$
    – sam
    Jan 28, 2019 at 16:08
  • \$\begingroup\$ I don't have much knowledge in unity context. Just don't give up. \$\endgroup\$ Jan 29, 2019 at 4:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .