feature/imgui-sdl
points-test
Last change
on this file since 2d87297 was 60578ce, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago |
In VulkanGame, make lighting work correctly in the ship shader with the model, view, and projection matrices all being applied
|
-
Property mode
set to
100644
|
File size:
643 bytes
|
Line | |
---|
1 | In opengl, (-1, -1) is lower left
|
---|
2 | In vulkan, it is upper left, so I set the projection matrix [1][1] cell to -1 to flip the y-axis and make it match opengl
|
---|
3 |
|
---|
4 | depth ranges ([-1, 1] in OpenGL, [0, 1] in Vulkan)
|
---|
5 |
|
---|
6 | Vulkan coordinates:
|
---|
7 | X+ points toward right
|
---|
8 | Y+ points toward down (but I flip it in vulkangame in the perspective matrix to point up)
|
---|
9 | Z+ points toward inside the screen
|
---|
10 |
|
---|
11 | In opengl, all 3 coordinates range from -1 to 1
|
---|
12 |
|
---|
13 | For the perspective matrix, after the vertex shader finishes, the x, y, and z of the final point are automatically divided
|
---|
14 | by the w. For testing the projection matrix in the console, I could do that manually as well.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.