voxel / issues

an issue tracker and discussion forum for voxel.js related projects
9 stars 2 forks source link

Mesh & Texture Pipeline #3

Closed shama closed 10 years ago

shama commented 11 years ago

Currently it works like this:

For transparent blocks, I've got voxel-texture detecting whether a texture is transparent and pushing onto game.materials.transparents. Then when it comes time to paint the mesh UVs it will use face.materialIndex = 0 for opaque faces and face.materialIndex = 1 for transparent. Using separate materials with THREE.DoubleSided fixes most of the transparent block rendering issues.

But we still have the hollow mesh issue. The UVs are backwards for the inside faces of the mesh and we can't know whether it should be flipped or not when painting. So it looks like we're force to also mesh the transparent blocks separately (I've really been trying to avoid that).

Proposal Streamline the pipeline. Make voxel-texture a dependency of voxel-mesh. Textures will only be loaded as the meshes are generated. So the flow would be:

The goal will be to keep the APIs as close to the same as possible but this may need some breaking API changes to implement.

max-mapper commented 11 years ago

also if we can do this easily on a worker e.g. re-do the API between voxel-engine and voxel-mesh it would help a lot as well with perf

shama commented 11 years ago

oh yeah good idea. I've been wanting to put voxel-texture into a worker as well... so this will do both. I'm going to work on that :D

shama commented 11 years ago

Getting closer... screen shot 2013-06-26 at 9 55 15 pm I ended up creating another module that consumes voxel-texture and voxel-mesh to pipeline and load the textures and dual meshes.

max-mapper commented 11 years ago

OOOOH

On Wed, Jun 26, 2013 at 9:58 PM, Kyle Robinson Young < notifications@github.com> wrote:

Getting closer... [image: screen shot 2013-06-26 at 9 55 15 pm]https://f.cloud.github.com/assets/99604/713923/e2dd5398-dee5-11e2-85df-358f25781e5e.png I ended up creating another module that consumes voxel-texture and voxel-mesh to pipeline and load the textures and dual meshes.

— Reply to this email directly or view it on GitHubhttps://github.com/voxel/issues/issues/3#issuecomment-20097306 .

kumavis commented 11 years ago

looking good : )

shama commented 10 years ago

Closing in favor of #4.