A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
Name | Stars | Last Commit | Description |
---|---|---|---|
three.js | ![GitHub |
void main() | |
{ | |
vec3 positionX = backproject(depthTexture(pixelCoordinateI), inverseViewProjectionMatrix); | |
vec3 normalX = normalTexture(pixelCoordinateI); | |
// get ONB to transform samples | |
mat3 orthoNormalBasis = computeONB(normalX); | |
// select samples for pixel out of pattern | |
int patternOffset = getPatternOffset(pixelCoordinateI); | |
float ao = 0.0; |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
Name | Stars | Last Commit | Description |
---|---|---|---|
three.js | ![GitHub |
So, many places will give you clues how to get linear depth from the OpenGL depth buffer, or visualise it, or other things. This, however, is what I believe to be the definitive answer:
This link http://www.songho.ca/opengl/gl_projectionmatrix.html gives a good run-down of the projection matrix, and the link between eye-space Z (z_e
below) and normalised device coordinates (NDC) Z (z_n
below). From there, we have
A = -(zFar + zNear) / (zFar - zNear);
B = -2zFarzNear / (zFar - zNear);