Efficient Triangle and Quadrilateral Clipping Within Shaders

M. McGuire
{"title":"Efficient Triangle and Quadrilateral Clipping Within Shaders","authors":"M. McGuire","doi":"10.1080/2151237X.2011.619891","DOIUrl":null,"url":null,"abstract":"Abstract Clipping a triangle or a convex quadrilateral to a plane is a common operation in computer graphics. This clipping is implemented by fixed function units within the graphics pipeline under most rasterization application programming interfaces (APIs). It is increasingly interesting to perform clipping in programmable stages as well. For example, to clip bounding volumes generated in the geometry unit to the near plane or to clip an area light source to the tangent plane of a surface in a pixel unit. Although clipping a convex polygon is algorithmically trivial, doing so efficiently on vector architectures such as GPUs can be tricky. This article presents an implementation of Sutherland-Hodgman clipping, designed for vector processors. It has high branch coherence, uses only register storage (i.e., it does not require a move-relative memory operation), leverages both data and instruction parallelism, and has a peak register count of only two 4-vectors (7 scalars). I found it to be approximately five times faster than direct Sutherland-Hodgman and to yield a 45% increase in net throughput when applied to the algorithm from a previous publication on two GPU architectures. The principles of optimization presented for this class of parallel algorithm extend to other algorithms and architectures.","PeriodicalId":354935,"journal":{"name":"Journal of Graphics, GPU, and Game Tools","volume":"174 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-11-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Graphics, GPU, and Game Tools","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1080/2151237X.2011.619891","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

Abstract

Abstract Clipping a triangle or a convex quadrilateral to a plane is a common operation in computer graphics. This clipping is implemented by fixed function units within the graphics pipeline under most rasterization application programming interfaces (APIs). It is increasingly interesting to perform clipping in programmable stages as well. For example, to clip bounding volumes generated in the geometry unit to the near plane or to clip an area light source to the tangent plane of a surface in a pixel unit. Although clipping a convex polygon is algorithmically trivial, doing so efficiently on vector architectures such as GPUs can be tricky. This article presents an implementation of Sutherland-Hodgman clipping, designed for vector processors. It has high branch coherence, uses only register storage (i.e., it does not require a move-relative memory operation), leverages both data and instruction parallelism, and has a peak register count of only two 4-vectors (7 scalars). I found it to be approximately five times faster than direct Sutherland-Hodgman and to yield a 45% increase in net throughput when applied to the algorithm from a previous publication on two GPU architectures. The principles of optimization presented for this class of parallel algorithm extend to other algorithms and architectures.
在着色器内有效的三角形和四边形裁剪
将三角形或凸四边形裁剪到平面上是计算机图形学中常见的操作。在大多数光栅化应用程序编程接口(api)下,这种裁剪是由图形管道中的固定功能单元实现的。在可编程阶段执行剪辑也越来越有趣。例如,将几何单元中生成的边界体剪辑到近平面,或将区域光源剪辑到像素单元中表面的切平面。尽管裁剪凸多边形在算法上是微不足道的,但在gpu等矢量架构上有效地做到这一点可能会很棘手。本文介绍了为矢量处理器设计的Sutherland-Hodgman裁剪的实现。它具有高分支一致性,仅使用寄存器存储(即,它不需要移动相对内存操作),利用数据和指令并行性,并且峰值寄存器计数仅为两个4向量(7个标量)。我发现它比直接的Sutherland-Hodgman快大约5倍,并且当应用于之前发表的关于两种GPU架构的算法时,净吞吐量增加了45%。针对这类并行算法提出的优化原则也适用于其他算法和体系结构。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信