itch.io is community of indie game creators and players

Devlogs

Fast and Accurate Color Depth Conversion

Vorxel
A downloadable game

My voxel engine uses colors which are converted from 24-bit to 16-bit color (5-bit red, 6-bit green, 5-bit blue) to allow space for additional properties (alpha, emissive, specular, and voxel level ambient occlusion face adjaceny bits) in each 32-bit voxel.  Initially I was using naive RGB channels bit shifting code for 24-bit to 16-bit color conversion.  These color conversion equations are much better than what I was using:

https://threadlocalmutex.com/?p=48

Read comments (1)