Discord
Login
Community
DARK THEME

List-Based Raycasting Resource

Found this simple and fast raycasting resource online and I thought I would share it :).

Here it is: https://github.com/cgyurgyik/fast-voxel-traversal-algorithm/blob/master/overview/FastVoxelTraversalOverview.md (an overview of this paper - https://www.researchgate.net/publication/2611491_A_Fast_Voxel_Traversal_Algorithm_for_Ray_Tracing)

And (couldn't resist) here's a quick demo of what it can look like:

:embed https://microstudio.io/this_name_is_taken/raycaster/PXB8SS34/

Nice find :)

Thanks! Thought you might like it, since you showed some interest in the inferior method used in my list-based raycaster. ;)

Couldn't resist again, here it is in full 3d!

:embed https://microstudio.io/this_name_is_taken/voxelraycaster/RPX4TST6/#transpiler

Runs too slow even for the transpiler though :)

:embed https://microstudio.io/this_name_is_taken/voxelraytracer/#transpiler

Aaaand finally the finished product, with some nice sprite-based textures, a few optomisations, and an options menu :).

Wait... are those textured cubes in MicroStudio?

Yep :). If you're interested, you can see the code here: https://microstudio.dev/i/this_name_is_taken/voxelraytracer/

Man, I was thinking polygon texturing might already be a thing in microstudio... :)

Gonna take a deeper look. It's probably not something I'll use in my racing game, for performance reasons, but I might test it out. If I can wrap my head around it.

Thanks.

This actually isn't polygon texturing, instead what it does is raytrace the cubes using the algorithm described in https://www.researchgate.net/publication/2611491_A_Fast_Voxel_Traversal_Algorithm_for_Ray_Tracing. Then, it uses the intersection coordinate to texture the cubes (as each voxel in this world takes up 1 unit of space, the already normalised UV coordinates can be taken straight from the intersection coordinates which don't pertain to the side of the cube which was intersected. Eg. if a face is perpendicular to the x-axis you can take the coordinates from the y and z parts of the intersection coordinate.)

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community