// 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. jmeter和JDK安装教程(Windows)

    1.JDK的安装及环境变量配置 1.JDK的下载安装 JDK官网下载地址:https://www.oracle.com/java/technologies/downloads 然后注册账号,开始下载, ...

  2. DEEP LEARNING WITH PYTORCH: A 60 MINUTE BLITZ | TORCH.AUTOGRAD

    torch.autograd 是PyTorch的自动微分引擎,用以推动神经网络训练.在本节,你将会对autograd如何帮助神经网络训练的概念有所理解. 背景 神经网络(NNs)是在输入数据上执行的嵌 ...

  3. vuecli学习01 - 环境搭建

    到这个链接下载nvm的安装包:https://github.com/coreybutler/nvm-windows/releases. 然后点击一顿下一步,安装即可! 安装完成后,还需要配置环境变量. ...

  4. 不难懂-----type=number 去掉加减按钮并禁止鼠标滚轮滚动

    <style> /* 去除webkit中input的type="number"时出现的上下图标 */ input::-webkit-outer-spin-button, ...

  5. NFS数据共享(全面讲解使用教程)

    目录 一:NFS数据共享 1.NFS简介: 2.什么是NFS? 3.NFS的应用 二:NFS数据共享实践 二:NFS配置详解 1.控制文件权限 三:配置文件分类 四:NFS统一用户 1.创建用户(客户 ...

  6. 学习JAVAWEB第十三天

    会话技术 1. 会话:一次会话中包含多次请求和响应. * 一次会话:浏览器第一次给服务器资源发送请求,会话建立,直到有一方断开为止 2. 功能:在一次会话的范围内的多次请求间,共享数据 3. 方式: ...

  7. vue组件中使用watch响应数据

    在vue中,使用watch来响应数据的变化.watch的用法大致有三种.下面代码是watch的一种简单的用法: 普通用法: <template> //视图 <input v-mode ...

  8. Spring中NESTED和REQUIRED_NEW传播行为的区别

    简介 PROPAGATION_REQUIRED_NEW: 表示当前方法必须运行在它自己的事务中.一个新的事务将被启动.如果存在当前事务,在该方法执行期间,当前事务会被挂起.如果使用JTATransac ...

  9. 解决No artifacts

    前言:maven管理项目时显示No artifacts 错误: 第一步:找到Artifacts 第二步:点击添加 第三步:点击exploded,然后点击应用即可 注意: 名字1和名字2一定要相同 最后 ...

  10. JS 高阶函数

    笔记整理自:廖雪峰老师的JS教程 目录 概述 Array中的高阶函数 map(返回新的Array) reduce(返回新的Array) filter(返回新的Array) sort(返回同一Array ...