PDA

View Full Version : My voxel editor



Jimmy Valavanis
08-05-2013, 02:46 PM
Title say it all.
A simple voxel editor I wrote some weeks ago, upgraded last few days to import kvx files (the build engine voxel format). This project started as a help tool to my future plans about supporting voxels into the DelphiDoom engine, but can easily fit to other needs.
Simple interface, multiple undo/redo, with simple editing, just like a basic paint program (select a level on xy, xz or yz and paint with the mouse), you can also import images into current editing level and also rotate it.
Main window is splitted in 2 panels, left is 2d drawing of the current level, right is the 3d preview (along with a grid to indicate which level is currently in edit mode).
Saves in it's own file format (readable ascii), you can easy change it to save some other (binary) format.

Executable and full source code: https://sourceforge.net/projects/delphidoom-voxel-editor/

https://i.postimg.cc/W3RgH8yP/ddvox01.png (http://postimg.org/image/lo42khe09/)

https://i.postimg.cc/FRtH4BmD/ddvox02.png (http://postimg.org/image/w9nxwhkbt/)

Daikrys
12-05-2013, 08:51 AM
hey thats looking neat, will give it a test soon :)

Ñuño Martínez
13-05-2013, 04:49 PM
Nice work. :)

laggyluk
16-05-2013, 02:55 PM
qtintf70.dll is missing

Jimmy Valavanis
17-05-2013, 05:10 AM
qtintf70.dll is missing

Fixed, thanks!

laggyluk
17-05-2013, 06:01 AM
nice, i'd suggest adding 2 buttons for scrolling up and down z-levels

Jimmy Valavanis
22-10-2017, 07:48 AM
A new version (1.3.1) is available.

Downloads: https://sourceforge.net/projects/delphidoom-voxel-editor/ (Windows Executable & full source code)

New features:
* Heighmap and terrain importing
* Copy/Paste front, back, left, right, top and down views
* Optimized OpenGL rendering (using technology from DelphiDoom's OpenGL renderer)

For Pascal Programmers:
Inside the vxe_mesh.pas file you can find the TVoxelMeshOptimizer class.
This class will optimize a (naive) voxel buffer (a plain 3-dimentional ARRAY - declared at voxels.pas file) to an optimized mesh structure (use the LoadVoxel() member function).
Then the mesh structure can be rendered with the RenderGL() member function.



Screenshots:

https://i.postimg.cc/4ybQs7sg/ddvoxel-04.jpg

https://i.postimg.cc/RVdLYHg1/ddvoxel-01.jpg

https://i.postimg.cc/ZKbr6qJW/ddvoxel-02.jpg

https://i.postimg.cc/HkWBW2rP/ddvoxel-03.jpg

Thyandyr
22-10-2017, 01:39 PM
I don't see any source in the file.

Akira13
22-10-2017, 02:45 PM
I don't see any source in the file.

Go here:

https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.3.1/

You'll see there's two files, one with the binaries and one with the source.

Thyandyr
22-10-2017, 05:25 PM
Go here:

https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.3.1/

You'll see there's two files, one with the binaries and one with the source.

Thanks. Pretty confusing site that sourceforge.

I get 'Left side cannot be assigned to' in pngimage.pas line 2769:

Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 2)^]; inc(Dest);

Replacing pChar with pAnsiChar in whole file helps.

Need also to comment out the third line


InitOpenGL;
ReadExtensions;
// ReadImplementationProperties;

To get it working. After that compiles nice on Berlin 10.1

Akira13
22-10-2017, 08:57 PM
So, I ported the application to Lazarus this morning as I didn't feel like reinstalling Delphi on my home computer just to test it out.

I've attached a zip file with the complete project source folder if anyone else using Lazarus wants to build it themselves.

Just so no one gets confused: this version uses FPC's ZStream unit and built-in PNG handling classes, so I didn't include any of the ZLib object files or PNG-related units from the original repository as they're no longer used at all. Also, FPC/Lazarus obviously doesn't use or need FastMM, so I didn't include those files either.

Lastly, @Jimmy: Feel free to take this version of the code and make a separate Lazarus tree on your SourceForge page, if you want.

Jimmy Valavanis
23-10-2017, 05:09 AM
So, I ported the application to Lazarus this morning as I didn't feel like reinstalling Delphi on my home computer just to test it out.

I've attached a zip file with the complete project source folder if anyone else using Lazarus wants to build it themselves.

Just so no one gets confused: this version uses FPC's ZStream unit and built-in PNG handling classes, so I didn't include any of the ZLib object files or PNG-related units from the original repository as they're no longer used at all. Also, FPC/Lazarus obviously doesn't use or need FastMM, so I didn't include those files either.

Lastly, @Jimmy: Feel free to take this version of the code and make a separate Lazarus tree on your SourceForge page, if you want.

That was fast :)

Uploaded: https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.3.2_FPC/

Ñuño Martínez
24-10-2017, 11:02 AM
Great!


Thanks. Pretty confusing site that sourceforge. Not so confusing as GitHub is. ::)

I'm serious. I don't know why GitHub is so popular (except that SF had problems in the past) because it is a mess. I have problems finding my own branches! :o Anyway I don't want to start a war, so use whatever you are comfortable with. :)

Jimmy Valavanis
29-10-2017, 06:38 PM
A new version (1.4.1) is available.

Downloads: https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.4.1/ (Windows Executable & full source code)

New features:
* Low level multithreading functions.
* Edit front, back, left, right, top and down views as a 2d plane.
* Crop heightmap & shrink heightmap functions.
* Elevation tool.
* Voxels can now have any size from 1 to 256.
* Create backup files while saving.
* File menu history.

Ñuño Martínez
31-10-2017, 12:18 PM
Voxels! :triumphant:

Nice work. :)

Jimmy Valavanis
11-02-2018, 07:48 AM
A new version (1.5.1) is available.

Download: https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.5.1/ (source code and Windows executable)

This new version add an option to easily create sprites from a voxel.
Sprites are exported in 8 or 16 angles, as PNG images inside a PK3(ZIP) file.

https://s20.postimg.org/fbbqagit9/Image1.jpg

https://s20.postimg.org/okdwk5zal/Image2.jpg

https://s20.postimg.org/u7a9i0zct/Image3.jpg

Roland Chastain
11-02-2018, 08:16 AM
Very nice. :)

Ñuño Martínez
12-02-2018, 01:00 PM
Everytime I see an update here, I wonder to reboot my old voxel engine (voxrend.sf.net/). I'm sure Thyandyr's one (http://www.pascalgamedevelopment.com/showthread.php?32622-Thyandyr-s-voxel-engine/) is great, but I prefer a more classic approach.

SilverWarior
12-02-2018, 06:31 PM
Everytime I see an update here, I wonder to reboot my old voxel engine (http://voxrend.sf.net/). I'm sure Thyandyr's one (http://www.pascalgamedevelopment.com/showthread.php?32622-Thyandyr-s-voxel-engine/) is great, but I prefer a more classic approach.

Reboot your old voxel engine? Don't!
No offence but performance difference between old approach on making voxel engine and a modern one can be huge. I think it might be better if you stay focused on Allegro.
Sure rebooting your voxel engine might increase interest in Allegro as well since it is build on top of it but is it worth it? Do you think you can pull this off before your old approach becomes completely obsolete by new technology? Besides do we need two Voxel engines? I would rather have one of high quality rather than two of mediocre quality.

Maybe it would be even better if you get in touch with Thyandyr and work together on his. I'm sure he could benefit from your experience.

Ñuño Martínez
13-02-2018, 11:27 AM
(...) I think it might be better if you stay focused on Allegro.
Sorry. I lost focus easily. Yes, I should finish Allegro.

SilverWarior
13-02-2018, 05:20 PM
Sorry. I lost focus easily. Yes, I should finish Allegro.

Well if it is any conciliation to you I have the same problem. I myself also loose focus to easily.

Carver413
19-02-2018, 06:11 PM
Everytime I see an update here, I wonder to reboot my old voxel engine (voxrend.sf.net/). I'm sure Thyandyr's one (http://www.pascalgamedevelopment.com/showthread.php?32622-Thyandyr-s-voxel-engine/) is great, but I prefer a more classic approach. I think as long as you enjoy working on it you should continue,you never know where you might end up. there will always be something better out there but that doesn't mean we should all give up

Jimmy Valavanis
14-11-2018, 12:44 PM
Version 1.6.1 is available.

What's new
Create or modify voxels with advanced scripting (thanks to Remobject's PascalScript).
Create auxiliary voxel buffers at start-up to avoid repetitive memory allocation and de-allocation.
Paint-Editing preview changed to be more "eye-friendly". The borders of the rectangle that represents a voxel/pixel, are not black anymore. Instead we use a color similar to the color of the voxel itself.
OpenGL rendering clean-up and fixes.
Sprite export in 32 angles, sprite export dialog with many options.


Downloads
Windows Executable and source code: https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.6.1/
Scripting examples: https://sourceforge.net/projects/delphidoom-voxel-editor/files/Examples/


Screenshots

https://i.postimg.cc/NFRDpBKT/animals.jpg

https://i.postimg.cc/X78cJ2dV/lavarock1.jpg

https://i.postimg.cc/W3FXqMj5/exportsprite.png

Ñuño Martínez
29-11-2018, 12:05 PM
Great.

If sprite exporting can be done in simple bitmaps (i.e. PNG, TGA or similar) then it is perfect.

Also, allowing to save in VOX format would be great.

Jimmy Valavanis
04-12-2018, 09:16 AM
Great.

If sprite exporting can be done in simple bitmaps (i.e. PNG, TGA or similar) then it is perfect.

Also, allowing to save in VOX format would be great.

When you select the PK3 output file and PNG as the sprite format, the sprites (in all angles) are exported in a PK3(actually zip) file as PNG Images.
Also the left / right / front otc views are actually a sprite-like representation of the voxel (isometric projection).
Other voxel formats are a little obscure to implement (tried to make a kvx export but it was much more tricky and difficult than reading them).
Haven't tried vox format. After some google search, I found some documentation at https://github.com/ephtracy/voxel-model/tree/master/vox.

Ñuño Martínez
20-12-2018, 05:35 PM
Not sure that's the vox format I'm asking from. You can find a description with the Build Engine sources.

Jimmy Valavanis
24-12-2018, 07:19 AM
Not sure that's the vox format I'm asking from. You can find a description with the Build Engine sources.

I thought you were talking about MagicaVoxel file format :)

Jimmy Valavanis
04-10-2019, 03:22 PM
Version 1.6.3 is available.

What's new
slab6 *.VOX files support. Both importing and exporting.
Convert voxel to 256 color palette.
Change working palette.
Quantize voxel pixels to 256 color palette.
Batch convertion of ddvox files to slab6 *.VOX files.
Lowest CPU utilization when idle.
Fixes to mouse control movement.
Fixed export sprite in PK3/ZIP file.
Speed optimizations in export sprite using multiple CPU cores.


Downloads
Windows Executable and source code: https://sourceforge.net/projects/delphidoom-voxel-editor/files/DD_VOXEL_1.6.3/


Screenshots

https://i.postimg.cc/vBK1CZHD/quantize-image.png

Ñuño Martínez
12-10-2019, 09:18 AM
VOX support. Nice!

I've tested on Linux using Wine and it works! :)