Two months, I finally added the specular term of PBR implementation (hence, a complete calculation of PBR) in my home engine, so I can start implementing more graphics features. But I found a couple of bugs on the engine I need to fix and reducing some memory usage on GPU. Plus, I got really annoyed by the fact that I need to rerun the engine every time I changed a simple value for testing. I decided to make a simple tool editor for the engine so I can change some settings during runtime – I’m still on the early stage on this.
Read MoreTag: Progress
-
In these two months, I’ve been working on implementing the PBR rendering in my home engine (Zooid Engine). It’s still missing a couple of rendering features, but the basic PBR and the light equation is finally done. But I only make PBR works for the deferred rendering, and not the forward rendering pipe (at least, not yet).
Read More
-
Progress
Zooid UI
I worked on ZooidUI mostly in January. I fixed a bug where the interaction can happen when the UI component is being culled out by UI mask that I implemented in December.
I implemented a basic list view on the UI system. I tried to make this easy to use by me and other programmers. I came up with the idea to use a lambda function to create/generate UI for each item in the list view. This implementation makes each item in the listview easier to manage and customize.
ZE::UI::DoListView("ListTestWithLambda", ZE::UIRect(ZE::UIVector2(0.0f, 0.0f), ZE::UIVector2(210.0f, 70.0f)), listItem, 5, [](const char*& text, ZE::UInt32 idx) { ZE::UI::DoText(text); } );
The function
Read MoreDoListView
will create the list view based on the parameters. The first one is the string identifier for the list view. The second parameter is a drawing rectangle where the list view should be drawn. If the rectangle can’t have the actual content of the list view, the scroll bar will be shown. Now, It only supports vertical scrollbar. The third and the fourth parameters are a pointer to an array and the size of the array. The last parameter is the lambda function. The function should pass the reference of the data type of the array (in this case, string orchar*
) and the index of current item being processed. The result will look like the image below.
-
Progress
Zooid Engine
In October, I implemented Depth Pre-Pass into the Deferred rendering. With Depth Pre-Pass, the result can be used to make GPU occlusion queries. The queries are simply asking whether the object should be rendered or not.
How it works is by sending the draw to GPU and ask if any fragment passed. Instead of passing the model itself, passing a simple bounding box would be enough. Of course, the query can be false positive but in very rare cases (well, depending on the scene setup). Better than occluding something that should be rendered.
Besides the objects, I also implement a query for Light frustum, whether we should process the light or part of the light. The occlusion query for the light frustum helps for reducing shadow maps generation load. For example, directional light has four cascaded shadow maps based on distance from the camera. Instead of generating all four shadow maps, we can check the last three cascade shadow frustum against the scene depth. If the frustum query is failed, then we don’t need to generate the shadow maps for that frustum. Let’s say, the camera looking closely into a curtain, generating shadow maps behind the curtain is really a waste of time and the player can’t see any shadow behind the curtain anyway.
Read More
-
Progress
Zooid Engine
- Added separate draw list for rendering depth shadow map. There was some issue with shadow rendering on the engine before, which used the same draw list for drawing the actual scene. This implementation caused some problems where shadows will not be rendered in the place should be in shadow since the occluder is not part of the scene draw list. To fix this, I implemented a separate draw list for each light in the scene. The draw list is generated based on the light type.
- Directional light will use Cascaded Shadows Map (CSM) – uses four shadow maps, and to generate draw list, it will use four orthographic frustums for each shadow map.
- Point light uses four frustums to generate the draw list in all four directions.
- Spotlight uses a perspective frustum to generate the draw list.
- Updated the ZooidUI code to use the latest one, along with the new update from this month. This update will include a bunch of UI components, like vector input, slider, text input box, panel, and some update on code simplicity (see ZooidUI update).
- Added support for Anisotropic filtering, also added support for OpenGL Renderer. If you see the previous update, you will notice that the texture on the floor looks blurry. Because the camera looked at the floor at the steep angle, causing the texture filtering failed (it was using trilinear filtering, I believe). I added support for enabling Anisotropic filtering on the texture object in GPU.
- Implement Depth Pre-Pass. I did read some graphics studies in the last couple of months and found out that most of them using Depth Pre-Pass (another name: Z pre-pass). This pass will help to reduce the number of fragment/pixel shader calculations in the next render pass – GBuffer pass for deferred rendering or rendering the actual scene in forward rendering. In the Depth Pre-pass, there are two passes. In the first pass, it will take only the scene to depth buffer for the first pass. In the second pass, the renderer will use the first pass’ depth buffer to render the scene and only render each pixel if the pixel passes the depth test (with compare function: less and equal than). The depth map result can also be used for GPU queries for the next pass, for example, filtering the scene draw list before sending it to the GPU (Query of drawing simple mesh – most likely box – before drawing the actual complex mesh).
- Fixed some rendering bugs:
- Fixed frustum calculation from View Matrix;
- Fixed bounding sphere and box for mesh that used for frustum culling;
- Fixed frustum generation for CSM (Cascaded Shadow Map) for directional light. This fix will make the shadow frustums to fit each partition of the view frustum and improve the quality of the resulted shadow maps.
- Added separate draw list for rendering depth shadow map. There was some issue with shadow rendering on the engine before, which used the same draw list for drawing the actual scene. This implementation caused some problems where shadows will not be rendered in the place should be in shadow since the occluder is not part of the scene draw list. To fix this, I implemented a separate draw list for each light in the scene. The draw list is generated based on the light type.
-
Progress
Zooid Engine
- Imported Crytek Sponza to the engine format. I got the Crytek Sponza scene model from McGuire Computer Graphics Archive. I still need to implement a lot of stuff in this scene: better CSM, bump mapping, and anti-aliasing.
- Improved the engine’s model parser. For the Sponza scene to be able to load in the engine, I needed to fix, modify, and add some features in the engine’s model parser.
- There was an issue I encountered during the model parsing, mesh name issue. I used Assimp as a library to load the model. I realized the name for the mesh isn’t unique. So, when saving the result, it will override the previous mesh with a newer one.
- Added support for scaling the model when importing.
- Added support for creating a scene file. Assimp will break the model into several meshes. The Model Parser now will have an option to create a scene from the model file by combining all meshes into one big scene file.
- Add support for importing material with mask texture.
- Implemented mask texture. As in the Sponza scene, it has some materials that have mask texture (like, leaf and chain).
- Added translucency pass. This pass happens after we have done with Lighting pass. Since the Deferred Rendering doesn’t fully support with any translucent object, this pass will use standard forward rendering: sort the object back to front, and render object one at a time with the light calculation.
-
This month is a really busy month for me. I had things going on almost every week. I got a small amount on time on reading books and working on my stuff. But, I managed to do some little works on my personal projects, did some small tutorials and read one rendering-related article.
Read More
-
Progress
- Zooid Engine: Implemented working SSAO (Screen-space Ambient Occlusion) in Deferred Rendering.
- Zooid Engine: Optimize GBuffer texture memory usages, set proper texture format for each GBuffer output.
- Zooid Engine: Implemented culling for spotlight and point light. If the light being culled, it will be excluded from scene lighting calculation in the scene and the shadow map will not be generated as well for that light.
-
Progress
- Zooid Engine: Simple Render Graph System. This is a really simple system for now. Render Graph can contain multiple render passes. Each pass has input and output. Currently, input and output on the render graph only limited to Frame Buffer and Texture Buffer.
- Zooid Engine: Implemented Deferred Shading using simple render graph. It is working now. Not really robust. There is still room from improvement.
- Zooid Engine: Added some Render/GPU Debug group for debugging GPU calls on GPU Debugger tools.
- Zooid Engine:Implemented Point light with shadow map. Current implementation of shadow map is using 4 2D texture separately instead of using them as a cubemap. It is easier for the current implementation of the engine. But I need to refactor the system to support cubemap to improve the performance.
-
I like when someone sharing their progress on Twitter (I’m mostly on Twitter, follow me @azon04 !) or a blog post about their progress on game-related stuff, such as graphics rendering, shader works, or the engine they have been working on. It encourages me to read, learn and do more.
I’m starting this “Game Programming Journey Monthly” to facilitate me to share what I learned and I worked on that game-related in my free time and also as a quick note for me. Another reason for doing this is making my website and blog a little bit alive.
As the word “Monthly”, meaning that I will be sharing it in one month term. Initially, I was trying to post biweekly, but when I was writing the blog post, not enough stuff to share. Working on my free time besides works in two weeks, I barely make complete progress on something.
As the breakdown for each post, I haven’t decided yet. But, at least I will have a progress section and a learning section. The progress section will contain things that I worked on that month and the learning section will have things that I learned on that month. This can be tutorial, book/article reading, or any form of learning. The other section I might have in the blog post is a tools section. I think this is kind of quick review of one or two tools that I used most during the month those help me making progress on my personal project or learning new stuff. I probably add more while writing the blog post as needed.
I hope I can keep doing this for months, years or even decades. Wish me luck!