Shader-模板测试

博客介绍了模板测试,它在透明度测试之后、深度测试之前进行。使用模板缓冲区涉及当前模板缓冲值和模板参考值,通过特定比较操作进行测试,测试后对模板缓冲区值进行更新,还可根据测试结果做不同更新操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

模板测试

模板测试在透明度测试之后,在深度测试之前

使用模板缓冲区最重要的两个值:当前模板缓冲值(stencilBufferValue)和模板参考值(referenceValue)
模板测试主要就是对这个两个值使用特定的比较操作:Never,Always,Less ,LEqual,Greater,Equal等等。
模板测试之后要对模板缓冲区的值(stencilBufferValue)进行更新操作,更新操作包括:Keep,Zero,Replace,IncrSat,DecrSat,Invert等等。
模板测试之后可以根据结果对模板缓冲区做不同的更新操作,比如模板测试成功操作Pass,模板测试失败操作Fail,深度测试失败操作ZFail,还有正对正面和背面精确更新操作PassBack,PassFront,FailBack等等。

stencil{
    Ref referenceValue
    ReadMask  readMask
    WriteMask writeMask
    Comp comparisonFunction
    Pass stencilOperation
    Fail stencilOperation
    ZFail stencilOperation
}
The Advanced Volume Sensor Project is one element of the ONR Advanced Damage Countermeasures FNC program. The Volume Sensor Project is developing new methods for remote situational awareness and damage control event detection using conventional video cameras and other techniques. The Spectral-Based Volume Sensor (SBVS) Testbed uses a suite of single-element optical detectors operating outside the visible region. Event detection algorithms were developed to make use of the data generated by the SBVS Testbed. These algorithms detect flaming and smoldering sources both within and outside the SBVS Testbed’s field of view (FOV). A positive nuisance classification algorithm was also developed for arc welding and similar nuisance events, which detected all welding events with extremely few false alarms. The developed algorithms were tested against data collected during the Volume Sensor Test Series 2, July to November 2003. Comparable performance to COTS OFDs was achieved for FOV flaming sources, and superior performance was demonstrated for partially or completely obscured flaming sources. Unclassified Unclassified Unclassified UL 83 Jeffrey C. Owrutsky (202) 404-6352 Fire detection; Optical flame detection; Volume sensor; Remote sensing; Smoke detection; Arc welding detection; Damage control; Damage countermeasures Memorandum NRL/MR/6110--05-8856 Approved for public release; distribution is unlimited. *Nova Research, Inc., Alexandria, VA 22308 †Hughes Associates, Inc., Baltimore, MD 21227 ‡NRL Code 6180 Accompanying CD (on the inside back cover) contains this Memorandum Report and the supporting material referenced in the text.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值