mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 22:05:38 +00:00
Optimise depth calculation for quad shader.
This commit is contained in:
parent
6eaf204d72
commit
6075352868
|
@ -315,7 +315,7 @@ void QuadraticInterpolation()
|
||||||
depth = ((vertex.z / vertex.w) + 1.0) / 2.0;
|
depth = ((vertex.z / vertex.w) + 1.0) / 2.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vertex = projMat * vec4(fsViewVertex,1.0);
|
vertex.z = (projMat[2][2] * fsViewVertex.z) + projMat[3][2]; // standard projMat * vertex - but just using Z components
|
||||||
depth = ((vertex.z * interp_oneOverW) + 1.0) / 2.0;
|
depth = ((vertex.z * interp_oneOverW) + 1.0) / 2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue