Created
July 22, 2020 11:22
-
-
Save hikiko/7f1a621aa879ffbf1f600c280ab83557 to your computer and use it in GitHub Desktop.
note to myself
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct { | |
float z; | |
uint32_t zs; | |
} *pixels; | |
int i; | |
pixels = calloc(w * h, 8); | |
glGetTextureImage(vkgl_depth_tex, 0, | |
GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, | |
w * h * 8, | |
pixels); | |
FILE *fp; | |
fp = fopen("foobar.txt", "wb"); | |
for (i = 0; i < w * h; i++) { | |
fprintf(fp, "%f %u\n", pixels[i].z, (unsigned int)pixels[i].zs); | |
} | |
fclose(fp); | |
└─ $ ▶ cat foobar.txt | awk '{print $2}' | sort | uniq | |
└─ $ ▶ cat foobar.txt | awk '{print $1}' | sort | uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment