android - Libgdx - rendering many small sprites VS a few big ones -


i working on effect game have several (200) stars coming edges of screen, moving towards middle while fading out.

i want render each star on own (as it's own object) stars can have randoms speed, fade times, size , position. i'm afraid might effect older phones in performance, change alpha , rendering 200 sprites each frame 20 seconds (i recreate them when fade out).

as alternative use larger chunks of stars same sprite (one image) means i'll have sacrifice random effects , stars fade out @ same time, obv won't good.

i have no way test on older phones i'll ask here, looping through 200 sprites each frame (small images alter alpha each frame , position)? there alternative doesn't force me give random behaviour of each star? or have bite bullet , render larger images (maybe 3-4 different images several stars in each)?

you try flyweight pattern, explanation , tutorial found here. have default model of sprite (in case, star) , draw @ different positions.

you don't have sacrifice random effects mention, have adapt model each object can have fade out effect @ same time. in appended example, vary position of mesh guess expand allow vary other parameters.

also, check this part of libgdx wiki talk performance tuning.

another option check app performance (use of cpu, gpu, memory, of ide's have tools measure this) , compare old phones performance stats.

however, if want include old phones, guess have test app in models.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -