mirror of
https://github.com/Nexoniarz/Fry3DX.git
synced 2026-11-03 04:24:26 +00:00
Shapes with live settings, shape editing, knife and hole tools, drawing shapes onto other objects, combining objects (add / subtract / overlap), copies, thickness, painting with stickers and layers, a Layout tab, a Print tab with checks, packed .fry files with autosave, export to GLB, glTF, FBX, OBJ, 3MF, STL and PLY, folders in Layers, its own crash screen, and a website for GitHub Pages in docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMSrd5oe1GpUD7E6d825KP
24 lines
969 B
GLSL
24 lines
969 B
GLSL
#version 460
|
|
// The hierarchical Z-buffer's base: the scene's depth shrunk to a small grid, each texel the
|
|
// farthest depth under it. The CPU reads it back and builds the rest of the pyramid (see
|
|
// Renderer::occluded). Rows match the depth buffer's on both backends.
|
|
#define KEEL_POST // screen-space: render targets, sampled clamped
|
|
#include "backend.glsl"
|
|
PUSH_BLOCK {
|
|
uint depth; // texture slot of the scene's depth
|
|
uint srcW, srcH; // its size
|
|
uint dstW, dstH; // this grid's
|
|
} pc;
|
|
|
|
layout(location = 0) out vec4 o_depth;
|
|
|
|
void main() {
|
|
ivec2 o = ivec2(gl_FragCoord.xy);
|
|
vec2 scale = vec2(pc.srcW, pc.srcH) / vec2(pc.dstW, pc.dstH);
|
|
ivec2 lo = ivec2(floor(vec2(o) * scale));
|
|
ivec2 hi = min(ivec2(ceil(vec2(o + 1) * scale)), ivec2(pc.srcW, pc.srcH));
|
|
float far = 0.0;
|
|
for (int y = lo.y; y < hi.y; ++y)
|
|
for (int x = lo.x; x < hi.x; ++x) far = max(far, fetchTex(pc.depth, ivec2(x, y)).r);
|
|
o_depth = vec4(far);
|
|
}
|