direct3d

Frequency of shader invocations in rendering commands

时光总嘲笑我的痴心妄想 提交于 2019-11-26 16:56:28
问题 Shaders have invocations, which each are (usually) given a unique set of input data, and each (usually) write to their own separate output data. When you issue a rendering command, how many times does each shader get invoked? 回答1: Each shader stage has its own frequency of invocations. I will use the OpenGL terminology, but D3D works the same way (since they're both modelling the same hardware relationships). Vertex Shaders These are the second most complicated. They execute once for every

【D3D12学习手记】4.1.6 Resources and Descriptors

做~自己de王妃 提交于 2019-11-26 15:12:28
在渲染过程中,GPU将写资源(resources)(例如,后缓冲区,深度/模板缓冲区),读资源(例如,描述表面外观的纹理,存储场景中几何体3D位置的缓冲区)。在我们发出绘图命令之前,我们需要将资源绑定(或链接)(bind (or link))到将在该绘制调用中引用的渲染管道。有些资源可能每次绘制被调用时都会变化,因此我们需要在必要时更新每个绘制调用(draw call)的绑定。但是,GPU资源不是直接被绑定的。相反,资源是通过描述符对象(descriptor object)引用的,可以将其视为描述GPU资源的轻量级结构。从本质上讲,它是间接的一层(a level of indirection);给定资源描述符,GPU可以获得实际的资源数据并知道有关它的必要信息。我们通过指定将在draw call中引用的描述符将资源绑定到呈现管道。 为什么要使用描述符这种额外的间接层次?原因是GPU资源本质上是通用的内存块。资源保持通用,因此可以在渲染管道的不同阶段使用它们;一个常见的例子是使用纹理作为渲染目标(即,Direct3D绘制到纹理中),然后又被用作着色器(shader)资源(即,纹理将被采样并用作着色器的输入数据)。资源本身并不表示它是否被用作渲染目标,深度/模板缓冲区或着色器资源。另外,也许我们只想将资源数据的子区域绑定到渲染管道 - 我们如何在给定整个资源的情况下做到这一点?此外

Polygon Triangulation with Holes

北城以北 提交于 2019-11-26 12:52:04
问题 I am looking for an algorithm or library (better) to break down a polygon into triangles. I will be using these triangles in a Direct3D application. What are the best available options? Here is what I have found so far: Ben Discoe\'s notes FIST: Fast Industrial-Strength Triangulation of Polygons I know that CGAL provides triangulation but am not sure if it supports holes. I would really appreciate some opinions from people with prior experience in this area. Edit: This is a 2D polygon. 回答1:

Rendering meshes with multiple indices

≡放荡痞女 提交于 2019-11-25 22:30:25
问题 I have some vertex data. Positions, normals, texture coordinates. I probably loaded it from a .obj file or some other format. Maybe I\'m drawing a cube. But each piece of vertex data has its own index. Can I render this mesh data using OpenGL/Direct3D? 回答1: In the most general sense, no. OpenGL and Direct3D only allow one index per vertex; the index fetches from each stream of vertex data. Therefore, every unique combination of components must have its own separate index. So if you have a