![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GLSL
davidsu33
这个作者很懒,什么都没留下…
展开
-
GLSL的texture2D函数
最近在学习GLSL着色语言,对于texture2D这个函数始终有点搞不明白,今天终于搞清楚了texture2D的第一个参数是采样器(可以是sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow)由于OPenGL是支持多重纹理的,有如下可选值#define GL_TEXTURE0 0x84C0原创 2013-12-11 22:44:58 · 22126 阅读 · 5 评论 -
GLSL入门2 关于GLSL中的纹理贴图
我将注解以及源码直接放到这里了// GLSL01.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include using namespace std;static const int g_timer_id = 0;static const int g_tim原创 2013-12-15 20:05:00 · 2929 阅读 · 1 评论 -
GLSL 绘制入门
// GLSL01.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;static const int g_timer_id = 0;static const int g_time_per_frame = 16;//ms#def原创 2013-12-14 17:40:56 · 1554 阅读 · 0 评论 -
通过GLSL来实现绘制像素的裁剪
GLSL中含有内置的变量gl_FragCoord,其描述片段着色器的片段(对应像素)所在的坐标。基于上次的GLSL纹理贴图,我们可以增加像素的过滤,例如,我们要过滤掉片段坐标小于100的像素,则可以写如下代码void main(void){if(gl_FragCoord.x //TODO你的着色代码}下面请看看我的示例,基于上篇文件写的// GLSL01.cpp : 定原创 2013-12-16 16:31:52 · 2458 阅读 · 0 评论