Stencil

Stencil

  The stencil buffer can be used as a general purpose per pixel mask for saving or discarding pixels.

  The stencil buffer is usually an 8 bit integer per pixel. The value can be written to, increment or decremented. Subsequent draw calls can test against the value, to decide if a pixel should be discarded before running the pixel shader.

  Stencil测试在Fragment Shader之前进行。也即光栅化后进行的第一个Test,Stencil-Test过后是ZTest。

[Syntax] 

  Comp, Pass, Fail and ZFail will be applied to the front-facing geometry, unless Cull Front is specified, in which case it‘s back-facing geometry. You can also explicitly specify the two-sided stencil state by defining CompFront, PassFront, FailFront, ZFailFront (for front-facing geometry), and CompBack, PassBack, FailBack, ZFailBack (for back-facing geometry).

[Comparison Function]

  

[Stencil Operation]

  

[Deferred rendering path]

  to be continued...

参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/SL-Stencil.html

Stencil,布布扣,bubuko.com

时间: 2024-10-11 22:21:27

Stencil的相关文章

Stencil buffer

Stencil buffer 模版缓冲(stencil buffer)或印模缓冲,是在OpenGL三维绘图等计算机图像硬件中常见的除颜色缓冲.像素缓冲.深度缓冲之外另一种数据缓冲.词源模版(stencil)是指一种印刷技术,通常以蜡纸或者钢板印刷文字或图形:区别于模板(template),用木板为外形修剪的依据来复制形状:模版(stencil)是指印模,而模板(template)主要是指形模.模版缓冲是以像素为单位的,整数数值的缓冲,通常给每个像素分配一个字节长度的数值.深度缓冲与模版缓冲经常在

A trip through the Graphics Pipeline 2011_07_Z/Stencil processing, 3 different ways

In this installment, I’ll be talking about the (early) Z pipeline and how it interacts with rasterization. Like the last part, the text won’t proceed in actual pipeline order; again, I’ll describe the underlying algorithms first, and then fill in the

Download Manufacturers Visio Stencil

Manufacturers Visio Stencil download Links IBM:http://www.visiocafe.com/ Visiocafe Introduction VisioCafe is an independent non-profit web site for the gathering together of IT industry Visio collections. Each collection is copyrighted to its respect

OpenGl笔记 12.1 stencil 模版 缓冲区

在OpenGL中存在着多种缓冲区,这些缓冲区大致分为: 深度缓冲区:存储每个像素的深度值,当启动深度测试时,片段像素深度值和深度缓冲区深度值进行比较,决定片段哪些像素点数据可以替换到颜色缓冲区中. 模板缓冲区(Stencil Buffer):与颜色缓冲区和深度缓冲区类似,模板缓冲区可以为屏幕上的每个像素点保存一个无符号整数值.这个值的具体意义视程序的具体应用而定.在渲染的过程中,可以用这个值与一个预先设定的参考值相比较,根据比较的结果来决定是否更新相应的像素点的颜色值.这个比较的过程被称为模板测

ZBrush软件特性之Stencil模板调控板

在ZBrush中使用Stencil模板我们了解的所有绘图工具,通过它确定模板周围与涂画或模型的位置.本文将详解ZBrush?中如何使用"曲线板"自定义形状. 使用模版 ZBrush模版的作用象我们了解的所有绘制工具,通过它确定模版周围与涂画或模型的位置,下面是怎样使用默认的 "曲线板"模版或使用自定义形状: 1.打开Stencil(模版)调控版并激活模版,将出现默认的 "曲线板". 2.使用StencilCoinController(模版铸造控制

龙书9 chapter8 stencil的使用

笔记1:首先是mirror例子的体会. 大体流程是: 1.绘制普通物体:清空每个像素的stencil    2.设置镜面区域stencil值为参考值1   3.判断render后每个像素点的stencil值是否为1,满足条件则绘制出teapot的图元 需要注意的是: 1.绘制stencil区域为1时,我们的目的只是为了像素stencil的修改,其他值不变:所以:首先禁止zBuffer的写,其次把此次绘制设置不可见,也就是利用混合,设置 本次源头alpha为zero. 2.在绘制镜像teapot时

stencil in unity3d

Pass { Stencil { Ref 1 Comp Always Pass REPLACE } AlphaTest Greater 0 Blend SrcAlpha OneMinusSrcAlpha Color[_Color] SetTexture[_MainTex] { Combine texture } } // render outline Pass { Stencil { Ref 1 //Comp Always Comp NotEqual } Cull Off ZWrite Off

cocos3.2 cocos2dx Stencil buffer is not enabled

问题描述: 页面不显示,或者显示绿色,部分组件不显示,eclipse下面出现"cocos2dx Stencil buffer is not enabled"错误 解决方案: 在AppActivity.java加入如下代码: public Cocos2dxGLSurfaceView onCreateView() { Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); glSurfaceView.se

outdated: 27.Shadows

这次的代码没有按照辅导代码中的来. VK_LEFT/VK_RIGHT/VK_UP/VK_DOWN控制长方体旋转,W/S/A/D/Q/E控制球移动,小键盘的8/5/4/6/7/9控制长方体移动,I/K/J/L/U/O控制光源移动. 在InitGLObject()函数中使用到的readObject()函数.setConnectivity()函数和calculatePlane()函数在3object.h中所写. readObject()函数在.txt文件中读取物体顶点数.顶点坐标.平面数.vertex