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 / SetObjectImage speed

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Apr 2013 17:05
I was wondering how expensive using SetObjectImage is realtime? At the moment, I preset any objects, but if I wanted to change (or even animate textures) would this be considered an expensive operation?

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 1st Apr 2013 18:03
Try it and see...

As long as all the images are already loaded I can't expect it to take too big of a framerate hit.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Apr 2013 19:18
It'll be fine for me, but I was thinking about others with lower spec hardware.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Apr 2013 14:25
theoretical it should only exchange the image pointer.
alternative maybe its possible to change the uv pos. and use a one big texture with include some small pics.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Apr 2013 16:20
To do that Markus, there's the subimages command - which would let you specify several sub images inside 1 big image, each of these get's it's own internal filename, and then the image can be 'loaded' from that as if it was a whole, single image.

Sprite frames are handy, but for objects the sub images system should be pretty good. We use this in our project and I can't say that I've noticed any issues with performance, probably best to be sensible though - like keep track of which subimage is applied, and only apply a new subimage if it changes... that sort of thing.

I got a fever, and the only prescription, is more memes.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2013 17:56
Calling SetObjectImage will not impact performance.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 2nd Apr 2013 22:11
That's what I like - definitive answer
It's good, as I would like to explore animated textures without cost to performance.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Apr 2013 22:12
@Van B
i mean like minecraft, with uv positions you can display a part from
a texture. but then the problem is the max. texture resolution,
not really good for long animations.
using much images i think about which RAM will be use,
the ram at motherboard or graphics card,if the texture is not in the
graphics card it will surely copy to it. maybe a impact at small devices depending on hardware architecture.

Login to post a reply

Server time is: 2024-11-24 12:02:27
Your offset time is: 2024-11-24 12:02:27