Results 1 to 10 of 34

Thread: Thyandyr's voxel engine

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Quote Originally Posted by SilverWarior View Post
    I'm not sure exactly how TDictionary works but in general when you are removing items from Lists it is always better to go from last item to first instead of always removing first item in a loop. Why?
    Because when you remove first item from the list all other items needs to be shifted in order to fill the hole that you caused by removing that one item. This results in lots of unneeded data moving in the list internal array.
    I agree and would have done it 'from count-1 downto 0' but that is not possible with TDictionary. Anyway freeing the Chunks is only for the program shutdown so performance is not that important anyway.

    Also I think if I do

    for Chunk in TDict.Values do Chunk.Free

    it still leaves the keys in, so the size of TDict size is not updated. Might be the size is not updated even if I removed the key as well, since there is some method to it called TrimExcess

    Didn't work much today.

    Fixed one bug, but made no progress on the case of too large VBO size causing full chunks disappear.

    Line of 11x11 size chunks along X axis. If I decrease the count by few they all fill a nice solid line as supposed to. Too many like here, and something gets corrupted. Note the closest artifact, the whole chunk is not missing, only half of it (It is hollow since none of the cubes that should not be visible are not drawn)

    Image2.jpg
    Last edited by Thyandyr; 03-11-2017 at 12:05 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •