// A simple blur shader, weighted on alpha

uniform sampler2D texture;

void main()
{
    float radius = 0.01;
    vec4 accum = vec4(0.0);
    vec4 normal = vec4(0.0);
    
    normal = texture2D(texture, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t));
    
    accum += texture2D(texture, vec2(gl_TexCoord[0].s-radius, gl_TexCoord[0].t-radius));
    accum += texture2D(texture, vec2(gl_TexCoord[0].s+radius, gl_TexCoord[0].t-radius));
    accum += texture2D(texture, vec2(gl_TexCoord[0].s+radius, gl_TexCoord[0].t+radius));
    accum += texture2D(texture, vec2(gl_TexCoord[0].s-radius, gl_TexCoord[0].t+radius));
    
    accum *= 0.25;
    
    accum.r = 1.0;
    accum.g = 0.0;
    accum.b = 0.0;
    
    normal = (accum * (1.0 - normal.a)) + (normal * normal.a);
    
    gl_FragColor = normal;
}

http://www.cnblogs.com/cxiaojia/p/5203421.html  描边

Stroke的更多相关文章

  1. 背水一战 Windows 10 (13) - 绘图: Stroke, Brush

    [源码下载] 背水一战 Windows 10 (13) - 绘图: Stroke, Brush 作者:webabcd 介绍背水一战 Windows 10 之 绘图 Stroke - 笔划 Brush ...

  2. iOS 2D绘图 (Quartz2D)之路径(stroke,fill,clip,subpath,blend)

    像往常一样 这个系列的博客是跟着大神的脚步来的.按照往例 在此贴出原博客的出处: http://blog.csdn.net/hello_hwc?viewmode=list我对大神的崇拜之情 如滔滔江水 ...

  3. 学习SVG系列(3):SVG Stroke属性

    SVG stroke 属性 1.stroke 2.stroke-width 3.stroke-linecap 4.stroke-dasharray 5.stroke-opacity 6.stroke- ...

  4. [javascript svg fill stroke stroke-width points polygon属性讲解] svg fill stroke stroke-width points polygon绘制多边形属性并且演示polyline和polygon区别讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  5. [javascript svg fill stroke stroke-width points polyline 属性讲解] svg fill stroke stroke-width points polyline 绘制折线属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  6. [javascript svg fill stroke stroke-width x1 y1 x2 y2 line stroke-opacity fill-opacity 属性讲解] svg fill stroke stroke-width stroke-opacity fill-opacity line绘制线条属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  7. [javascript svg fill stroke stroke-width x y rect rx ry 属性讲解] svg fill stroke stroke-width rect 绘制具有圆角矩形属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  8. [javascript svg fill stroke stroke-width rx ry ellipse 属性讲解] svg fill stroke stroke-width ellipse 绘制椭圆属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  9. [javascript svg fill stroke stroke-width circle 属性讲解] svg fill stroke stroke-width circle 属性 绘制圆形及引入方式讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  10. 绘图: Stroke, Brush

    Stroke - 笔划 Brush - 画笔 示例1.演示“Stroke”相关知识点Drawing/Stroke.xaml <Page x:Class="Windows10.Drawi ...

随机推荐

  1. windows+goland+gometalinter进行本地代码检查(高圈复杂度、重复代码等)

    1.下载gometalinter release地址为:https://github.com/alecthomas/gometalinter/releases/tag/v3.0.0 下载windows ...

  2. selenium获取cookies并持久化登陆

    selenium获取cookies并持久化登陆 需求背景: ​ 这几天需要写一个接口,用来批量上传数据,最开始考虑的是 UI 自动化,然后选值的时候自动化难以判别,最终选择 接口 自动化. ​ 然后操 ...

  3. Qt之QColorDialog

    widget.h: #ifndef WIDGET_H #define WIDGET_H #include <QWidget> class Widget : public QWidget { ...

  4. Tomcat-如何在IDEA启动部署web模板

    IDEA部署工程到Tomcat上运行 1,建议修改web工程对应的Tomcat运行实例名称 2,将需要部署的web工程添加到Tomcat运行实例中,添加或删除 Application context: ...

  5. String类-intern方法

    1 package cn.itcast.p1.string.demo; 2 3 class StringObjectDemo { 4 public static void main(String[] ...

  6. MacBook USB 连 iPhone 响个不停,充电频繁的连上/断开

    电脑是 MacBook Pro (Retina, 15-inch, Mid 2015) 连 iPhone 响个不停,充电频繁的连上 /断开,数据线是原装的,想连接爱思助手连接不上. 网上方法 1 开启 ...

  7. 开源办公套件DzzOffice安装教程

    DzzOffice开源办公套件 DzzOffice是一套开源办公套件,适用于企业.团队搭建自己的 类似"Google企业应用套件"."微软Office365"的 ...

  8. 用shell脚本写出检测/tmp/size.log文件,如果存在显示它的内容,不存在则创建一个文件将创建时间写入

    1 #!/bin/bash 2 if [ -d "/tmp" ]; then 3 echo "/tmp is exists" 4 else 5 mkdir /t ...

  9. netstat in Linux

    # netstat -unlt Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address         ...

  10. 解决Vue3使用 Ant Design,出现多个Modal,全是黑屏,导致列表页看不见问题!

    尴尬问题 不报错,但是我看着就难受. 求知路上 请教了下强哥,强哥告诉我可能某个样式属性失效引起(无效),建议我F12看下样式. 接着,我F12狂看元素样式,查了一个小时未果,我真抓狂了. 都想明天问 ...