Bringing voxels to the modern renderer

After seeing @UberGoober get into using voxels, we felt we should port the Craft voxels into the next release. In the modern renderer the voxel world is a component you can attach to an entity — not quite as full-featured as Craft yet (no scripting to make things like TNT, etc)

Sample code:

function setup()
   scene.main = scene.default3d()

   -- 2 x 1 x 2 chunks, each 16 x 128 x 16 blocks
   local island = scene.main:entity("island")
   world = island:add(voxel.world, vec3(2, 1, 2))

   world:box(vec3(0, 0, 0), vec3(31, 3, 31), "Water")
   world:sphere(vec3(16, 0, 16), 10, "Sand")
   world:line(vec3(16, 11, 16), vec3(16, 14, 16), "Wood")
   world:sphere(vec3(16, 18, 16), 3, "Leaves")

   island.position = vec3(-16, -4, -16)
   scene.main.camera:add(camera.rigs.orbit).distance = 40
end

Generating a voxel riverbed for an improved Froggy adaptation to the modern renderer

Voxel world generation

Froggy running in modern, with new effects

That is so smart - looking forward to next beta !!!

You cannot imagine my pleasure at this. Okay that’s overstating it but I just ate a lot of sugar.

1 Like

I am really interested in getting into modern but the one thing left is that I can’t export to Xcode with it. As soon as I can I’ll try to port my word hunt game to it.

We’ll get there! Just have to get iPhone Duo versions of Codea and Retrogram out before the device comes out

1 Like

Oh yeah, I just ran into the iPhone duo thing myself. they’re gonna make us all do that

Yeah I got to use one at the workshop this week and had Claude generate a whole lot of Carbide demos that made use of a folding phone mechanic — playing with it on device was excellent. So I’m excited to get those out

1 Like

Will Codea be able to simulate the duo the way it can simulate the iPhone, so all the devices can still be tested on a single iPad?

1 Like

@sim - Oh my God !!! What a step change, demos are excellent. One neg - pool table demo fires up a len issue and also gives the resolution to it.

Probably not in time for Duo release date - but it does get a new hinge API in 3.18 for legacy and modern so you can measure the angle and more

I tried to make a lava rain fall on the city and destroy buildings.

Couldn’t get the effects looking right but found out that the buildings are very destructible!

You can chomp voxels right out of them—fun.

1 Like