v2.2a - Increased Model Polycount, 64-bit EXE, Thresh Slider, Vertex Shading


Decided to do some work on Holocraft, originally just to make an emergency fix for G-code/SVG output, but I got a bit carried away ;)

Here's the changes.txt:

 v2.2a

  •   fixed newline characters in exported G-code/SVG
  •   moved to 64-bit executable to mitigate memory allocation limits
  •   increased maximum number of faces/vertices a model can have tremendously
  •   added dynamic allocation for certain data structures, to further increase
    allowable number of faces/vertices in a model
  •   separated geometry optic threshold from 'Optics' slider to new 'Thresh' slider
  •   changed optic groove and glint drawing so that grooves do not draw over glints
  •   added 'shading' to vertex optic mode so that optics are only created on vertices
    where a light shining from the top left would cast onto the surface
  •   added 'jitter' to vertex mode, so that there's some randomness to the threshold
    at which an optic will be created for a vertex, based on its surface variance
  •   changed color/appearance of geometry and hologram optics depiction
  •   fixed generated optics overflowing binary tree sort when depth-sort is enabled
  •   added numeric output to console when adjusting sliders
  •   changed view-angle slider to snap back to center when released
  •   added sample models

One of the big issues with Holocraft is its need to maintain all kinds of auxillary information about polygons and edges and vertices between all of them - which are used for generating hologram optics quickly. This requires that lots of information be generated and stored, typically much larger than the original model being loaded. With a 32-bit executable limited in its total addressable memory, this meant that Holocraft (as a 32-bit program) was limited in the complexity of the models it could load. v2.2a rectifies this by moving to a 64-bit executable, and also implementing some dynamic allocators to reduce the size of internally generated model structure data.

The end result is that holograms can be generated from much more complex model geometry now. Here's a model with 643k polygons and 321k vertices:



With v2.2a the 'Vertex' optics generation mode now applies some simple shading when selecting vertices to depict via specular hologram optics:



Wireframe still behaves how it did before, for the most part, except that the 'Optics' slider has been separated into two sliders: 'Thresh' and 'Optics'. This is the case for all optics generation modes, but in the case of the wireframe mode the 'Thresh' slider controls the surface detail threshold which determines when an edge (or vertex, when in 'Vertex' mode) is included in the optic-generation process. The optics slider itself now controls just the shading level for vertex mode, and the number of optics per edge in wireframe mode:



The view-angle slider snaps back to center when released now, so that it doesn't get left at a side-vantage when further situating the hologram and its parameters, because the way the hologram may appear with the simulated view-angle off to the side is not what will be observed of the hologram head-on (which is what observers will see at a view-angle of zero):



There's still a small bug where if a large model is loaded that really bogs things down the view angle will not snap back to center when released. This will be fixed in the next update, whenever that comes about.

Speaking of being bogged-down with larger models: I'm going to spend a bit of time investigating possible means of speeding up Holocraft when large models are loaded. For the most part all pertinent pieces of rendered geometry are loaded to the GPU, and thus on call for being drawn, which is only going to be as slow as the GPU itself, but it seems that Holocraft is particularly slow for the types of models loaded into it. 

Even with everything else disabled: drawing vertices, edges, optics, and disabling optic generation altogether - models which have a few hundred thousand polygons just go 10x slower than they should. I don't know this to be an exact fact, but in all my experience a modern machine (let alone modern GPU) should be able to handle a few hundred thousand polygons at a usable framerate. A 100k model, rendering faces only, bogs things down to ~10fps on my RX 570, with no shaders or anything fancy. This seems to me like there's room for improvement.

Currently Holocraft also generates optics on-the-fly, as the user rotates their scene/model and adjusts parameter sliders.  I'm thinking that it would be useful to make this an option, or to only have optics generated every so often, and possibly render a low-poly proxy geometry representation of the loaded model while rotating/translating with the mouse.

Digging into the Holocraft code for the first time in a long while I realize that there's still quite a bit of room for leveraging multi-core CPUs in a much better fashion, as with PixelCNC/Bitphoria. Holocraft currently spawns a single worker thread which does all the background stuff required but there's no legitimate threaded job system which work can be divided up across available cores with, so Holocraft is leaving a lot of performance on the table when doing computation-intensive tasks, like generating hologram optics. A threaded job system could be used to speed up optic generation and other aspects of optic handling.

I don't know when I'll be able to dive back into Holocraft's code and knock out some more features. Maybe if it keeps seeing the increased sales that it has been seeing over the last few weeks, which caught me off guard. If that ends up being the case then I'll be able to justify investing more time into its features and functionality. In the meantime I'll be focusing on PixelCNC until about the 2nd quarter of 2019, at which point it will be going beta and I'll be starting up a new project involving gaming and VR (using my existing Bitphoria engine). Holocraft may end up just been a sort of background project that I work on every few months to clear my head and take time away from primary focus projects. It then would serve as something which enables me to still do worthwhile work while temporarily escaping the confines of whatever challenges I may be dealing with on my main project(s).

That's about it for now, but one last thing I thought I'd mention: I'm feeling like I need to hack on my CNC a bit (to increase its rigidity) and make some super awesome holograms sometime soon! I'll post whatever I happen to put the time into making, if it's something worth showing off :) My X-Carve suffers from just not being rigid enough to do specular hologram scoring properly - it produces wobbles in the optic grooves due to there being too much flex in the gantry which results in poor-quality holograms. I think that creating larger holograms with much larger and more gradual groove shapes may help this, along with fine-tuning the feed rate and tighting up the gantry. I could also optimize the actual force being applied to the aluminum surface as well, and the carbide bit's shape that is being used. There's definitely more work to be done with the actual fabrication of holograms with my current setup.

Happy holidays!

Files

Holocraft v2.2a.zip 221 kB
9 days ago

Get Holocraft

Buy Now$34.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.