
CG
馒头华
读书笔记
展开
-
OF+SHADER的第一个程序
想入shader的坑已经很久了,可是用directX框架太麻烦,unity的cg语言资源又不够多,偶尔接触到了openframework中的ofShader类,发现of能够用原生的GLSL写shader!!(废话。。。of就是基于opengl的)。我认为of框架还是比较好上手的,下面就来学习下第一个shader。下面的代码是如何在of中使用shader,略去了setup等基础内容,有需要的可以看看o原创 2016-04-22 16:11:46 · 687 阅读 · 0 评论 -
VS2012+NShader1.3
使用NShader插件可以在VS中进行shader的关键字高亮,但还是没有办法实现智能提示。 1.关闭VS 2.在VS安装目录搜索NShader.pkgdef文件 3.将放在配置文件中。 4.删除注册表下的 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\ 11.0\FontAndColors\Cache HKEY_CURRENT_US原创 2016-04-22 08:37:43 · 428 阅读 · 0 评论 -
编写shader模拟水波扩散效果
这次分析了shadertoy上的一个例子 先上效果图。 中心是一个大的波纹,我们可以用鼠标控制小的波纹,产生干涉。用opengl模拟水纹是一个复杂的过程,这里我们采用的方法是。。。欺骗法。将水纹看成黑白相间的圆环,因为只有黑白两色,水纹上的圆环移动时会产生干涉的假象。我们还是直接来一步一步的看代码,先在屏幕上画一个圆环。#define PI 3.1415float ripple(flo原创 2016-05-01 21:46:17 · 6763 阅读 · 0 评论 -
Something about math
cross product we know that two vectors can define a plane, the cross plane is to find a vector that perpendicular to this plane which has its own length and direction. And that’s also the difference t原创 2016-09-24 11:06:07 · 296 阅读 · 0 评论