I think next I will work on moving the code that generates the vertex and indices arrays, from TChunk to TChunkManager. The latter has easy access to surrounding chunks so I can easier do some culling when drawing at the edge of the chunk. I thought at the same time I would also optimize the attribute data. https://www.khronos.org/opengl/wiki/...ttribute_sizes Not sure how to 'cheat' and insert four bytes instead of single, and how get 'use' them as bytes instead os a single in the shaders.
Also, is there a better way to get undefined entry from TDictionary? Feels kind-a odd, that part getting a key/id from ListLoad
Code:
procedure TChunkManager.ListLoadChunksProcess(const Steps: Cardinal);
var
I: Integer;
aID: String;
C: TChunk;
begin
for I := 1 to Steps do
begin
aID := '';
if ListLoad.Count > 0 then // If we have entries in the ListLoad
for aID in ListLoad.Keys do // Get one of them
break;
if aID <> '' then // If we do have Chunk to load
begin
ListLoad.Remove(aID); // Remove the Chunk ID from ListLoad
C := ChunkLoadCreate(aID); // Load Chunk from disk or create it
ListLoaded.Add(C.ID, C); // Add to list of loaded chunks
end
else // Break out, nothing to process
break;
end;
end;
Bookmarks