Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Coplanar face merging - OPTIMIZED!
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=98
Page 2 of 2

Author:  onimatrix [ Fri Dec 10, 2010 7:05 am ]
Post subject:  Re: Coplanar face merging - OPTIMIZED!

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 2153 times ]
voxel10.JPG
voxel10.JPG [ 80.77 KiB | Viewed 2153 times ]

Author:  David Williams [ Fri Dec 10, 2010 7:03 pm ]
Post subject:  Re: Coplanar face merging - OPTIMIZED!

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.

Author:  onimatrix [ Fri Dec 10, 2010 7:25 pm ]
Post subject:  Re: Coplanar face merging - OPTIMIZED!

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 2148 times ]

Page 2 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/