It is currently Tue Feb 18, 2020 1:11 am


All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Coplanar face merging - OPTIMIZED!
PostPosted: Fri Dec 10, 2010 7:05 am 

Joined: Wed Dec 08, 2010 5:54 am
Posts: 27
I got texturing to work :D

For the moment, I scale the base UV of each quad by a merge count in the two posible axes. Setting GL_REPEAT to both texture wraps, this gives the illusion that all the voxels are textured individually. I expect to run into some problems with this solution and texture atlas (They are pretty much incompatible). Maybe instead of texture atlas I can batch all quads with the same texture.

Here are some nifty pics:


Attachments:
voxel11.JPG
voxel11.JPG [ 76.91 KiB | Viewed 1813 times ]
voxel10.JPG
voxel10.JPG [ 80.77 KiB | Viewed 1813 times ]
Top
Offline Profile  
Reply with quote  
 Post subject: Re: Coplanar face merging - OPTIMIZED!
PostPosted: Fri Dec 10, 2010 7:03 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Wow, excellent work again... I'm actually suprised your getting such good results and performance using the fixed function pipeline and immediate mode. But well done.
onimatrix wrote:
Maybe instead of texture atlas I can batch all quads with the same texture.

You might find 'SurfaceMesh<VertexType>::extractSubset' to be useful, though I don't know if it works with the cubic mesh. It might be easier to write your own version which works directly with your quads.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Coplanar face merging - OPTIMIZED!
PostPosted: Fri Dec 10, 2010 7:25 pm 

Joined: Wed Dec 08, 2010 5:54 am
Posts: 27
I'm using display lists, not immediate mode. Performance wise, they are at the same level that VBOs (Sometimes even faster!). Only two drawbacks that I'm aware of: First, they can't be modified. Second, to create display lists in another thread you have to do some funky rendering context switches, as OpenGL has zero (0) threadsafeness.

I got threading to load/generate/save chunks on demand, but I build the display lists in the main thread because I kind of like my current head and wouldn't like it to explode.


Attachments:
voxel13.JPG
voxel13.JPG [ 35.57 KiB | Viewed 1808 times ]
Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net