Fix/blackcolor gcode preview (#11912)

* Fix dark color rendering in G-code preview by using additive specular lighting

* Revert "Fix dark color rendering in G-code preview by using additive specular lighting"

This reverts commit 2a65bc9060.

* Fix dark color rendering in G-code preview (Standard & ES shaders) by using additive specular lighting

* Fix dark color preview: Increase minimum brightness to 48/255 (~19%)

* Refactor: Revert to combined lighting calculation in shaders
This commit is contained in:
tome9111991
2026-01-16 20:05:48 +01:00
committed by GitHub
parent 95c6cd05fa
commit cf54ad58ed

View File

@@ -54,7 +54,11 @@ Slic3r::ColorRGBA convert(const Color& c)
Color convert(const Slic3r::ColorRGBA& c)
{
return { static_cast<uint8_t>(c.r() * 255.0f), static_cast<uint8_t>(c.g() * 255.0f), static_cast<uint8_t>(c.b() * 255.0f) };
// ORCA: Fix dark color rendering. Ensure minimal brightness.
auto safe_val = [](float v) -> uint8_t {
return std::max((uint8_t)(v * 255.0f), (uint8_t)48);
};
return { safe_val(c.r()), safe_val(c.g()), safe_val(c.b()) };
}
Color convert(const std::string& color_str)