mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-22 05:15:51 +12:00
Immediate mode vertex submission attempt 1
This commit is contained in:
parent
6ecdf71dbc
commit
922424b8d0
4 changed files with 61 additions and 10 deletions
|
@ -51,9 +51,9 @@ const char* fragmentShader = R"(
|
|||
fragColour = colour;
|
||||
}
|
||||
|
||||
// Get original depth value pre-perspective by converting from [near, far] = [0, 1] to [-1, 1]
|
||||
// Get original depth value by converting from [near, far] = [0, 1] to [-1, 1]
|
||||
// We do this by converting to [0, 2] first and subtracting 1 to go to [-1, 1]
|
||||
float z_over_w = gl_FragCoord.z * 2.0f - 1.0;
|
||||
float z_over_w = gl_FragCoord.z * 2.0f - 1.0f;
|
||||
float depth = z_over_w * u_depthScale + u_depthOffset;
|
||||
|
||||
if (!u_depthmapEnable) // Divide z by w if depthmap enable == 0 (ie using W-buffering)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue