This week was an optimization week. Starting with a quick UI change though, we redesigned the color picker. This is likely not the last version of the color wheel, but this one features a wheel to set the basic color, along with sliders for hue, saturation, and value (HSV), as well as Alpha value. Additionally, it has a input field for Hexadecimal color values.
Here we can see that a texture is being applied to the blocks. We were able to set the texture for the material applied to the mesh for our object. however, right now the texture is just tiled, over each block. Eventually, we need to be able to UV map coordinates from a PNG, to each block, which will allow us to individually color each cube, while storing the entire grids color in a single PNG.
This was one of the biggest changes to this point, and required a overhaul of the Mesh, both in terms of quads and game objects as a whole. First, we changed the code so that rather than creating a new voxel that is placed in proximity on the grid to the others, each added voxel is not actually added; rather the 1 game object for the voxel is manipulated, and reshaped. this way we have "multiple cubes", while really only having one game object.
we can see for each cube, there is an individual game object
Now, while we still have the same number of cubes, we have only one game object.
This optimization of the the game objects was substantial, as now the game only has a single object for all cubes rather than 1 for each, which strong helps performance, particularly on weaker devices. However, we felt we could further optimize, so we worked to remove extra faces from the mesh. we did this by checking for internal faces on cubes, or faces that were not able to bee seen by the user, and removing them. this allows for a less complex mesh, along with removing a potential issue for color continuity with transparent cubes.
We can see the additional faces in the wire-frame, from internal faces
We no longer have extra faces, only the external faces seen
Finally, after much thought, we realized that we didn't need a custom file format, as that would not only make it more difficult for us to support exporting to other software, but also would make our software less user friendly. Since or system stores color, we decided on a modified obj file format with mesh data. The file is readable by most if not all software that can read obj file formats. Additionally, we have a companion PNG file, that stores the color data for each cube in pixels.
Mesh Optimization
Object Optimization
Load/Save buttons
Import and export of cube grid as OBJ
Reworked Color picker