(I was writing this post for 2 hours, followed by a power outage, but here we go again!)
1. Yeah they are 😉 I probably should have been more clear about that. The only crash I have left atm (sometimes) is when the application is shut down, but that's avoidable by letting Windows clean up the memory instead of doing it myself, so I'm just ignoring that.
2. What I discovered yesterday, that if I instead of drawing all valid VBOs, I only draw the ones that are in renderScene->begin() / renderScene->end(), I end up with chunks missing in a rather consistent location. If I draw all valid VBOs, the world is jittering and random chunks disappear randomly. (a chunk is considered valid when it hasn't been deleted and when a new VBO has not yet been generated for that chunk). I'm assuming the renderScene method is the more correct one, so I'll be going onward with that (it still causes missing chunks).
3. I'll be comparing the code with the demo, seeing as that as soon as I added movement, it never fully worked to begin with (as you can see in one of the previous posts). See below.
4. With the renderScene drawing method, the gaps are already existent pre-movement (everything is displaying properly using the draw-all). Using the renderScene method, the gaps are consistent in location, although not consistent in whether or not they show up. They show up about 70% of the time.
- Variables are moved from the main function to the class variables. The class itself is created on the heap, and all variables are created on the heap as well.
- The demo uses a separate clipmapView to initialise the materials. My version uses the same clipmapView for both.
- Their movement is done through direct manipulation. Mine is doing through the location of the player.
- My version has a time delay between initialisation, and the actual start of the thread.
- Demo runs rendering on the DrawGLScene function, mine runs it in the main thread. The demo has the cell generation on the main thread. Moving mine to the main thread, makes it more consistent but still goes wrong from time to time. It also drops my FPS down significantly whenever it's loading cells.
- Demo sets scale during rendering, I set it during initialisation.
- I keep track of the cells in a TMap<CellId, TVector<VBO>> rather than a TMap<CellId, VBO> to be able to delete them safely without multithreading issues with the rendering thread.
- Demo runs using wireframe, I'm using a single buffer containing vertices, uvs, and normals.
- Demo saves VBOs per cell, then per medium. I save them per medium, then per cell.
- The demo works! ... ':-D
Same chunks, sort of
These seem to be the chunks that are disappearing??? (on the left, above the terrain)
Clearer image of the above
And another example in a single image (on the left, slightly above the disappeared terrain)
And sometimes it works