Fix external outline Thickness (#14741)

* Fix external outline

* Format and values

* frag_color -> gl_FragColor

* Remove Transform3d& view_matrix

* Clarify rendering comments in 3DScene.cpp

Updated comments to clarify rendering process using stencil buffer.

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
Rodrigo Faselli
2026-07-17 09:04:36 +08:00
committed by GitHub
co-authored by Ian Bassi Noisyfox
parent 979e56f1d0
commit 33909a51cd
11 changed files with 85 additions and 1 deletions
+5
View File
@@ -11,6 +11,7 @@ uniform sampler2D normal_texture;
uniform vec2 inv_tex_size;
uniform float z_near;
uniform float z_far;
uniform bool is_outline;
varying vec2 tex_coord;
@@ -22,6 +23,10 @@ float linearize_depth(float depth)
void main()
{
if (is_outline) {
gl_FragColor = vec4(texture2D(color_texture, tex_coord).rgb, 1.0);
return;
}
vec3 base = texture2D(color_texture, tex_coord).rgb;
float depth_center = linearize_depth(texture2D(depth_texture, tex_coord).r);