Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 3D Optimizations?

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 4th Feb 2021 16:36
I am working on a 3D game for mobile and I am worried about optimization, the admin side of the game runs on desktop and gives me access to the level and item editors and on mobile it runs in game mode, while in the level editor on my old laptop with the more objects I add the slower it runs but on my S10 it runs lightning fast, sign of the times when my phone outperforms my laptop, aye!

I am Instancing objects and using a single shared texture, its all low poly but still to high poly for my laptop to render lots n lots so I am after some optimization tricks, how to achieve LOD in AppGameKit for instance or billboards, or do I just need to buy a new computer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 4th Feb 2021 20:50
Optimization are varied depending on the functions you use.
First off id say have a look at the 3D stats functions like GetPolygonsDrawn() GetShadowPolygonsDrawn() there are a few of them and not all in the one place.
Secondly AppGameKit will optimize by object not polygon so if you have a large object with many polygons it will draw the whole thing
In general though it's hard to know what can help without knowing more about your project
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 7th Feb 2021 15:59 Edited at: 7th Feb 2021 16:05
I am always after rendering a "huge" image of the background 3d items. Background meaning these are not dynamic right now to the player and or altough they are dynamic objects (moving rotatitng etc) they are not really in focus.

For me it depends on the game itself.

For example, long ago i built a simple "HeadSmashGame"
Where the figures needed to.get smashed rises behind some bushes. So.i trie simple low poly meshes and lots of them but they were really slow. And i needed to multiply it by 3 as there were 3 rows.
Eventually what i did was, I have added 10000 grass objects low med and high poly to the first row, rendering an image of it with alpha transparancy enabled...
I have added 10000 to the second and render, 10000 to the 3rd and rendered.

Deleted all 30000 objects.
Placed 3 quads with the last 3 render images.

So about 100000+ polies
Turned into 2 for each quad, 3 quads = 6 triangles draw calls (presuming that a quad is.made of 2 triangles)

Game ran flawleslly on every device with 3d physics.

Then i wanted to make the grass, flowers and bushes move a bit and got stucked... and than i have learned about shaders and that is what you should preffere since a decent shader can make quick.tesselation adjusments.

2d clipboard is about the same just that you need to have multiple render images for every 3d model, and only when you go.near it it should turn into full 3d mesh, if you take the snapshots at the right time(Player vs Camera vs World/Indoor lightning) and a 3d tween to make the real 3d mesh dissapear to 0 alpha and the 2D or 3d Quad using A 2D CLIPBOARD as a texture tweenFadeIn alpha to 255. The player wont notice.

Agk tweening is really a smart way to do stuff, for example if are like me you and hardly understand the math behind shaders, you will probably make of the 3 grass renderers about 25 of each, so its 25 images/renderImages/textures on these 3 quad and with a simple timer and temp 3d objects (another 3)
You will tweenFadeIn the next Image and TweenFadeOut the older and keep inc the currentAnimTexture to continue to.show a dynamic 30000 objects like moving. So now they are dynamic where the animation is actually baked before hand. Instead of loading these 30000 objects every time, you load the pictures. Set up the tween and walla 60 fps on a mobile device.

RenderingImages. Guessing that will always be the solution cause no matter how strong the phone is, more polies less battery.
Nadav "Haliop" Rosenberg
Lets make the world great forever.

Login to post a reply

Server time is: 2024-11-24 05:59:37
Your offset time is: 2024-11-24 05:59:37