I love this
Seams like you put a lot of work into it.
Yes. Looks good now.
i moved my mesh generation from lua to a c++ extension.
in the screenshot you can see it from the text in the bottom right. the top image is before and the bottom one is after.
when updating the mesh it used to take around 120 ms on web and about 20 ms on the linux. this caused noticeable stutter.
after moving the mesh generation to c++ it now takes about 0.5 ms on the linux build. the improvement is pretty huge.
i still cannot run the c++ extension on the web build yet but i will figure that out. CubeMining by cenullum
i didnt implemented dmthreads properly so this error is not problem for now but if you know why you can tell
if the performance difference stays this big i will probably move the physics part to c++ too.
For threaded web builds, you need to support CORS from your server.
See e.g. defold/scripts/simple-cors-http-server.py at dev · defold/defold
I moved mesh generation, physics, npcs,ligthing to c++
also moved vertex buffer lighting to light texture
red box is collision shape of player
sneaking is fixed
and I still didnt fixed web version because of my laziness ![]()
you can see walking/sneaking state on blue text at top right corner
Incredible pace, great to see the progress! ![]()
water
very cooooool !
first version of chunk system which is very unoptimized
you can see frustum culling at end of the video
frustum culling does not work without AABB in buffer and how to add to buffer is not in docs
this code is part of my terrain mesh generation. After creating mesh you also need to update AABB.
for runtime AABB update in cpp . g_grid_size is 16 in my game .
// Add AABB metadata for frustum culling
float aabb[6] = {-0.5f,
-0.5f,
-0.5f,
(float)g_grid_size - 0.5f,
(float)g_grid_size - 0.5f,
(float)g_grid_size - 0.5f};
dmBuffer::SetMetaData(opaque_buffer, dmHashString64("AABB"), aabb, 6,
dmBuffer::VALUE_TYPE_FLOAT32);

You probably already know this, but a new constant type, CONSTANT_TYPE_TIME, has been added for shaders in 1.12.3 beta. I guess it might help with the water shader timing.
An example utilising this new time constant is also live: Texture scrolling


