mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Fix shaders for Chrome 113 (#270)
This commit is contained in:
parent
04eca4b196
commit
28573ce470
@ -35,9 +35,9 @@ fn main(
|
||||
// return VertexOutput(color, vec4<f32>(0.0, 0.0, 0.0, 1.0));
|
||||
//}
|
||||
|
||||
var position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>(position + normal * width, z, 1.0);
|
||||
var final_position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>(position + normal * width, z, 1.0);
|
||||
// FIXME: how to fix z-fighting?
|
||||
position.z = z_index;
|
||||
final_position.z = z_index;
|
||||
|
||||
return VertexOutput(color, position);
|
||||
return VertexOutput(color, final_position);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ fn main(
|
||||
vec3<f32>(0.0, 0.0, 1.0)
|
||||
);
|
||||
|
||||
var position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>((scaling * vertex), 1.0);
|
||||
position.z = 1.0;
|
||||
return VertexOutput(DEBUG_COLOR, position);
|
||||
var final_position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>((scaling * vertex), 1.0);
|
||||
final_position.z = 1.0;
|
||||
return VertexOutput(DEBUG_COLOR, final_position);
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@ fn main(
|
||||
vec3<f32>(0.0, 0.0, 1.0)
|
||||
);
|
||||
|
||||
var position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>((scaling * vertex), 1.0);
|
||||
var final_position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>((scaling * vertex), 1.0);
|
||||
// FIXME: how to fix z-fighting?
|
||||
position.z = 1.0;
|
||||
final_position.z = 1.0;
|
||||
|
||||
return VertexOutput(DEBUG_COLOR, position);
|
||||
return VertexOutput(DEBUG_COLOR, final_position);
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ fn main(
|
||||
);
|
||||
let tex_coords = TEX_COORDS[vertex_idx];
|
||||
|
||||
var position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>(vertex, 1.0);
|
||||
position.z = z_index;
|
||||
var final_position = mat4x4<f32>(translate1, translate2, translate3, translate4) * vec4<f32>(vertex, 1.0);
|
||||
final_position.z = z_index;
|
||||
|
||||
return VertexOutput(tex_coords, position);
|
||||
return VertexOutput(tex_coords, final_position);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user