Jump to content

Remove vertex from surface?


Lunarovich
 Share

Recommended Posts

I see that I can Surface::AddVertex. Is there a way to remove a vertex from a sruface or I have to rebuild it from scratch every time I want to remova a vertex?

 

I'm asking it because I'm trying to implement some voxel manipulation framework. At the moment, I rebuild a whole chunk when a single voxel is removed. Is it the only way to do it?

 

Thanks!

Link to comment
Share on other sites

I've been working for two days now. I have a basic voxel & chunk generating functions. Voxels are generated with invisible sides occluded. I still haven't implemented invisible chunks occlusion, but would consider my work basically done (for my intents and purposes) when I do it.

 

Namely, from what I've done so far, I've concluded that the number of surfaces is far more important than the number of vertices performancewise. That is, the surface number impacts the performance in a lot more significant way than the number of vertices. Here are facts (relative to my architecture) that lead me to that conclusion.

 

- With a chunk of 64 voxels per chunk dimension, you can easily have over 2 million of voxels with 60fps.

- With a chunk size of 16, you can still get away with over million of voxels and get a 60fps.

- With a chunk size of 8, you cannot go over 300 thousand and have a 60fps.

 

The problem is that a larger chunk requires a longer time to rebuild. A chunk of size 16 already makes the game visibly stutter for a fraction of a second if you move your character/camera and destroy voxels (I'm destroying them with a single mouse click instantly). The chunk of size 8 gives a barely visible split second stutter on a voxel destruction/rebuild, but suppose that's OK for a normal block building game.

 

So, as I've said, there is directly proportional relation of chunk size and number of chunks you can have in your game. The downside is that there is also a direct proportion between the chunk size and chunk rebuild time.

 

But to get to the point, chunk occlusion algorithm is far more important than vertices collapsing algortihm for flat chunk surfaces, because the performance impact of the number of surfaces is greater than that of the number of vertices.

 

P.S. I'm doing the chunk (re)building in Lua. Maybe a C++ would give better results. (I have a standard edition, but do not feel comfortable yet with C++).

 

P.S. Will send a commented code version as soon as I finish. Or commented version of what I've done so far if I change my mind on the way I'll implement my physics puzzler block manipulation game.

 

P.S. Thanks for the glasses smile.png A wayfarer model - my brother, who does the photography, took this photo of me in front of the Zurich lake.

  • Upvote 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...