-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|542|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Pakz
Created : 10 December 2022
Edited : 10 December 2022

Voxel-engine progress





Slowly I am adding and expanding with my mobile voxel project.

I added water yesterday. Stil needs testing and the actual swimming as the blocks are solid. I now know the 3d engines have trouble with transparancy.

I did a quick test with some trees. There is foliage but this is disabled. Infinite arrays are in also, but no edge map generators yet and a system for removing old meshes.

There are close to 50 'book' source code files here. I might turn these into a more coherent book or tutorial later.

github.com/Pakz001/html5examples/tree/master/3D/threeTest/Test

The link to version of screenshot.
cromdesi.home.xs4all.nl/html5examples/TouchscreenVoxelEngine/Book46.html

 

Comments


Saturday, 10 December 2022, 02:59
AndyH
Looks great Pakz.
Saturday, 10 December 2022, 03:05
Jayenkai
Amazing work!
Thursday, 15 December 2022, 13:24
Kuron
I continue to be impressed by, inspired by, and proud of Pakz!
Friday, 16 December 2022, 06:41
Pakz
I am hoping to figure out how to do a Minecraft style lighting system. First tests seem to point that I could get it working.

I have no idea what a vertex is. But these have r,g,b color values. These then set the color of a texture. .0 being black and 1 being original color. With a flood fill routine I could light around a torch on the world map. I do need to figure out how to darken caves while digging and such.
Friday, 16 December 2022, 06:51
Jayenkai
Vertex is the points around the box.
You have 8 vertices, one on each corner of the box, then 12 polygons.. 2 triangle polygons on each side of the box.

I imagine that going through every block and doing maths for every vertex would be VERY slow, and although I'm not sure how to do it any better, I wouldn't recommend that method!

It'd be ok for pre-rendered lighting, but not realtime.
Friday, 16 December 2022, 07:13
Pakz
The way three.js does it with the buffered meshes. Is that is has arrays which contains the values such as location and color values. Changing a color on a surface of a cube requires you to edit a couple of indexes in the array. A command has then got to be called to apply the changes.

A test which I did showed that it can be done realtime. This with a hundred cubes or so. I am using chunks which are a small collection of cubes. so this would not cause it to lag. It should also make it possible to do the entire world for light and day shifting. Even if this is slow, I could do it in a horizontal line across the map every few milliseconds.

I also figured out how to do the lighting at mesh creation time. If Minecraft could do it in 2011. Javascript should be able to do it in 2022. I read a technical article on how Minecraft did it back then.

They use a different method now which involves scanning the map and building only the visible part without checking each chunk data point, and even raytracing.
Friday, 16 December 2022, 08:21
Pakz
I am hoping to figure out how to do a Minecraft style lighting system. First tests seem to point that I could get it working.

I have no idea what a vertex is. But these have r,g,b color values. These then set the color of a texture. .0 being black and 1 being original color. With a flood fill routine I could light around a torch on the world map. I do need to figure out how to darken caves while digging and such.
Saturday, 17 December 2022, 07:04
Pakz
My website could be removed today. My provider would start removing all the webspace from today. I did get a email if I would like to remove it now, a while ago, or keep it. I am not sure if this means they wil not remove it now.

Here is the last upload I did for the voxel world. With partial ambient occlusion added.

cromdesi.home.xs4all.nl/html5/voxelthing/Book51.html
Saturday, 17 December 2022, 11:55
Kuron
If they take it all down, I hope you can put it all up somewhere else. I enjoy browsing through your site on a fairly regular basis.
Saturday, 17 December 2022, 12:02
Pakz
I am looking. I have a backup.

I tried doing a backup on the wayback machine. I would need to link everything on pages. I tried to link the voxelthing directory but there were a bunch of errors with the backup.

The wayback machine has a good part of the site already.
Saturday, 17 December 2022, 22:21
Kuron
If you need a new host and are willing to pay $5 a month, NeoCities is really good. I used to use them until recently. If I could figure out how to make a responsive site design I would still be using them.

https://neocities.org/supporter
Saturday, 17 December 2022, 22:49
Pakz
Nah, but thanks I am going to wait if my provider wil keep the site alive. Their mail about it could be interpreted as if they would allow some people to keep their sites. Else, I might just pick a large company like Strato if I really need to. I think they had a 1 buck a month for the first year offer. Maybe I could also package older projects and put it on sites like Gamejolt or itch.io.

I have a dropbox account. There is a sharing feature there that I need to look into also. No idea how that works.