So, been up to a lot of new stuff lately.
Thanks to whoever invented the material plugin system.
I am reworking the materials to allow for dynamic lighting as you can see here:
Also added a way to create a mesh from voxel data that you can do anything with:
I also worked on something that you can’t directly see.
I converted all voxel object data to raw binary data that is synced between all the threads that need it.
It is accessed using the DataView object.
So, it brought down the memory usage for 14 voxels from 2kb per thread too 100 bytes for all threads.
I will be working on more optimizations like this in the future
You understand most of us would know the sh*t about how you can push it to this level of optimization, yes? Just don’t let anyone say that BJS cannot be optimized to the outmost performance. For anyone who dares saying this to me, I shall from now on simply forward the link to your demo
Well it is honestly awesome and basically unlocked so many things.
Thank you! I think it will really take BJS to the next level.
With it I even got normal maps working now:
Well I would appreciate that lol.
I am making this project because I believe in the power of JS and its’ future.
~~I also have a background in computer science so that helps a bit with a lot of this stuff.
I am very much a computer nerd at heart.
I’m totally hypnotized! AND I LOVE IT!
Indeed you’ve been making progress at an insane speed, but never forget to take care of yourself too! We’ll always be here to marvel on your updates
Though be mindful you will need a decent PC with a good GPU because of all the shader effects.
Which I will make a way soon to turn all of that off as I’ve seen it cause some issues for people.
I am releasing Alpha 1.2.2 this week. I made some huge changes to the engine.
I actually was able to make the engine faster and reduce the complexity by a lot.
I wrote a whole new library called ThreadComm to handle all the multi threading and data syncing for the engine.
For the engine’s API it uses something called tools now.
The first one being a brush. So, to generate a simple world all you have to do is this:
import { DVEW } from "../../../../out/World/DivineVoxelEngineWorld.js";
const brush = DVEW.getBrush();
export const WorldGen = {
generateChunk(chunkX: number, chunkZ: number) {
brush.start().setId("dve:dreamstone");
for (let x = chunkX; x < 16 + chunkX; x++) {
for (let z = chunkZ; z < 16 + chunkZ; z++) {
for (let y = 0; y < 18; y++) {
if (y < 5) {
brush.setXYZ(x, y, z).paint();
}
}
}
}
brush.stop();
},
};
The other tools are:
Builder Tool - Used for building chunks.
Data Tool - Used for reading and updating voxel data.
Tasks Tool - Used for queuing up and running tasks like RGB light updates.
Included in the update is different dimensions. So, you have potentially infinite dimensions for your voxel game.
Also for the update I removed all the old player code and now every example uses the best player example and the current physics engine.
There a lot more changes but would take me hours to explain. Let’s just say I rewrote basically 70% of the engine and soon I will re-work the other 30% to start to get ready for WebGPU integration.