mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 20:02:17 +00:00
Merge upstream/main into belt/rebase/may-18
Reconciles the belt-printer branch with upstream PRs through #13723. Six files had conflicts; three additional files needed manual follow-up fixes where the auto-merge produced code that referenced upstream-renamed fields or changed function signatures. Notable reconciliations: - TreeSupport.cpp: kept belt-floor early-exit branches around HEAD's drop-down logic, folded upstream's `(distance_to_top > 0 ? 1 : 0)` formula into the non-belt-floor path (upstream PR #11812). Dropped dead `roof_enabled`/`force_tip_to_roof` locals. - TreeSupport3D.cpp: combined upstream's safety-offset + remove_small changes with HEAD's belt-floor clip in the per-slice trim loop. Dropped HEAD's `else` block (superseded by upstream's rewritten bottom-contact propagation) and re-added the belt-floor clip into the new propagation loop. Gated the propagation on belt printers to prevent OOM when belt-floor clipping produces empty initial slices. - TriangleSelector.{cpp,hpp}: merged both new `select_patch` parameters (HEAD's `up_direction` and upstream's `select_partially`); body uses `dot(up_direction)` for the overhang angle check and forwards `select_partially` to `select_triangle`. - SupportMaterial.cpp: `slicing_params.soluble_interface` → `zero_gap_interface_bottom` in HEAD's `detect_belt_floor_bottom_contacts`, matching upstream's same-purpose rename at line 2495. - Custom.json, GCodeWriter.cpp: simple additive merges (kept entries / includes from both sides). Verified by building OrcaSlicer (RelWithDebInfo) after a full deps rebuild (Eigen v5.0.1, libigl v2.6.0 are now managed deps) and slicing a scaled Benchy on the NORMALIZER belt-printer profile without OOM. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
50
resources/shaders/110/fxaa.fs
Normal file
50
resources/shaders/110/fxaa.fs
Normal file
@@ -0,0 +1,50 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D uniform_texture;
|
||||
uniform vec2 inv_tex_size;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 rgbNW = texture2D(uniform_texture, tex_coord + vec2(-1.0, -1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbNE = texture2D(uniform_texture, tex_coord + vec2(1.0, -1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbSW = texture2D(uniform_texture, tex_coord + vec2(-1.0, 1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbSE = texture2D(uniform_texture, tex_coord + vec2(1.0, 1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbM = texture2D(uniform_texture, tex_coord).rgb;
|
||||
|
||||
vec3 luma_coeff = vec3(0.299, 0.587, 0.114);
|
||||
float lumaNW = dot(rgbNW, luma_coeff);
|
||||
float lumaNE = dot(rgbNE, luma_coeff);
|
||||
float lumaSW = dot(rgbSW, luma_coeff);
|
||||
float lumaSE = dot(rgbSE, luma_coeff);
|
||||
float lumaM = dot(rgbM, luma_coeff);
|
||||
|
||||
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||||
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||||
|
||||
vec2 dir;
|
||||
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
const float FXAA_REDUCE_MIN = 1.0 / 128.0;
|
||||
const float FXAA_REDUCE_MUL = 1.0 / 8.0;
|
||||
const float FXAA_SPAN_MAX = 8.0;
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX), dir * rcpDirMin)) * inv_tex_size;
|
||||
|
||||
vec3 rgbA = 0.5 * (
|
||||
texture2D(uniform_texture, tex_coord + dir * (1.0 / 3.0 - 0.5)).rgb +
|
||||
texture2D(uniform_texture, tex_coord + dir * (2.0 / 3.0 - 0.5)).rgb
|
||||
);
|
||||
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (
|
||||
texture2D(uniform_texture, tex_coord + dir * -0.5).rgb +
|
||||
texture2D(uniform_texture, tex_coord + dir * 0.5).rgb
|
||||
);
|
||||
|
||||
float lumaB = dot(rgbB, luma_coeff);
|
||||
gl_FragColor = (lumaB < lumaMin || lumaB > lumaMax) ? vec4(rgbA, 1.0) : vec4(rgbB, 1.0);
|
||||
}
|
||||
15
resources/shaders/110/fxaa.vs
Normal file
15
resources/shaders/110/fxaa.vs
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
||||
52
resources/shaders/140/fxaa.fs
Normal file
52
resources/shaders/140/fxaa.fs
Normal file
@@ -0,0 +1,52 @@
|
||||
#version 140
|
||||
|
||||
uniform sampler2D uniform_texture;
|
||||
uniform vec2 inv_tex_size;
|
||||
|
||||
in vec2 tex_coord;
|
||||
|
||||
out vec4 out_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 rgbNW = texture(uniform_texture, tex_coord + vec2(-1.0, -1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbNE = texture(uniform_texture, tex_coord + vec2(1.0, -1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbSW = texture(uniform_texture, tex_coord + vec2(-1.0, 1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbSE = texture(uniform_texture, tex_coord + vec2(1.0, 1.0) * inv_tex_size).rgb;
|
||||
vec3 rgbM = texture(uniform_texture, tex_coord).rgb;
|
||||
|
||||
vec3 luma_coeff = vec3(0.299, 0.587, 0.114);
|
||||
float lumaNW = dot(rgbNW, luma_coeff);
|
||||
float lumaNE = dot(rgbNE, luma_coeff);
|
||||
float lumaSW = dot(rgbSW, luma_coeff);
|
||||
float lumaSE = dot(rgbSE, luma_coeff);
|
||||
float lumaM = dot(rgbM, luma_coeff);
|
||||
|
||||
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||||
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||||
|
||||
vec2 dir;
|
||||
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
const float FXAA_REDUCE_MIN = 1.0 / 128.0;
|
||||
const float FXAA_REDUCE_MUL = 1.0 / 8.0;
|
||||
const float FXAA_SPAN_MAX = 8.0;
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX), dir * rcpDirMin)) * inv_tex_size;
|
||||
|
||||
vec3 rgbA = 0.5 * (
|
||||
texture(uniform_texture, tex_coord + dir * (1.0 / 3.0 - 0.5)).rgb +
|
||||
texture(uniform_texture, tex_coord + dir * (2.0 / 3.0 - 0.5)).rgb
|
||||
);
|
||||
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (
|
||||
texture(uniform_texture, tex_coord + dir * -0.5).rgb +
|
||||
texture(uniform_texture, tex_coord + dir * 0.5).rgb
|
||||
);
|
||||
|
||||
float lumaB = dot(rgbB, luma_coeff);
|
||||
out_color = (lumaB < lumaMin || lumaB > lumaMax) ? vec4(rgbA, 1.0) : vec4(rgbB, 1.0);
|
||||
}
|
||||
15
resources/shaders/140/fxaa.vs
Normal file
15
resources/shaders/140/fxaa.vs
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec2 v_tex_coord;
|
||||
|
||||
out vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user