gl ,shader笔记

 Stencil Buffer
One use for the stencil buffer is to restrict drawing to certain portions of the screen,
 
  就好象对纸喷漆的时候 先加上一个有格的挡版
这样的话, 喷上的漆在没有遮拦的地方就对纸上了色。有遮拦的地方就上到挡版上了
 

Scissor Test
You can define a rectangular portion of your window and restrict drawing to take place within it by using the glScissor() command. If a fragment lies inside the
rectangle
 
Alpha Test
In RGBA mode, the alpha test allows you to accept or reject a fragment based on its alpha value.
 
  Stencil Test
The stencil test takes place only if there is a stencil buffer. (If there is no stencil buffer, the stencil test always passes.) Stenciling applies a test that compares a
reference value with the value stored at a pixel in the stencil buffer. Depending on the result of the test, the value in the stencil buffer is modified. You can
choose the particular comparison function used, the reference value, and the modification performed with the glStencilFunc() and glStencilOp() commands.

Depth Test
For each pixel on the screen, the depth buffer keeps track of the distance between the viewpoint and the object occupying that pixel. Then if the specified depth
test passes, the incoming depth value replaces the one already in the depth buffer.
 
 
 景深模糊的功能可以通过
Depth of field 来实现
通过不断调整 细微投射坐标 然后设置glAccum (GL_ACCUM, 0.125); 来缓慢衰减颜色就可以。。更可以用来做细微的soft shadow

The OpenGL Shading Language and its supporting OpenGL API entry points allows application developers to define the processing that occurs at key points in the OpenGL processing pipeline by using a high-level programming language specifically designed for this purpose. These key points in the pipeline are defined to be programmable in order to give developers 

  vertex shader 构线,影射之前
fragment shader 光栅化,付上材质之后

  Applications can provide attribute values between calls to glBegin and glEnd or with vertex array calls, so they can change as often as every vertex.
 vertex shader 处理的是 begin .... end之间的
数据 换句话说 。。不是全部load到 内存中的点数据而是要执行的点的数据

UNIFORM VARIABLES pass data values from the application to either the vertex processor or the fragment processor.

其实就是诸如 view matrix  projection matrix 之类的算子 

Variables that define data that is passed from the vertex processor to the fragment processor are called VARYING VARIABLES. 
 

The fragment processor usually performs traditional graphics operations such as the following:

Operations on interpolated values

Texture access

Texture application

Fog

Color sum

 
已经在 光 点 算之后了  这里算材质 和插值

vertex shader 主要做光
fragment shader 主要做各种泛化的处理
  
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值