UV coordinates by value for texturing

megafun posted this 03 December 2015

Hi! I've love to see option to assign different uv coordinates for different voxels based on their values. Author of this post said "It really wasn't much work, only a couple hours". So can you add this feature, or maybe explain why you wouldn't. I can go ahead and try to implement this myself, but I'm not sure if I can make it efficient enough at first try.

Order By: Standard | Newest | Votes
GarethIW posted this 03 December 2015

Hi, thanks for your post!

I have put a lot of thought into how I can add support for texturing to PicaVoxel. But if I am going to do it, I'm going to do it properly. And that requires time, which I don't have right now.

By "do it properly" I mean that I need to be able to do it in a user-friendly manner like the current PicaVoxel editor.

My current thoughts on what needs to be implemented are as follows:

  • A global tilemap texture with a defined tile pixel size
  • Users need to be able to easily set up "block types", which essentially means assigning tiles from the tilemap to each face of the block
  • A new editor mode to paint with blocks instead of colors/values
  • User Interfaces for all of the above
  • Feeding the block data into mesh generation to assign the correct UV coords
  • A shader to support tiling
  • How is this done with Greedy meshing?
  • What about semitransparent/cutout blocks (like minecraft trees/leaves/glass)?

Lots to think about, and that's just the start. I'm sure that jblamber managed to do it in a few hours, but that was without consideration to making a user-friendly editor for everything.

Don't get me wrong, this is something I really want to add to PicaVoxel, but it's going to take time. I have a really busy (right now) day job that I have to work personal development time around. Any PicaVoxel time I get currently is taken up with support and working on the next patch release (which will be released shortly after Unity 5.3).

Last edited 03 December 2015

megafun posted this 03 December 2015

Thanks for thorough answer! I totally get you! In that case I'm going to think something of my own. This list of issues will help me plan the development!

GarethIW posted this 03 December 2015

Cool! If you need any specific question answering let me know.

jblamber posted this 05 January 2016

Cool! If you need any specific question answering let me know.

Ive heavily modified the Pica Voxel code to do just that and more (it was a great starting point), you can also let me know if you want pointers. I dont think I'll be sharing source directly (as some have asked), as I still havent merged all the latest changes, and Gareth is the owner of the original code.

You can see the results of my meddling here: http://jblamber-kiwi.tumblr.com/

megafun posted this 11 January 2016

This is awesome! I checked out your blog with textures and animated textures - very impressive!

I am now standing in front of this dilemma: use picavoxel as starting point, like you did, or just to write all from scratch. I need voxel engine for relatively big environments (not infinite, but big and both auto-generated and handmade). I'm not a big fun of API for working with different chunks and volumes in picavoxel. So you can you give me an advice on this?

Also, since environment is dynamic (digging and building and stuff), I'm not sure if greedy mesh is actually necessary.

Our 137 members have posted 527 times in 128 discussions