diff --git a/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp index a526165aaa..7e6b649a65 100644 --- a/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp @@ -48,8 +48,8 @@ /** * Attempt to control the transparency based on the gray value of the color. - * This function applies a non-linear transformation that makes darker colors more opaque, - * preventing copper show-through on dark solder masks like black. + * This function applies a non-linear transformation that reduces transparency + * for darker colors while preserving copper visibility through the solder mask. * * @param aGrayColorValue - diffuse gray value (0.0 to 1.0) * @param aTransparency - base transparency value (0.0 opaque to 1.0 transparent) @@ -63,9 +63,7 @@ static float TransparencyControl( float aGrayColorValue, float aTransparency ) float ca = 1.0f - aTransparency; ca = 1.00f - 1.05f * ca * ca * ca; - // Squaring gray value makes darker colors more opaque, which improves appearance - // of dark solder masks like black where copper would otherwise show through - return glm::clamp( aGrayColorValue * aGrayColorValue * ca + aaa, 0.0f, 1.0f ); + return glm::clamp( aGrayColorValue * ca + aaa, 0.0f, 1.0f ); } /** diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index 1f3557f35e..6f1a751b62 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -64,9 +64,7 @@ static float TransparencyControl( float aGrayColorValue, float aTransparency ) float ca = 1.0f - aTransparency; ca = 1.00f - 1.05f * ca * ca * ca; - // Squaring gray value makes darker colors more opaque, which improves appearance - // of dark solder masks like black where copper would otherwise show through - return glm::max( glm::min( aGrayColorValue * aGrayColorValue * ca + aaa, 1.0f ), 0.0f ); + return glm::max( glm::min( aGrayColorValue * ca + aaa, 1.0f ), 0.0f ); } /**