forked from 1b-agent/opencadstudio-upstream
feat(render): double-single corners for the image pipeline
Raster-image quad corners derive from a large f64 insertion point plus small u/v spans; the single-f32 cast quantized them at UTM scale. The ImageModel now keeps a corners_low residual, ImageVertex carries pos_low (location 2), and image.wgsl reconstructs the eye-relative position from the high/low pair. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
0f7920dc2c
commit
bd12cc2f5a
3 files changed
+50
-42
No files matched your search
@@ -40,8 +40,9 @@ const DRAW_ORDER_BIAS: f32 = 0.001;
|
||||
|
||||
// ── Vertex stage ──────────────────────────────────────────────────────────────
|
||||
struct VertIn {
|
||||
@location(0) pos: vec3<f32>,
|
||||
@location(1) uv: vec2<f32>,
|
||||
@location(0) pos: vec3<f32>,
|
||||
@location(1) uv: vec2<f32>,
|
||||
@location(2) pos_low: vec3<f32>,
|
||||
};
|
||||
|
||||
struct VertOut {
|
||||
@@ -52,7 +53,8 @@ struct VertOut {
|
||||
@vertex
|
||||
fn vs_main(in: VertIn) -> VertOut {
|
||||
var out: VertOut;
|
||||
out.clip_pos = u.view_rot * vec4<f32>((in.pos - u.eye_high) - u.eye_low, 1.0);
|
||||
let rel = (in.pos - u.eye_high) + (in.pos_low - u.eye_low);
|
||||
out.clip_pos = u.view_rot * vec4<f32>(rel, 1.0);
|
||||
out.clip_pos.z = out.clip_pos.z - img_params.draw_depth * DRAW_ORDER_BIAS * out.clip_pos.w;
|
||||
out.uv = in.uv;
|
||||
return out;
|
||||
|
||||
Reference in new issue
Block a user