Fixed typo

This commit is contained in:
enricoturri1966 2022-03-22 15:35:02 +01:00
parent a0630420d9
commit 86641a481e
2 changed files with 6 additions and 5 deletions

View File

@ -3,16 +3,17 @@
const vec3 back_color_dark = vec3(0.235, 0.235, 0.235); const vec3 back_color_dark = vec3(0.235, 0.235, 0.235);
const vec3 back_color_light = vec3(0.365, 0.365, 0.365); const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
uniform sampler2D texture; uniform sampler2D in_texture;
uniform bool transparent_background; uniform bool transparent_background;
uniform bool svg_source; uniform bool svg_source;
in vec2 tex_coord; in vec2 tex_coord;
out vec4 frag_color;
vec4 svg_color() vec4 svg_color()
{ {
// takes foreground from texture // takes foreground from texture
vec4 fore_color = texture(texture, tex_coord); vec4 fore_color = texture(in_texture, tex_coord);
// calculates radial gradient // calculates radial gradient
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5))))); vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
@ -24,11 +25,11 @@ vec4 svg_color()
vec4 non_svg_color() vec4 non_svg_color()
{ {
// takes foreground from texture // takes foreground from texture
vec4 color = texture(texture, tex_coord); vec4 color = texture(in_texture, tex_coord);
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a); return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
} }
void main() void main()
{ {
gl_FragColor = svg_source ? svg_color() : non_svg_color(); frag_color = svg_source ? svg_color() : non_svg_color();
} }

View File

@ -35,7 +35,7 @@ std::pair<bool, std::string> GLShadersManager::init()
#if ENABLE_LEGACY_OPENGL_REMOVAL #if ENABLE_LEGACY_OPENGL_REMOVAL
#if ENABLE_GL_SHADERS_ATTRIBUTES #if ENABLE_GL_SHADERS_ATTRIBUTES
const std::string prefix = !GUI::wxGetApp().is_gl_version_greater_or_equal_to(3, 1) ? "140/" : "110/"; const std::string prefix = GUI::wxGetApp().is_gl_version_greater_or_equal_to(3, 1) ? "140/" : "110/";
// imgui shader // imgui shader
valid &= append_shader("imgui", { prefix + "imgui.vs", prefix + "imgui.fs" }); valid &= append_shader("imgui", { prefix + "imgui.vs", prefix + "imgui.fs" });
// basic shader, used to render all what was previously rendered using the immediate mode // basic shader, used to render all what was previously rendered using the immediate mode