Jump to content
Josh

Voxel Code

Recommended Posts

I don’t know. There are too many unknowns. I think at some point I should take a month to experiment with this.

nvidis is recommending a hybrid tenderer which is good because a full raytracer would eliminate all our speed advantages, since all the work would be performed on the GPU.

Share this post


Link to post

Now the thing that bothers me about this idea, and a few people have raised it, is that our whole selling point on the new engine is speed, and this contradicts that message. If "Turbo Game Engine" runs at 10 FPS, it's not very turbo, is it? And if not speed, why do people buy it? Well, now we are back to the Leadwerks marketing that says :"it's a nice program and lots of people like it, maybe you will like it too".

So it might be that there is an opportunity to recreate these kinds of renderings with voxel GI code that runs much much faster. That would be a big selling point. Of course it would get buried and ignored unless the users make good use of it, create good screenshots and videos, and brag about how great their engine is.

  • Like 1

Share this post


Link to post

Now what would be very interesting is if we can produce the same results as RTX with a fast voxel method and show them side by side. I have some ideas how this can be done. In order to increase the resolution we will need to use less memory, so that means storing a more complex sparse octree structure I in VRAM instead of just a 3D texture.

Share this post


Link to post

I'm still new to programming but would applying a greedy meshing algorithm make things faster?  I'm trying to see if I can somehow use your code to create a mesh from a std::vector<Vec3>. I'm using this greedy algorithm converted to C++. https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/

I'm trying to create a minecraft clone using leadwerks but I think I'm in way over my head. I've already got the algorithm working. Only problem is when I try to create the mesh inside the algorithms loop I'll get like 30fps trying to render it. So I'm trying to figure out how to take a std::vector<Vec3> and use leadwerks to render it outside of the loop.

Voxels.png

Share this post


Link to post

You could perform your mesh algorithm on another thread. You can’t create the Leadwerks mesh on another thread but you can get all the daya for the mesh ready.

Share this post


Link to post
13 hours ago, Josh said:

You could perform your mesh algorithm on another thread. You can’t create the Leadwerks mesh on another thread but you can get all the daya for the mesh ready.

Thanks for the suggestion I'll keep that in mind. I don't know how to program threads yet but I've heard of other people using them in voxel programs. I'll have to look up some tutorials. So far thought the greedy meshing algorithm is working great! I finally figured out how to generate the mesh separately from the algorithm. I even generated a larger chunk with minimal difference in performance and that's including a collision mesh.

 

 

voxel2.png

  • Like 3

Share this post


Link to post

If you keep developing this I would be interested in licensing the code to add a Minecraft-type game template to the new engine.

  • Like 1

Share this post


Link to post
On 1/14/2020 at 12:59 AM, Josh said:

If you keep developing this I would be interested in licensing the code to add a Minecraft-type game template to the new engine.

My hope is that I'll eventually get to having a base template just for that. I can't make any promises thought. Also I have some more question if you don't mind. What is the proper way to unload a leadwerks model? I'm experimenting with loading multiple chunks but I can't figure out how to get rid of models other than using hide(). Also does the engine already have some sort of frustrum culling built in?

I know once I get to creating and destroying blocks I'm probably going to have more questions. I can't quite figure out how I'm going to remove faces, since all I see are functions to move vertices.

Share this post


Link to post

In LE4 use Entity->Release(); In LE5 just set the variable to NULL.

Frustum and occlusion culling are built-in.

Surfaces can be cleared and re-built, but faces cannot be removed in LE4. In LE5 you can modify the vertex and indice arrays and then call Mesh->Finalize().

  • Like 1
  • Thanks 1

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...