mat[3].z != mat[2].z

The reflection matrix math did work, however I updated the wrong column ….

Anyway, mirrors are now implemented in the VizHome viewer:

Virtual mirror

A virtual mirror (some 4×2 meters) inserted into the Ross’ House dataset on the Z-plane for debugging.

The mirrors currently render only the bounding boxes of the hierarchy; rendering the actual point cloud data leads to crashes. My current guess is that in the multi-threaded environment, some voxels get unloaded in some threads (because they are now longer visible) while other threads still try to access them.

Generally, the difference between having mirrors and not having them is already pretty interesting:

Mirror enabled

Mirror enabled

Mirror disabled

Mirror disabled

An additional clipping plane is required and has to be implemented in the shaders, otherwise objects in front of the mirror might get projected into the mirror image. This might require changing all vertex shaders, however maybe rendering the mirror contents might have a dedicated shader.

As a side note: using occlusion queries to update visibility information does not work either:

Occlusion query disabled

Occlusion query disabled

Also note that all the mirror FBOs in these images are quite low-res at 256×256 pixels. Current optimizations are: disabling update and rendering if the mirror is not visible (simple viewfrustum culling in projection space), if it is facing the wrong direction and hopefully if it is fully occluded.

Next steps will be rendering of the actual point cloud data and looking at it on the dev wall and maybe in the CAVE to see how the mirrors  ‘feel’.