Chunk management and transparency

It has been a long time since I last updated this blog. This is because I didn’t make any progress for some months. Some problems that were difficult to solve and transparency bugs stole a great deal of my motivation.

Transparency is a real bitch when you are developing a 3D scene. When looking through some transparent blocks, half of my chunks were not rendered at all! This week, a colleague pointed out that you have to render all your transparent objects at the end. You also have to sort them from far to near and render them in this order. I tried the first remedy and yes, it worked! Sorting, on the other hand is more difficult and only remedies the fact that you cannot see some other transparent objects. I will solve this issue later.

Another motivation killer was the fact that I didn’t like the performance of my virtual world. I have some separate thread that loads chunks into a VBO in a queued fashion but it gives me huge performance hiccups. Another performance eater was the visibility optimizer. What it does is this: it removes all faces that are facing a solid object, as you cannot see them anyway. Every time I loaded a chunk from disk, I recalculated those extra data. To solve this performance hit, I just save an extra file containing the visible faces with each chunk. The result was very noticeable, but I still have the VBO construction spikes.

By the way, I still didn’t had time for creating my own textures. I think that I first want the engine to be stable enough before I can begin to think about fancy stuff like this.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>