Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | vec2 do_widget(void) | ||||
| lineWidth = abs(rect.x - recti.x); | lineWidth = abs(rect.x - recti.x); | ||||
| vec2 emboss_ofs = vec2(0.0, -lineWidth); | vec2 emboss_ofs = vec2(0.0, -lineWidth); | ||||
| vec2 v_pos[4] = vec2[4](rect.xz + emboss_ofs + ofs.yy, | vec2 v_pos[4] = vec2[4](rect.xz + emboss_ofs + ofs.yy, | ||||
| rect.xw + ofs.yx, | rect.xw + ofs.yx, | ||||
| rect.yz + emboss_ofs + ofs.xy, | rect.yz + emboss_ofs + ofs.xy, | ||||
| rect.yw + ofs.xx); | rect.yw + ofs.xx); | ||||
| vec2 pos = v_pos[gl_VertexID]; | vec2 pos = v_pos[gl_VertexID]; | ||||
| /* Workaround for the R600g driver when the SB back-end optimizer is enabled. */ | |||||
| #if defined(GPU_ATI) && defined(OS_UNIX) | |||||
| if (gl_VertexID == 3) { | |||||
| pos = rect.yw + ofs.xx; | |||||
| } | |||||
| #endif | |||||
| uvInterp = pos - rect.xz; | uvInterp = pos - rect.xz; | ||||
| outRectSize = rect.yw - rect.xz; | outRectSize = rect.yw - rect.xz; | ||||
| outRoundCorners = rads * roundCorners; | outRoundCorners = rads * roundCorners; | ||||
| vec2 uv = uvInterp / outRectSize; | vec2 uv = uvInterp / outRectSize; | ||||
| float fac = clamp((shadeDir > 0.0) ? uv.y : uv.x, 0.0, 1.0); | float fac = clamp((shadeDir > 0.0) ? uv.y : uv.x, 0.0, 1.0); | ||||
| /* Note innerColor is premultiplied inside the fragment shader. */ | /* Note innerColor is premultiplied inside the fragment shader. */ | ||||
| if (doAlphaCheck) { | if (doAlphaCheck) { | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||