Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_icon_frag.glsl
| Show All 12 Lines | void main() | ||||
| const float circle_radius_inner = 0.075; | const float circle_radius_inner = 0.075; | ||||
| /** | /** | ||||
| * Add a bit transparency to see a bit of the icon, without | * Add a bit transparency to see a bit of the icon, without | ||||
| * getting on the way of readability. */ | * getting on the way of readability. */ | ||||
| const float mask_transparency = 0.25; | const float mask_transparency = 0.25; | ||||
| vec2 circle_center = vec2(circle_radius_outer - text_width, 0.5); | vec2 circle_center = vec2(circle_radius_outer - text_width, 0.5); | ||||
| fragColor = texture(image, texCoord_interp) * color; | fragColor = texture(image, texCoord_interp, -0.5) * color; | ||||
| /* radius in icon space (1 is the icon width). */ | /* radius in icon space (1 is the icon width). */ | ||||
| float radius = length(mask_coord_interp - circle_center); | float radius = length(mask_coord_interp - circle_center); | ||||
| float mask = smoothstep(circle_radius_inner, circle_radius_outer, radius); | float mask = smoothstep(circle_radius_inner, circle_radius_outer, radius); | ||||
| bool lower_half = mask_coord_interp.y < circle_center.y; | bool lower_half = mask_coord_interp.y < circle_center.y; | ||||
| bool right_half = mask_coord_interp.x > circle_center.x; | bool right_half = mask_coord_interp.x > circle_center.x; | ||||
| Show All 13 Lines | |||||