Proc Jam Blog 2


I was pretty happy with what I had accomplished after the first weekend of proc jam, but then other responsibilities and issues arose and my time and mind were no longer focused on proc jam. I made little progress, mostly playing around when I had a few hours to spare. 

Edge Detection

After success with the Gaussian blur effect on the mesh, I was playing around with other kernels, such as edge detection, but unfortunately to no avail. I briefly looked around for 3D edge detection and didn’t find anything at a level I felt I could take on at the time (my search popped up a couple of academic papers whose math was more than I can take on casually...or ever). I decided to implemented my own method specific to how I do mesh generation. I began by testing the gradient between indices (something I had seen discussed in the papers).  At first I tried to set the value of the index based on the gradient, however I realized I was over thinking it.  It occurred to me that my “edges” are binary, although values range from 0 - 1, triangles are only created if at one index the value is < .5 and  on the other index the values > .5. Recognizing the question was binary I realized the problem is much simpler than first imagined.  All I need to do is build a mask, where each index either keeps its value or sets it to empty, based off of the mask value. Both cells on the side of an edge are included in the mask,  all other indices are not. I ran the code and voila! I have an algorithm to hollow out solid volumes into a shell of thickness one index size. Pretty happy with the potential for this algorithm, not sure yet how to use it, but I feel like it is a worthwhile tool to have.



Shader Code 

Since I was still working through the Book of Shaders on days I got to the project, I started playing around with porting simple shader snippets to 3D and plugging them into the mesh generation. Not sure the point of it, although it was fun to do. Here is a propeller spinning through manipulation of the 3D array in shader code.

Of course, this is all running on the CPU, so I don’t get the parallelization boost one gets from running a shader :P However I could see this programmed in a compute shader to generate the data likety-split. Of course then the question would be why do all this in the first place! My thinking is there will be some interesting patterns and shapes to be found via shaders, maybe as part of proc gen, maybe as a brush in the level editor. Either way, sometimes I think it is fun to just follow an idea down the rabbit hole. The Bob Ross Zen of game development method!

Drawing Lines in Marching Cubes

This got me to mess around with some matrix math for rotations, which was good, as it led me to develop a first pass line drawing algorithm. I am confident there are far faster ways to draw a line, but working through my process got me some nice experience with constructing matrices in C# and doing some rotation calculations on points. Rotation Matrices

Hmm, okay, maybe I will split this into two posts. This gets us up to the last three days of the jam. Next post will look at my attempts to corral all these threads back into something functional enough to submit.


Thanks for reading!

Files

proc_jam_v0.2.1.zip 53 MB
Dec 14, 2020

Get Traverse The Void (proc jam)

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.