Closed shama closed 10 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
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
Getting closer... I ended up creating another module that consumes voxel-texture and voxel-mesh to pipeline and load the textures and dual meshes.
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 .
looking good : )
Closing in favor of #4.
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 useface.materialIndex = 0
for opaque faces andface.materialIndex = 1
for transparent. Using separate materials withTHREE.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.