So I’ve been a bit busy lately with optimizing my code a little bit, I’ve also added some data output and built a very basic scene to walk around in. I’ve added 2048 point lights for final presentation. Among the things I’ve done is also to improved my forward renderer a bit. Before in my forward shader I used a depth buffer that I filled in a pre-z pass and then used it to calculate the min/max Z value per tile, which is what you should be doing, however during my forward shader pass I then used the screens depth buffer which made the fps drop when I looked down the scene where a row of houses was placed. Generally I had 60 fps except in those cases, now in order to use transparency you will need to reconstruct the pre-z pass a bit since you need to check for transparent objects. In any case, the way I solved it since I wanted 60 fps for both techniques at all times during the final presentation is that I reused the depth buffer from the pre-z pass which meant I only had the closest fragments to color, which improves performance but like I said makes other things harder such as transparency. I’m happy with these results and since I do not have time to test MSAA and transparency I will leave that to the future. Here’s both techniquse, the lights still look ugly, I guess I just always forgot to change the attenuation, in any case here’s how it looks:
And here’s a bit of post mortem thoughts
During this project I’ve learned a lot more about OpenGL in general as well as increasing my knowledge about shading which is one of the goals I set for myself at the start of this project. Since our graphics course only touched on a few of the more interesting subjects I found it very fun to relearn even some of the basic things I didn’t fully grasp back then. I’ve also learned that the OpenGL wiki and khronos function specification webpages are good to read at least three times everytime you do something new as it saves you a lot of silly and sometimes time consuming mistakes. I’ve also increased my familiarity with switching between view spaces and transforms whereas I previously only knew the basics of them, I now feel comfortable changing positions to the right coordinate spaces in order to do say, per tile frustums or going back and forth between spaces. Learning how to use compute shaders was probably the single most important factor here, as I had to learn not just how to use them but how memory is synchronized as well as when and how you can read and write to uniforms and textures. In general I feel like I’ve become a lot better but I also know precisely what things I need to improve my knowledge upon and how much I still have to learn.
The most time consuming things and most frustrating things about the project always happened because I hadn’t read thoroughly enough, like for example I had written code that ”worked” in theory beacuse everything was correctly set up but I may have used say texture 14 when my graphics card could only support a few render targets and it could’ve easily been fixed by just using texture 0, which caused hours of frustration simply because I focused on how it was supposed to work rather than going back and reading the documentation thoroughly. In fact most of my mistakes were made this way, but in a way it’s a good thing because I’ve learned that until you do it right, you haven’t done it right, and if something works the first time you did it without really reading specifications thoroughly errors might occur later on. The general lesson I’ve learned here is that you should always be 100% sure of what you’re doing since it saves you trouble later on. I probably also spent more time on the culling methods than I should have as I first tried my own solution, then a clip space frustum culling before settling with a geomeotry based approach. While I did this and tried their performances I could’ve spent more time on a little more interesting things like MSAA and transparency.
Overall it’s been a pretty fun experience and I’ve really increased my knowledge a lot, and I’m going to continue work in this and improve it as well as keep on adding new features and learn even more things.