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.

Newcomers AppGameKit Corner / Biotopium pre-alpha LOD testing ; what are best LOD strategies for AGK 2 ??

Author
Message
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 16th Mar 2018 21:43
I've coded a LOD system that checks distance per object and checks if it's within view using GetObjectInScreen(objectID) , however for some reason this code doesn't seem nearly as effective on Android.

Performance below is on PC, which is somewhat okey, although definitely not great;



I haven't used InstanceObject() yet, so hopefully that will improve performance dramatically. However, would that even work on Android too or do I have to accept a different performance overall for mobile??

In combination with Depth of Field post-processing, the performance on Android slows to a crawl. To some extent that makes sense, but I would not have expected single digits on a Samsung Galaxy Note 8 to be honest.

Anyway, some general advice much appreciated!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2018 01:17
I can't see any difference between the near and far trees, other than fog.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 17th Mar 2018 10:00
Quote: "I can't see any difference between the near and far trees, other than fog."


The trees also disappear and 'pop-up' when closer in range. That system works fairly well, however there are funky things going on when it comes to PC performance. Not sure if the GPU automatically decides to use tricks for rendering, but in some cases no LOD system can be faster.

On Android is results in 3x the frame rate though, so it definitely does 'work'. But 15 fps is not very promising.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 17th Mar 2018 10:01
Oh wait, you mean changing the model for a simpeler version in terms of vertices and faces? Yeah, haven't added that yet to be honest. But that might help indeed!
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 17th Mar 2018 16:36
Some more progress. The shadow management is a bit rough here, but I initially wanted to get it run at acceptable speeds on Android. Seems that might be a bit too much to ask for though.

george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 17th Mar 2018 21:02
I noticed that AppGameKit shadows decrease performance on Android much more than PC
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 17th Mar 2018 21:13
Yeah, that definitely seems to be true.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Mar 2018 14:49
Quote: "you mean changing the model for a simpeler version in terms of vertices and faces? "

That's generally what I think of when I hear LOD.

So it's more of an occlusion culling system than LOD for now. I think DBP let you set the camera range so objects farther at a certain distance would be hidden. I'm surprised AppGameKit doesn't have something built-in for this already.

What android device are you testing it on?
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 18th Mar 2018 17:19
Quote: "
That's generally what I think of when I hear LOD."


Yes, that's true.

Quote: "occlusion culling"


Well, sort of yes. I actually would have liked to do true occlusion culling if AppGameKit 2 doesn't do so already, but I am not sure we have access to all non-visible faces of models so we can choose to not render them. I had hoped switching models of completely would give a decent gain. It kind of does, but doesn't work nearly as well on Android.

The Android device is a Samsung Galaxy Note 8, so it's pretty darn fast too meaning it's not the best device to gauge performance for something more average in performance. Perhaps I need to settle for fake shadows or something. It seems quite taxing.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Mar 2018 19:44
I've seen a few other posts where android doesn't seem to run as well as other devices. So it's not just you.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 18th Mar 2018 19:47
For shadows not dynamics, its better to use a lightmap system.
Some old android tablet or phone doesnt support the shadows of agk. So lightmap works fine for all tablet and phones .
AGK2 tier1 - http://www.dracaena-studio.com
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Mar 2018 11:53
Quote: " I think DBP let you set the camera range so objects farther at a certain distance would be hidden. I'm surprised AppGameKit doesn't have something built-in for this already."


SetCameraRange(cameraID, fNear, fFar)
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 22nd Mar 2018 13:56 Edited at: 22nd Mar 2018 13:56
Quote: "SetCameraRange(cameraID, fNear, fFar)"


True, that commands works. I already use that, but keep in mind that that literally clips whatever is outside of that range. The only thing visible after that would be the skybox / horizon gradients or clear color you have set. It is not very useful for models closer in view, because you want those to remain visible within the range that makes sense.

Attachments

Login to view attachments
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 22nd Mar 2018 14:00 Edited at: 22nd Mar 2018 14:02
Quote: "For shadows not dynamics, its better to use a lightmap system."


Yeah I can see the benefit of that on mobile.

edit: I think I will do some more testing with different tree models by the way. The current one has quite a few polygons for what it is, compared to what a low poly stylized tree would look like. I think I might drop the voxel graphics idea for this project and just make low poly models.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 24th Mar 2018 02:30


Some more updates. Implemented the start of some AI / pathfinding so animals don't go below a certain terrain height. Also video shows the distance based clipping at the end that's a combination of my code and specific camera range settings / fog etc.

Login to post a reply

Server time is: 2024-04-19 15:45:32
Your offset time is: 2024-04-19 15:45:32