set MY_VS_GENERATOR="Visual Studio 17 2022"
%MY_CMAKE_EXE% ..\..\repos\Vulkan -G %MY_VS_GENERATOR% -A x64
rem Open generated vulkanExamples.sln and build.
To learn OpenGL I wrote a simple game that utilizes the most of basic OpenGL ES 2.0 (and partially 3.0) techniques:
MVP matrix. In 3D version of the game the projection matrix is calculated depending on the window size (viewport).
All the objects including the board, balls, path arrows, sparkles, explosion particles sit in vertex buffers and are rendered with vertex/fragment shaders.
The light is implemented with common fragment shader calculating ambient, specular and diffuse coefficients. The sparkle position is found by iterating over the normals and searching the maximum light coefficient.
The antialiasing is achieved by rendering the scene first to 4 times bigger offscreen buffer and then rendering the buffer to the screen with multisampling.
Color coding is used to determine what object the user has clicked on. The board and the balls are rendered first with alpha containing the object identifier (that is why the board size is limited with 15×15), then alpha is erased and the background is rendered over it with a specific blending operation.
Textures are used for rendering the background images, sparkles and particles.
All the rendering is done on a separate thread and the swaps (flips) are synchronized with the monitor refresh cycles. This prevents screen tearing and saves the battery power.
Today I played a bit with a UWP application based on “XAML App for OpenGL ES (Universal Windows)” template and realized that there is some specific bug probably related to the interaction between SwapChainPanel and OpenGL surface. First, I made the cube transparent by changing two lines of code in the vertex shader:
and used some OpenGL 3.0 features in my Universal Windows App. But today I tried to compile my application with the new version of ANGLE library and got EGL_BAD_CONFIG error while creating the OpenGL context. The source code that returns this error checks some EGL_OPENGL_ES3_BIT_KHR that is not set in the new version: