forked from 1b-agent/opencadstudio-upstream
feat(render): double-single vertices for the mesh pipeline
3D solid / surface meshes were the last single-f32 path. truck's mesh tessellation now returns a paired verts_low residual (TruckTessResult::Mesh, polygon_to_result), MeshModel/MeshLodSet carry it, the model-space offset and block-instance transforms reconstruct the f64 position and re-split it after subtracting world_offset, MeshVertex gains position_low (location 3), and mesh.wgsl reconstructs the eye-relative position. Native SAT / ACIS / OBJ mesh paths default to a zero residual (no regression — they were never sub-f32 precise). With this every world-space pipeline (wire, hatch, image, face3d, mesh) is full double-single relative-to-eye; large-coordinate jitter is gone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
c0f3d0de5e
commit
ddf6344dbe
10 files changed
+112
-46
No files matched your search
@@ -30,9 +30,10 @@ struct Uniforms {
|
||||
var<uniform> u: Uniforms;
|
||||
|
||||
struct VertexIn {
|
||||
@location(0) position: vec3<f32>,
|
||||
@location(1) normal: vec3<f32>,
|
||||
@location(2) color: vec4<f32>,
|
||||
@location(0) position: vec3<f32>,
|
||||
@location(1) normal: vec3<f32>,
|
||||
@location(2) color: vec4<f32>,
|
||||
@location(3) position_low: vec3<f32>,
|
||||
};
|
||||
|
||||
struct VertexOut {
|
||||
@@ -45,7 +46,8 @@ struct VertexOut {
|
||||
@vertex
|
||||
fn vs_main(v: VertexIn) -> VertexOut {
|
||||
var out: VertexOut;
|
||||
out.clip_pos = u.view_rot * vec4<f32>((v.position - u.eye_high) - u.eye_low, 1.0);
|
||||
let rel = (v.position - u.eye_high) + (v.position_low - u.eye_low);
|
||||
out.clip_pos = u.view_rot * vec4<f32>(rel, 1.0);
|
||||
out.color = v.color;
|
||||
out.normal = v.normal;
|
||||
out.world_pos = v.position;
|
||||
|
||||
Reference in new issue
Block a user