博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
primitive assembly
阅读量:5361 次
发布时间:2019-06-15

本文共 3552 字,大约阅读时间需要 11 分钟。

https://stackoverflow.com/questions/49860946/does-clipping-in-opengl-pipeline-happen-before-or-after-primitive-assembly

 

Firstly, I'm not entirely sure how the clipping works, but I suppose it "cuts" off the fragments that are not seen by the viewer, although I don't know how this works in practice. However, does it happen before or after the primitive assembly?

The  says this:

The purpose of the primitive assembly step is to convert a vertex stream into a sequence of base primitives. For example, a primitive which is a line list of 12 vertices needs to generate 11 line base primitives.

The full primitive assembly step (including the processing below) will always happen after Vertex Post-Processing. However, some Vertex Processing steps require that a primitive be decomposed into a sequence of base primitives. For example, a Geometry Shader operates on each input base primitive in the primitive sequence. Therefore, a form of primitive assembly must happen before the GS can execute.

This early primitive assembly only performs the conversion to base primitives. It does not perform any of the below processing steps.

Such early processing must happen if a Geometry Shader or Tessellation is active. The early assembly step for Tessellation is simplified, since Patch Primitives are always sequences of patches.

It seems that there are two forms of primitive assembly, which I'm confused about.

First, we see that when the vertex data is first fed into the vertex shader for rendering, it has to interepret the stream of vertices as some triangle or line etc. This is called "rendering" I suppose.

But on the other hand, the primitive assembly as quoted above also does something so similar. What is the difference between the two processes?

The article on  says this:

The term Primitive in OpenGL is used to refer to two similar but separate concepts. The first is the interpretive scheme used by OpenGL to determine what a stream of vertices represents when being rendered. Such sequences of vertices can be arbitrarily long.

The other meaning of "Primitive" is as the result of the interpretation of a vertex stream, as part of Primitive Assembly. Therefore, processing a vertex stream by one of these primitive interpretations results in an ordered sequence of primitives. The individual primitives are sometimes called "base primitives".

If we follow the quote above, it seems that there is no difference between the two apparently separate concepts. The "interpretation step" can view, say, a sequence of 10 vertices as 8 dependent triangles. But so can the primitive assembly steps, which views the "dependent triangles" as base primitives. What is concretely different between the two?

 

 

Basically, there are a lot of things called "primitive assembly". They all do the same thing (turn a sequence of vertices into individual primitives), but several of them happen at different times.

There is a specific chapter of the specification titled "Fixed-Function Primitive Assembly and Rasterization." One could argue that this is where "the" Primitive Assembly stage happens. But the standard also says that it happens after the VS, after the TES, and after the GS (where applicable).

The standard still talks about "the primitive assembly stage" as if there were only one, despite the fact that it clearly calls for multiple of them.

What's clear is that the process of clipping knows about the individual primitives, so some primitive assembly has happened prior to reaching that stage.

转载于:https://www.cnblogs.com/Searchor/p/9359569.html

你可能感兴趣的文章
Codeforces Gym 100203I I - I WIN 网络流最大流
查看>>
Codeforces Beta Round #97 (Div. 1) B. Rectangle and Square 暴力
查看>>
cs331n 线性分类器损失函数与最优化
查看>>
UVA10106
查看>>
图形学杂记
查看>>
解决a标签IE下点击后出现轮廓框
查看>>
supervisor //todo
查看>>
Laravel Homestead: 403 forbidden on nginx, http://homestead.app访问不了
查看>>
SQLServer 的case when语句使用实现统计
查看>>
如何得到GridView中某行某列的值?
查看>>
Java 代码性能优化
查看>>
【一维RMQ】HDU-3183
查看>>
ConcurrentHashMap原理分析
查看>>
CountDownLatch、信号量
查看>>
在IE8及以下的浏览器中,不支持placeholder属性的解决办法
查看>>
C++内存管理的缩影
查看>>
OAuth 及 移动端鉴权调研
查看>>
C# 虹软SDK视频人脸识别和注册
查看>>
ajax传递数组到后台,js传递数组到后台
查看>>
[数据结构]之顺序表
查看>>