Rendering

So many descriptors in Vulkan

## Brainwash is always somewhere It's really a mess when I started to port my engine to Vulkan, there are too many new data types that mapped to those came-from-nowhere concepts, which I don't need to take care about previously. But luckily those concepts are well designed and once after you understand what they are, every pain you occurred would just disappear. The new generation graphics APIs all transport the responsibility of CPU-GPU communication to the user more or less explicitly, now…

Read
GameEngine

Welding (THE latest) C++ to Metal, and macOS

## For what? I've previously deployed my game engine to macOS successfully with GLFW and macOS's "vanilla" version OpenGL 4.1 library, everything was pretty smooth and sweet (and of course naive) at that time, and every few weeks I would port the latest updates from Windows side to macOS in an accumulated way. But as I started to utilize some C++17 new features, yep I mean `<filesystem>`, which Apple still didn't give us a certain answer (I've heard that there is something new with Apple Clang…

Read
Rendering

Normal and normal mapping

## A (not) tedium work Recently I started to port my project to DirectX 11, and it has lot of interesting differences with OpenGL such like the coordinates and matrix convention, stronger type safety requirement, better shader resources management (I didn't try OpenGL's SSBO yet but constant buffer is really easier to wrap into an elegant layer) and etc. One thing I stuck a little is the normal mapping there since I used the on-the-fly tangent generation in glsl, it quite confuses me at first…

Read
Rendering

Physically Based Rendering - Material

I learned the shading magic like how the most of others did, from a classic Blinn-Phong model to some more complex models like Cook-Torrance model, but the understanding would always be confined around the common practices shaped by our slow speed computer, and our eager desires for the more realistic results. With these compensations, tricks, and hacks we may achieve lots of cool and amazing stuff at first, but if we don't have a clear bird's-eye view (for example people like me who is always…

Read
GameMath

Row-Major or Column-Major? Some notes about matrix convention

## The mathematical conventions Generally speaking, when we want to "render" something to the screen, it means we need to calculate the "color" of each pixel on the refreshing LCD in front of us, and then ask some hardware to fulfill those pixels with the color we specified. But typically what we have in our hard disk are just some mesh and texture data files, which only contain some basic information about the object we want to render, like how many vertexes they have, where the vertex's…

Read
GameMath

Space, coordinates, and the magic Quaternion

## Where is where? In our daily life, when someone asked for direction, we would answer them like "walk toward **north** and turn **left** at the first corner", here we use some coordinate system to represent the relativity of position in the world, and in our virtual world we may want to use the same **north** and **left** at first. But since computer only knows 0 and 1, there are lots of difficulties to make a **north** really **north**. ![Diagram](../attachments/1540914386127.drawio.svg…

Read