mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 06:29:00 +08:00
Techs ENABLE_SEAMS_USING_MODELS and ENABLE_SEAMS_USING_BATCHED_MODELS - Fixed seams (and other options) zs to match toolpaths zs in preview
This commit is contained in:
parent
c12e5bb4ed
commit
9abebe5fbe
@ -34,7 +34,9 @@ void main()
|
|||||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||||
|
|
||||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||||
vec4 world_position = vec4(v_position * vec3(vec2(i_scales.x), i_scales.y) + i_offset, 1.0);
|
float width = 1.5 * i_scales.x;
|
||||||
|
float height = 1.5 * i_scales.y;
|
||||||
|
vec4 world_position = vec4(v_position * vec3(vec2(width), height) + i_offset - vec3(0.0, 0.0, 0.5 * i_scales.y), 1.0);
|
||||||
vec3 eye_position = (gl_ModelViewMatrix * world_position).xyz;
|
vec3 eye_position = (gl_ModelViewMatrix * world_position).xyz;
|
||||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(eye_position), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(eye_position), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||||
|
|
||||||
|
@ -1414,9 +1414,9 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
|||||||
instances.push_back(curr.position.y());
|
instances.push_back(curr.position.y());
|
||||||
instances.push_back(curr.position.z());
|
instances.push_back(curr.position.z());
|
||||||
// append width
|
// append width
|
||||||
instances.push_back(1.5f * curr.width);
|
instances.push_back(curr.width);
|
||||||
// append height
|
// append height
|
||||||
instances.push_back(1.5f * curr.height);
|
instances.push_back(curr.height);
|
||||||
|
|
||||||
// append id
|
// append id
|
||||||
instances_ids.push_back(move_id);
|
instances_ids.push_back(move_id);
|
||||||
@ -1428,7 +1428,7 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
|||||||
const double width = static_cast<double>(1.5f * curr.width);
|
const double width = static_cast<double>(1.5f * curr.width);
|
||||||
const double height = static_cast<double>(1.5f * curr.height);
|
const double height = static_cast<double>(1.5f * curr.height);
|
||||||
|
|
||||||
const Transform3d trafo = Geometry::assemble_transform(curr.position.cast<double>(), Vec3d::Zero(), { width, width, height });
|
const Transform3d trafo = Geometry::assemble_transform((curr.position - 0.5f * curr.height * Vec3f::UnitZ()).cast<double>(), Vec3d::Zero(), { width, width, height });
|
||||||
const Eigen::Matrix<double, 3, 3, Eigen::DontAlign> normal_matrix = trafo.matrix().template block<3, 3>(0, 0).inverse().transpose();
|
const Eigen::Matrix<double, 3, 3, Eigen::DontAlign> normal_matrix = trafo.matrix().template block<3, 3>(0, 0).inverse().transpose();
|
||||||
|
|
||||||
for (const auto& entity : data.entities) {
|
for (const auto& entity : data.entities) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user