Hey there!
Inspired by Sprit3r I started work on a full out renderer for voxels, with a camera, z-buffers and everything else needed.
I am very pleased with the end result, so I cleaned it up and am now ready to release it.
Lovox works very similar to Love's image system, as in you load ModelData from a file (Or generate it at runtime), then generate a model which you can draw with that ModelData.
When you draw a model it gets passed into a buffer in the camera, which sorts it by depth, and renders all the models when it is told to do so.
Enough with the talk; have a few gifs:
Download it here: https://github.com/tjakka5/Lovox
Lovox - Load and render voxels in Love2d
Lovox - Load and render voxels in Love2d
Last edited by Tjakka5 on Wed Nov 30, 2016 9:47 pm, edited 1 time in total.
Re: Lovox - Load and render voxels in Love2d
Do you have any y-shortening/perspective scaling? Because it looks like that's too weak, which makes things look skewed when the camera is rotating.
Re: Lovox - Load and render voxels in Love2d
I do not, but it shouldnt be too hard to implement.s-ol wrote:Do you have any y-shortening/perspective scaling? Because it looks like that's too weak, which makes things look skewed when the camera is rotating.
That said, the models dont seem skewed to me, can you maybe explain what youre seeing?
Re: Lovox - Load and render voxels in Love2d
basically your stacking algorithmn draws this view by shifting higher layers further back, simulating a perspective like this:Tjakka5 wrote:I do not, but it shouldnt be too hard to implement.s-ol wrote:Do you have any y-shortening/perspective scaling? Because it looks like that's too weak, which makes things look skewed when the camera is rotating.
That said, the models dont seem skewed to me, can you maybe explain what youre seeing?
but your camera rotation and the way your single layers are drawn look like this:
this means things look 'thicker' than they should and when you rotate the camera it gives a sort of 'fisheye' feeling. It's most noticeable in the gif of yours with the ships and signs.
Re: Lovox - Load and render voxels in Love2d
Fantastic work! Really!
Borrowing from your mentioned Sprit3r, I made a .vox to your model format converter. Simply drag your .vox models into the window and retrieve them from your LOVE directory, from "Vox-to-Model Converter".
It uses the filename for the folder name.
Shout-out goes to kikito for his voxel libraries and to evgiz for his aforementioned Sprit3r.
Also, using MagicaVoxel for model editing makes making models a lot easier. Hence, why I "ported" over this converter.
Borrowing from your mentioned Sprit3r, I made a .vox to your model format converter. Simply drag your .vox models into the window and retrieve them from your LOVE directory, from "Vox-to-Model Converter".
It uses the filename for the folder name.
Shout-out goes to kikito for his voxel libraries and to evgiz for his aforementioned Sprit3r.
Also, using MagicaVoxel for model editing makes making models a lot easier. Hence, why I "ported" over this converter.
- Attachments
-
- GenerateModelFromVox.love
- (3.73 KiB) Downloaded 482 times
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Lovox - Load and render voxels in Love2d
Awesome!Davidobot wrote:Fantastic work! Really!
Borrowing from your mentioned Sprit3r, I made a .vox to your model format converter. Simply drag your .vox models into the window and retrieve them from your LOVE directory, from "Vox-to-Model Converter".
It uses the filename for the folder name.
Shout-out goes to kikito for his voxel libraries and to evgiz for his aforementioned Sprit3r.
Also, using MagicaVoxel for model editing makes making models a lot easier. Hence, why I "ported" over this converter.
Would you mind if I added this as a module to the library? Both as a way to convert .vox to .png, but also the ability to load in .vox's directly. (Obviously you wouldn't want to do that in a finished game, but it could be good for quick testing.)
On a side note, is the documentation good enough? I know it's pretty crummy, but does it atleast make the lib usable?
Re: Lovox - Load and render voxels in Love2d
I would be honoured. Kikito's voxel library is under MIT license as far as I know.Tjakka5 wrote: Would you mind if I added this as a module to the library?
It is usable in it's current state, but not very user-friendly. I would for one add more documentation about the camera (does it rotate around the origin, or the point where it's looking? A simple function list would be nice); and about the ModelData.Tjakka5 wrote: On a side note, is the documentation good enough? I know it's pretty crummy, but does it atleast make the lib usable?
Does it detect a change in camera angle or sprite position itself to update, or does one need to do it manually?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Lovox - Load and render voxels in Love2d
Tjakka! Great work
Re: Lovox - Load and render voxels in Love2d
I feel so bad for not realizing this earlier.
The whole process can be much, MUCH faster by using shaders.
Excuse me for a few days while I redo the rendering code.
The whole process can be much, MUCH faster by using shaders.
Excuse me for a few days while I redo the rendering code.
Re: Lovox - Load and render voxels in Love2d
That was exactly what I was trying to do right now. I'm not sure how would be the best way of handling voxels. I was trying to first do a simple vox renderer, but I'm not sure, it might end up being too slow with so many draw calls.Tjakka5 wrote:I feel so bad for not realizing this earlier.
The whole process can be much, MUCH faster by using shaders.
Excuse me for a few days while I redo the rendering code.
Who is online
Users browsing this forum: SiENcE and 5 guests