While still working on the tutorials, I was wondering what the end result would be and which scene setup to use for all steps in-between from start to end so that it would still present itself somewhat interesting (aka. “not rendering a simple sphere on a plane…”).
So I ended up looking at various MagicaVoxel models and I like the “rooms.vox” model shipped with MagicaVoxel the most. It has very interesting features, such as some emissive surfaces and all in all interesting geometry while being a voxel model. And it’s not as abstract as for example the “menger.vox” model.
Additionally, the city-themed modular models from https://github.com/mikelovesrobots/mmmm are fantastic as well.
So here is just ray traced hard shadows with visualized normals of the room.vox model
(OpenGL 3.3, GLSL 330 core, everything in buffer textures, model has 82,536 voxels which are reduced to 1,280 merged ‘cuboid’ voxels for which a kd-tree is built and traced in GLSL with AABB/ray intersection tests for the voxels):
EDIT: Visualization of the difference between previous “voxel merging” which only worked a single y slice at a time (just like greedy meshing only works a single slice of one of the three dimensions) and optimized merging which also tries to merge a xz-slice along the y-direction (first unoptimized resulting in a total of 1,280 voxels, second optimized resulting in 367 voxels):
Additional seemingly unnecessary splits (missed merges) are due to splits later introduced by the kd-tree build.