vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Tue May 21, 2013 11:03 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Texture Question
PostPosted: Mon Sep 14, 2009 6:03 pm 
Illegal Operation

Joined: Sun Jun 07, 2009 3:09 pm
Posts: 417
Location: poririn-poriri-pori-pororocca
I developed an algorithm where it loads a 4x3(32) autotile and expands it into a 16x8(32) autotile using blitting, then saves it into memory and uses that as a texture. I did this so that you can still render in 32x32 tiles rather than 4 16x16 ones.

However if texture binding is so slow would it be better to render 4 times as many squares, and cache all the autotiles into a single atlas (not expanded)?

The problem is this effect is lost if the autotiles together go beyond 512x512, then im switching textures again. Will the performance difference be worth the loss of simplicity and flexibility?


Top
 Profile  
 
 Post subject: Re: Texture Question
PostPosted: Mon Sep 14, 2009 7:22 pm 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
Well, how frequently do you go beyond 512x512? And why not use a larger texture, like the largest the device supports (if you need it that big, that is)? If you are having a hard time fitting so much in the atlas, though, just put less stuff in it. For example, use only the textures on the given map, and create an atlas per layer.

The benefit comes from batching more than the texture switching. As long as you are still sending a few thousand primitives per call, then yeah, you will gain benefit. Also, I don't see why it would make it any less flexible, and the complexity of it can likely be almost completely abstracted.


Top
 Profile  
 
 Post subject: Re: Texture Question
PostPosted: Tue Sep 15, 2009 3:39 am 
Illegal Operation

Joined: Sun Jun 07, 2009 3:09 pm
Posts: 417
Location: poririn-poriri-pori-pororocca
Ah i see, so texture atlases enable you to pack more vertexes in the one batch.

I wasn't thinking straight, i just realised that autotiles are only a tiny part of the problem, because they would only be used on the ground layer. It just won't work because i want to allow people to use 100 different tilesets. It should be fine though, even with immediate mode, and switching textures every tile on 6 layers it still achieves max fps.

Using a single display list to render the map (in-game when it doesn't need to be edited) should make the vertex part of it render 3 times faster, so im only concerned about texture switching.

Well at the moment, all i have to do is dump a whole lot of tilesets into a folder and choose the ones i want in an INI like file. All the tiling, resizing, checking if its RMXP or RMVX tileset, etc, is all done automatically.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group