CodeWalrus

Development => PC, Mac & Vintage Computers => Topic started by: Snektron on July 01, 2016, 12:21:12 PM

Title: [LibGDX][OpenCL] Non-euclidean voxel engine
Post by: Snektron on July 01, 2016, 12:21:12 PM
That's right, i'm at it again. This time the engine works in full 3D instead of only in the horizontal plane like my
last non-euclidean project (https://codewalr.us/index.php?topic=860).

I've recorded a video here: http://webmshare.com/play/gB7RL (about 2.5 MB)

It works by making every voxel an object, with pointers/references to it's neighbors on each face.
(You can imagine it as a 3D linked list).  The rendering algoritm uses the DDA algorithm used in early ray casters (and my last project),
optimized to branchless code for GPU's. The algorithm uses the pointers to walk the structure until a non-empty voxel is hit.
This way, creating a portal is as easy as changing a voxel's neighbor pointer to somewhere else. (So in fact, everything is a portal.) This creates a lot of potential for really bizarre levels.

A small problem is, this engine can never support absolute coordinates, so level designing will be extremely complex. I will try to make a level editor
in the future, which will most likely have arrows drawn between voxels to show where each face leads.

This engine is made in LibGDX and uses OpenCL for the rendering algoritm (which gives a small speed boost over OpenGL shaders). Its still heavily in developement, so no downloads :(. In the future i want to try to make a game with it, which could be one of the first ray traced games :o
Title: Re: Non-euclidean voxel engine
Post by: Dream of Omnimaga on July 01, 2016, 04:27:48 PM
Awesome! I was worried this was dead. It looked quite cool back a few months ago but it looks even cooler now. :)
Title: Re: [LibGDX][OpenCL] Non-euclidean voxel engine
Post by: Snektron on July 01, 2016, 06:01:42 PM
Well its actually an entirely new project, and it works in a different (but similar) way too.
Title: Re: Non-euclidean voxel engine
Post by: Dream of Omnimaga on July 02, 2016, 07:55:56 AM
Ah I see. I wonder, though, if the old raycaster will be preserved for a calculator port? We don't have a maze game for color ez80 calcs nor any 3D maze for the TI-Nspire IIRC.
Title: Re: [LibGDX][OpenCL] Non-euclidean voxel engine
Post by: Snektron on July 02, 2016, 08:52:16 AM
Well, the source of that project is still on github, and i recently did a big speed improvement. (I removed a sqrt in the ray step function, which was needed for every step of the ray, so now it saves about 640 * 100 sqrt's every frame)
Title: Re: Non-euclidean voxel engine
Post by: Dream of Omnimaga on July 03, 2016, 04:30:29 PM
Do you use fixed points? That would be way faster than floating points (on the TI-Nspire CX, someone once used floats and his texture-less raycaster ran at around 5 FPS with a very limited FOV, while Crafti ran at 12-13 FPS with PS2-quality textures.
Title: Re: [LibGDX][OpenCL] Non-euclidean voxel engine
Post by: Snektron on July 04, 2016, 09:27:23 PM
No, and it will probably be slower on x86 based instruction sets since they have hardware float aritmetic instructions (in every of modern model at least).
Title: Re: Non-euclidean voxel engine
Post by: Dream of Omnimaga on July 05, 2016, 01:50:48 AM
Oh I see, but what about x64 or whatever 64-bits is?
Title: Re: [LibGDX][OpenCL] Non-euclidean voxel engine
Post by: Snektron on July 05, 2016, 09:48:19 AM
Well thats actually x86-64, a 64 bit version of the same x86 instruction set. It has backward compatibility, so every instruction on a 32 bit x86 processor can also be executed by a 64 bit one.
Title: Re: Non-euclidean voxel engine
Post by: Dream of Omnimaga on July 05, 2016, 04:13:46 PM
Ah that's good then. I can't wait to try a demo or something. You should make a video when you got significant progress. :)