Design a Voxel Rendering Engine for iOS.
Design a Voxel RenderingEngine for iOSShipeng Xu20 Oct 2017@1991bill
View Slide
What is Voxel?● Volume Pixel● Data Structure○ Integral X, Y, Z coordinates○ ColorPokemon Voxel, Playiku, 2016
Voxel Rendering Engine for iOS● Rendering○ Beautiful● Performance○ Blocks can be added or removed at interactive speeds○ E.g. A 64x64x64 voxel world = 262,144 voxels!Add Delete MoveChange Color
Rendering - 1 Voxel12 Triangles
Rendering - 5,911 Voxels
Rendering - Meshing● Naive way...● Draw a 3D cube for each voxel.○ 5,911 Voxels○ 5,911 x 12 = 70,932 triangles
Rendering - Meshing● Skip the unseen voxels○ Before: 5,911 Voxels■ 5,911 x 12 = 70,932 triangles○ After: 5,868 triangles■ 8.2% of original
Rendering - Meshing
● Combine small faces into bigger onesRendering - Meshing280 Triangles 22 Triangles(7.9%!)
Rendering - Lighting
Rendering - Ambient Occlusion
Rendering - Ambient OcclusionOcclusion level3210
X Basic LightingX Ambient Occlusion✔ Basic LightingX Ambient Occlusion✔ Basic Lighting✔ Ambient OcclusionRendering - Lighting
Links● Voxel Meshing - https://0fps.net/category/programming/voxels/● Voxel Rendering Techniques -https://medium.com/@fogleman/voxel-rendering-techniques-fa8d869457ca● Volume Rendering -http://bytebash.com/2012/03/opengl-volume-rendering/● http://shipeng.studio