glsl Dream

<-vertex->

  #version 120

  varying vec2 uv;

  void main(void)
  {

  uv = gl_MultiTexCoord0.st;
  gl_Position = ftransform();
  }

<-fragment->

uniform sampler2D sceneTex; // 0
varying vec2 uv;

void main ()
{

  vec4 c = texture2D(sceneTex, uv);

  c += texture2D(sceneTex, uv+0.001);
  c += texture2D(sceneTex, uv+0.003);
  c += texture2D(sceneTex, uv+0.005);
  c += texture2D(sceneTex, uv+0.007);
  c += texture2D(sceneTex, uv+0.009);
  c += texture2D(sceneTex, uv+0.011);

  c += texture2D(sceneTex, uv-0.001);
  c += texture2D(sceneTex, uv-0.003);
  c += texture2D(sceneTex, uv-0.005);
  c += texture2D(sceneTex, uv-0.007);
  c += texture2D(sceneTex, uv-0.009);
  c += texture2D(sceneTex, uv-0.011);

  c.rgb = vec3((c.r+c.g+c.b)/3.0);
  c = c / 9.5;
  gl_FragColor = c;
}            
时间: 2024-11-07 17:44:36

glsl Dream的相关文章

POJ2411(Mondriaan&#39;s Dream)

题目链接:传送门 题目大意:用1*2大小的砖块去铺满n*m大小的地面,有多少种方案 题目思路:因为1<=n,m<=11,并且砖块是1*2,故可以用二进制思想,也就是状态压缩DP,其中矩阵中为0的元素表示当前位置竖着放一块砖,而连着 两个1表示横着放一块砖(状态压缩真的很奇妙) #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <

第4章:缓冲区、着色器、GLSL

原文链接: http://www.rastertek.com/gl40tut04.html Tutorial 4: Buffers, Shaders, and GLSL This tutorial will be the introduction to writing vertex and pixel shaders in OpenGL 4.0. It will also be the introduction to using vertex and index buffers in OpenG

poj 2411 Mondriaan&#39;s Dream(状压DP)

Mondriaan's Dream Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 12232   Accepted: 7142 Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series

POJ 2411 Mondriaan&#39;s Dream

题目链接:http://poj.org/problem?id=2411 状态压缩Dynamic Programming. For each row, at ith position, 1 means that there is a block placed at this row and next row (vertically). otherwise, its 0. For the example in question, the state of For the example in que

【poj2411】 Mondriaan&#39;s Dream

http://poj.org/problem?id=2411 (题目链接) 题意 一个$n*m$的网格,用$1*2$的方块填满有多少种方案. Solution 轮廓线dp板子.按格dp,对上方和左方的格子的占用情况进行讨论转移.0表示已放置,1表示未放置. 细节 LL,滚动清空数组. 代码 // poj2411 #include<algorithm> #include<iostream> #include<cstdlib> #include<cstring>

Dream of boy, quadrotor helicopter

no.7 Hey,guys,how's everything going? This is Jack from Shanghai. Today's topic is about an significant project in my undergraduate period -- quadrotor helicopter. Quadcopter is a kind of helicopter with 4 propellers. Because of its simple structure,

poj 2411 Mondriaan&#39;s Dream(状态压缩+dp)

 题意:用1*2砖块铺满n*m的房间. 思路转自:http://www.cnblogs.com/scau20110726/archive/2013/03/14/2960448.html 因为这道题输入范围在11*11之间,所以可以先打表直接输出.......... 状态压缩DP 经典覆盖问题,输入n和m表示一个n*m的矩形,用1*2的方块进行覆盖,不能重叠,不能越出矩形边界,问完全覆盖完整个矩形有多少种不同的方案 其中n和m均为奇数的话,矩形面积就是奇数,可知是不可能完全覆盖的.接着我们来看

sdutoj Thrall’s Dream

http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2604 Thrall’s Dream Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 We never paid any heed to the ancient prophecies, like fools we clung to the old hatreds, and fought

ZOJ 3211 Dream City (J) DP

Dream City Time Limit: 1 Second      Memory Limit: 32768 KB JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n. At the first day, each tree i has ai coins