CN114581596A - Geometric body fast rendering method based on graphic processing unit GPU drive - Google Patents
Geometric body fast rendering method based on graphic processing unit GPU drive Download PDFInfo
- Publication number
- CN114581596A CN114581596A CN202210178311.1A CN202210178311A CN114581596A CN 114581596 A CN114581596 A CN 114581596A CN 202210178311 A CN202210178311 A CN 202210178311A CN 114581596 A CN114581596 A CN 114581596A
- Authority
- CN
- China
- Prior art keywords
- rendering
- gpu
- target scene
- geometric
- shader
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 194
- 238000000034 method Methods 0.000 title claims abstract description 51
- 239000000872 buffer Substances 0.000 claims abstract description 57
- 238000004590 computer program Methods 0.000 claims abstract description 14
- 230000009466 transformation Effects 0.000 claims description 14
- 239000011159 matrix material Substances 0.000 claims description 5
- 230000001131 transforming effect Effects 0.000 claims 2
- 238000004891 communication Methods 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 description 23
- 239000007787 solid Substances 0.000 description 14
- 230000008569 process Effects 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000000354 decomposition reaction Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
- G06T15/80—Shading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Image Generation (AREA)
Abstract
Description
技术领域technical field
本公开的实施例涉及计算机领域,并且更具体地,涉及基于图形处理单元GPU驱动的几何形体快速渲染的方法、电子设备、装置、介质和计算机程序产品。Embodiments of the present disclosure relate to the field of computers, and more particularly, to methods, electronic devices, apparatuses, media, and computer program products for fast rendering of geometric shapes based on graphics processing units (GPUs).
背景技术Background technique
在现有技术中,建模软件产品对几何形体的渲染一般都在CPU端实现对几何形体数据的离散(例如,将几何形体数据离散为三角面片),然后在GPU端将三角面片数据由相应的GPU渲染管线渲染。这样,在CPU与GPU之间通信的数据量较大,并且CPU在计算要被离散的几何形体数据时的计算量较大,而此时GPU的算力被浪费,导致最终的渲染帧率较低,呈现的视觉效果不佳,降低了用户体验。因此,急需一种渲染方法,通过该方法能够降低中央处理单元CPU的负荷,减少在GPU与CPU之间通信的数据量,并且提高渲染帧率。In the prior art, the rendering of geometry by modeling software products generally implements discrete geometry data on the CPU side (for example, discretizes the geometry data into triangular patches), and then converts the triangular patch data on the GPU side. Rendered by the corresponding GPU rendering pipeline. In this way, the amount of data communicated between the CPU and the GPU is large, and the CPU has a large amount of calculation when calculating the geometric data to be discrete, and the computing power of the GPU is wasted at this time, resulting in a higher final rendering frame rate. Low, the rendered visual effect is poor, which reduces the user experience. Therefore, a rendering method is urgently needed, by which the load of the central processing unit CPU can be reduced, the amount of data communicated between the GPU and the CPU can be reduced, and the rendering frame rate can be improved.
发明内容SUMMARY OF THE INVENTION
本公开的实施例提供了一种基于GPU驱动的几何形体快速渲染的方法、电子设备、装置、介质和计算机程序产品。Embodiments of the present disclosure provide a method, electronic device, apparatus, medium, and computer program product for fast rendering of geometry based on GPU driving.
根据本公开的第一方面,提供了一种基于GPU驱动的几何形体快速渲染的方法。该方法包括根据目标场景中的多个几何形体的相应类型和相应渲染属性,在GPU的缓存中确定相应的缓冲区,相应的缓冲区对应于GPU中的多个GPU渲染管线中的相应GPU渲染管线。该方法还包括根据预先确定的优先级,将多个几何形体中的每个几何形体的渲染参数按照优先级填充至相应的缓冲区。该方法还包括基于目标场景中的多个几何形体和与目标场景相关联的视角参数来生成视锥体,使用GPU将视锥体范围以外的几何形体的渲染参数从相应的缓冲区中移除。并且该方法还包括基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景,其中剩余的渲染参数表示将要被渲染的几何形体。According to a first aspect of the present disclosure, a method for fast rendering of geometric shapes based on GPU is provided. The method includes determining a corresponding buffer in a cache of the GPU according to the corresponding types and corresponding rendering attributes of multiple geometric bodies in the target scene, and the corresponding buffer corresponds to the corresponding GPU rendering in the multiple GPU rendering pipelines in the GPU pipeline. The method also includes, according to the predetermined priority, filling the rendering parameter of each geometrical shape of the plurality of geometrical shapes into the corresponding buffer according to the priority. The method also includes generating a view frustum based on the plurality of geometries in the target scene and viewing angle parameters associated with the target scene, using the GPU to remove the rendering parameters of the geometry outside the view frustum from the corresponding buffers . And the method further includes using at least one shader in the GPU rendering pipeline to generate a rendered target scene based on the remaining rendering parameters in the corresponding buffer, wherein the remaining rendering parameters represent the geometry to be rendered.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第一多个三角面片数据。以及基于第一多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate the first plurality of Triangular patch data. and rendering the target scene based on the first plurality of triangular patch data.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的几何着色器对剩余的渲染参数进行离散化以生成第二多个三角面片数据。以及基于第二多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a geometry shader in the GPU rendering pipeline to generate the second plurality of triangular faces slice data. and rendering the target scene based on the second plurality of triangular patch data.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第三多个三角面片数据。基于第三多个三角面片数据,使用GPU渲染管线中的几何着色器生成第四多个三角面片数据,其中第四多个三角面片数据的数目大于第三多个三角面片数据的数目。以及基于第四多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate a third plurality of Triangular patch data. Based on the third plurality of triangular patch data, the geometry shader in the GPU rendering pipeline is used to generate the fourth plurality of triangular patch data, wherein the number of the fourth plurality of triangular patch data is greater than that of the third plurality of triangular patch data number. and rendering the target scene based on the fourth plurality of triangular patch data.
在某些实施例中,视锥体通过以下方式来确定:基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的外壳着色器生成多个几何形体中的每个几何形体的包围盒。通过矩阵变换,将每个几何形体的包围盒变换至标准设备空间,变换满足规范化设备坐标的显示特性。以及将变换的边界确定为视锥体的边界。In some embodiments, the frustum is determined by generating a bounding box for each of the plurality of geometries using a hull shader in the GPU rendering pipeline based on the rendering parameters remaining in the corresponding buffer . Through matrix transformation, the bounding box of each geometric body is transformed to the standard device space, and the transformation satisfies the display characteristics of normalized device coordinates. And the bounds of the transform are determined as the bounds of the view frustum.
在某些实施例中,其中多个几何形体通过场景管理树被分类为相应类型,场景管理树指示几何形体的类型以及每个类型的子类型之间的关系。In some embodiments, where a plurality of geometries are classified into respective types by a scene management tree, the scene management tree indicates the type of geometry and the relationship between the subtypes of each type.
在某些实施例中,几何形体的类型包括实体,其中属于实体的几何形体具有可以使用参数表示的几何形状。曲线曲面,其中属于曲线曲面的几何形体具有可以使用方程表示的曲面。三角面片,其中不属于实体或曲线曲面的几何形体属于三角面片。In some embodiments, the type of geometry includes a solid, wherein the geometry belonging to the solid has a geometric shape that can be represented using parameters. A curvilinear surface, where the geometry that is a curvilinear surface has a surface that can be represented using equations. Triangular patches, in which geometry that is not a solid or curved surface is a triangular patch.
在某些实施例中,其中使用建筑信息模型BIM数据来表示多个几何形体。In some embodiments, the plurality of geometries are represented using Building Information Modeling BIM data.
根据本公开的第二方面,还提供了一种电子设备。该电子设备包括处理器、图形处理单元GPU,以及与处理器和GPU共同或单独耦合的存储器,存储器具有存储于其中的指令,与处理器和GPU耦合的存储器,存储器具有存储于其中的指令,指令在被处理器执行时使电子设备执行以下动作:使处理器根据目标场景中的多个几何形体的相应类型和相应渲染属性,在GPU的缓存中确定相应的缓冲区,相应的缓冲区对应于GPU中的多个GPU渲染管线中的相应GPU渲染管线。根据预先确定的优先级,将多个几何形体中的每个几何形体的渲染参数按照优先级填充至相应的缓冲区。指令在被GPU执行时使电子设备执行以下动作:基于所述目标场景中的多个几何形体和与目标场景相关联的视角参数来生成视锥体,使用GPU将视锥体范围以外的几何形体的渲染参数从相应的缓冲区中移除。基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景,其中剩余的渲染参数表示将要被渲染的几何形体。According to a second aspect of the present disclosure, there is also provided an electronic device. The electronic device includes a processor, a graphics processing unit GPU, and a memory coupled together or separately with the processor and the GPU, the memory having instructions stored therein, a memory coupled to the processor and the GPU, the memory having instructions stored therein, When executed by the processor, the instruction causes the electronic device to perform the following actions: causing the processor to determine a corresponding buffer in the cache of the GPU according to the corresponding types and corresponding rendering attributes of the plurality of geometric shapes in the target scene, and the corresponding buffer corresponds to A corresponding GPU rendering pipeline among the multiple GPU rendering pipelines in the GPU. According to a predetermined priority, the rendering parameters of each of the plurality of geometric shapes are filled into the corresponding buffer according to the priority. The instructions, when executed by the GPU, cause the electronic device to perform the following actions: generate a view frustum based on a plurality of geometric shapes in the target scene and viewing angle parameters associated with the target scene, use the GPU to convert the geometry outside the view frustum The rendering parameters are removed from the corresponding buffer. A rendered target scene is generated using at least one shader in the GPU rendering pipeline based on the remaining rendering parameters in the corresponding buffer, wherein the remaining rendering parameters represent the geometry to be rendered.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第一多个三角面片数据。以及基于第一多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate the first plurality of Triangular patch data. and rendering the target scene based on the first plurality of triangular patch data.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的几何着色器对剩余的渲染参数进行离散化以生成第二多个三角面片数据。以及基于第二多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a geometry shader in the GPU rendering pipeline to generate the second plurality of triangular faces slice data. and rendering the target scene based on the second plurality of triangular patch data.
在某些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第三多个三角面片数据。基于第三多个三角面片数据,使用GPU渲染管线中的几何着色器生成第四多个三角面片数据,其中第四多个三角面片数据的数目大于第三多个三角面片数据的数目。以及基于第四多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate a third plurality of Triangular patch data. Based on the third plurality of triangular patch data, the geometry shader in the GPU rendering pipeline is used to generate the fourth plurality of triangular patch data, wherein the number of the fourth plurality of triangular patch data is greater than that of the third plurality of triangular patch data number. and rendering the target scene based on the fourth plurality of triangular patch data.
在某些实施例中,视锥体通过以下方式来确定:基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的外壳着色器生成多个几何形体中的每个几何形体的包围盒。通过矩阵变换,将每个几何形体的包围盒变换至标准设备空间,变换满足规范化设备坐标的显示特性。以及将变换的边界确定为视锥体的边界。In some embodiments, the frustum is determined by generating a bounding box for each of the plurality of geometries using a hull shader in the GPU rendering pipeline based on the rendering parameters remaining in the corresponding buffer . Through matrix transformation, the bounding box of each geometric body is transformed to the standard device space, and the transformation satisfies the display characteristics of normalized device coordinates. And the bounds of the transform are determined as the bounds of the view frustum.
在某些实施例中,其中多个几何形体通过场景管理树被分类为相应类型,场景管理树指示几何形体的类型以及每个类型的子类型之间的关系。In some embodiments, where a plurality of geometries are classified into respective types by a scene management tree, the scene management tree indicates the type of geometry and the relationship between the subtypes of each type.
在某些实施例中,几何形体的类型包括实体,其中属于实体的几何形体具有可以使用参数表示的几何形状。曲线曲面,其中属于曲线曲面的几何形体具有可以使用方程表示的曲面。三角面片,其中不属于实体或曲线曲面的几何形体属于三角面片。In some embodiments, the type of geometry includes a solid, wherein the geometry belonging to the solid has a geometric shape that can be represented using parameters. A curvilinear surface, where the geometry that is a curvilinear surface has a surface that can be represented using equations. Triangular patches, in which geometry that is not a solid or curved surface is a triangular patch.
在某些实施例中,其中使用建筑信息模型BIM数据来表示多个几何形体。In some embodiments, the plurality of geometries are represented using Building Information Modeling BIM data.
根据本公开的第三方面,提供了一种基于GPU驱动的几何形体快速渲染的装置。该装置包括缓冲区确定模块,被配置为根据目标场景中的多个几何形体的相应类型和相应渲染属性,在GPU的缓存中确定相应的缓冲区,相应的缓冲区对应于GPU中的多个GPU渲染管线中的相应GPU渲染管线。该装置还包括填充模块,被配置为根据预先确定的优先级,将多个几何形体中的每个几何形体的渲染参数按照优先级填充至相应的缓冲区。该装置还包括基于目标场景中的多个几何形体和与目标场景相关联的视角参数来生成视锥体,使用GPU将视锥体范围以外的几何形体的渲染参数从相应的缓冲区中移除。并且该装置还包括基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景,其中剩余的渲染参数表示将要被渲染的几何形体。According to a third aspect of the present disclosure, an apparatus for fast rendering of geometric shapes based on GPU is provided. The device includes a buffer determination module configured to determine corresponding buffers in a GPU cache according to corresponding types and corresponding rendering attributes of a plurality of geometric shapes in a target scene, and the corresponding buffers correspond to a plurality of The corresponding GPU rendering pipeline in the GPU rendering pipeline. The apparatus further includes a filling module configured to fill the rendering parameters of each geometric shape in the plurality of geometric shapes into the corresponding buffer according to the priority according to the predetermined priority. The apparatus further includes generating a view frustum based on the plurality of geometric shapes in the target scene and viewing angle parameters associated with the target scene, and using the GPU to remove the rendering parameters of the geometric shapes outside the range of the view frustum from the corresponding buffers . And the apparatus further includes generating a rendered target scene using at least one shader in the GPU rendering pipeline based on the remaining rendering parameters in the corresponding buffer, wherein the remaining rendering parameters represent the geometry to be rendered.
根据本公开的第四方面,提供了一种计算机可读存储介质,包括机器可执行指令,该机器可执行指令在由设备执行时使该设备执行根据本公开的第一方面的方法。According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium comprising machine-executable instructions which, when executed by an apparatus, cause the apparatus to perform the method according to the first aspect of the present disclosure.
根据本公开的第五方面,提供了一种计算机程序产品,计算机程序产品被有形地存储在计算机可读介质上并且包括机器可执行指令,机器可执行指令在由设备执行时使设备执行根据第一方面的方法。According to a fifth aspect of the present disclosure, there is provided a computer program product tangibly stored on a computer-readable medium and comprising machine-executable instructions that, when executed by an apparatus, cause the apparatus to perform the method on the one hand.
提供发明内容部分是为了以简化的形式来介绍对概念的选择,它们在下文的具体实施方式中将被进一步描述。发明内容部分无意标识要求保护的主题的关键特征或主要特征,也无意限制要求保护的主题的范围。This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary section is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter.
附图说明Description of drawings
结合附图并参考以下详细说明,本公开各实施例的上述和其它特征、优点及方面将变得更加明显。在附图中,相同或相似的附图标记表示相同或相似的元素,其中:The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent when taken in conjunction with the accompanying drawings and with reference to the following detailed description. In the drawings, the same or similar reference numbers refer to the same or similar elements, wherein:
图1示出了本公开的实施例能够在其中实现的示例环境的示意图;1 shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;
图2示意性示出了根据本公开的实施例的场景管理树的示意图;FIG. 2 schematically shows a schematic diagram of a scene management tree according to an embodiment of the present disclosure;
图3示意性示出了根据本公开的实施例的GPU渲染管线的示意图;3 schematically shows a schematic diagram of a GPU rendering pipeline according to an embodiment of the present disclosure;
图4示意性示出了根据本公开的实施例的视锥体的示意图;FIG. 4 schematically shows a schematic diagram of a viewing frustum according to an embodiment of the present disclosure;
图5A示意性示出了根据本公开的示例性实现的着色器的示意图;5A schematically shows a schematic diagram of a shader according to an exemplary implementation of the present disclosure;
图5B示意性示出了根据本公开的示例性实现的曲面细分着色器中的细化的着色器的示意图;5B schematically illustrates a schematic diagram of a tessellated shader in a tessellation shader according to an exemplary implementation of the present disclosure;
图6示意性示出了根据本公开的示例性实现的GPU驱动的几何形体渲染的方法的流程图;6 schematically shows a flowchart of a method for GPU-driven geometry rendering according to an exemplary implementation of the present disclosure;
图7示意性示出了根据本公开的示例性实现的GPU驱动的几何形体渲染的装置的框图;以及FIG. 7 schematically illustrates a block diagram of an apparatus for GPU-driven geometry rendering according to an exemplary implementation of the present disclosure; and
图8示意性示出了根据本公开的示例性实现的GPU驱动的几何形体渲染的设备的框图。8 schematically illustrates a block diagram of an apparatus for GPU-driven geometry rendering according to an exemplary implementation of the present disclosure.
在所有附图中,相同或相似参考数字表示相同或相似元素。Throughout the drawings, the same or similar reference numbers refer to the same or similar elements.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for the purpose of A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
在本公开的实施例的描述中,术语“包括”及其类似用语应当理解为开放性包括,即“包括但不限于”。术语“基于”应当理解为“至少部分地基于”。术语“一个实施例”或“该实施例”应当理解为“至少一个实施例”。术语“第一”、“第二”等等可以指代不同的或相同的对象。下文还可能包括其它明确的和隐含的定义。In the description of embodiments of the present disclosure, the term "including" and the like should be construed as inclusive, ie, "including but not limited to". The term "based on" should be understood as "based at least in part on". The terms "one embodiment" or "the embodiment" should be understood to mean "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
另外,本文所有具体数值都是示例,仅是为了帮助理解,绝无限定范围之意图。In addition, all specific numerical values herein are examples, are provided only to aid understanding, and are in no way intended to limit the range.
发明人注意到,现有的建模软件产品对几何形体的渲染一般都在CPU端实现对几何形体数据的离散(例如,将几何形体数据离散为三角面片),然后在GPU端将三角面片数据由相应的GPU渲染管线渲染。这样,需要在CPU与GPU之间进行通信,并且数据量较大。CPU在计算要被离散的几何形体数据时的计算量较大,而此时GPU空闲,两者的并行算力被浪费。这样,可以导致最终的渲染帧率较低,呈现的视觉效果不佳,降低了用户体验。因此,急需一种渲染方法,通过该方法能够降低CPU的负荷,减少在GPU与CPU之间通信的数据量,并且提高渲染帧率。The inventors have noticed that the rendering of geometric shapes by existing modeling software products generally implements the discrete geometric shape data on the CPU side (for example, the geometric shape data is discretized into triangular patches), and then the triangular surfaces are separated on the GPU side. Slice data is rendered by the corresponding GPU rendering pipeline. In this way, communication between the CPU and GPU is required, and the amount of data is large. When the CPU calculates the geometry data to be discrete, the calculation amount is large, while the GPU is idle at this time, and the parallel computing power of the two is wasted. In this way, the final rendering frame rate may be lower, the rendered visual effect may be poor, and the user experience may be degraded. Therefore, there is an urgent need for a rendering method by which the load of the CPU can be reduced, the amount of data communicated between the GPU and the CPU can be reduced, and the rendering frame rate can be improved.
有鉴于此,本公开的方法提供了一种GPU驱动的几何形体渲染的方法。利用该方法可以将原本的CPU中进行的一部分过程转移到GPU完成,从而使得CPU与GPU两者可以并行计算,在降低CPU符合的同时提升了计算效率,并且降低了CPU与GPU之间通信的数据量,提高了渲染帧率。In view of this, the method of the present disclosure provides a method for GPU-driven geometry rendering. Using this method, part of the process in the original CPU can be transferred to the GPU, so that both the CPU and the GPU can perform parallel computing, which improves the computing efficiency while reducing the CPU compliance, and reduces the communication between the CPU and the GPU. The amount of data increases the rendering frame rate.
在下文描述中,某些实施例将参考写入访问来讨论。但是应当理解,这仅仅是为了更好地理解本公开实施例的原理和思想,而无意以任何方式限制本公开的范围。In the following description, certain embodiments will be discussed with reference to write access. However, it should be understood that this is only for a better understanding of the principles and ideas of the embodiments of the present disclosure, and is not intended to limit the scope of the present disclosure in any way.
图1示出了本公开的实施例能够在其中实现的示例环境100的示意图。如图1所示,在计算资源101(例如,计算机系统、服务器等)处,获取(例如,接收)目标场景的计算机化的表示,例如,利用建筑信息模型BIM描述的目标场景的数据,这些BIM数据的示例包括,诸如模型图素、临时图素、带图形模型数据、非图形参数数据、其他形式结果数据(文本、图片、XML等)。基于这些数据,反映目标场景中的相应几何形体的特征,每个几何形体都是单独的参数化几何表示方法。计算资源101包括中央处理单元CPU 102和图形处理单元GPU 103。应该可以,CPU 102和GPU 103都可以具有多个核(未示出)。1 shows a schematic diagram of an
应当理解,图1中所示的示例环境100仅是示意性的,而无意于限制本公开的范围。示例环境100中还可以包括各种附加的设备、装置和/或模块。而且,图1中所示的模块也仅是示意性的,而无意于限制本公开的范围。在某些实施例中,某些模块可以集成到一个物理实体上,或者进一步拆分成更多模块。It should be understood that the
图2示意性示出了根据本公开的实施例的场景管理树200的示意图。FIG. 2 schematically shows a schematic diagram of a scene management tree 200 according to an embodiment of the present disclosure.
如图所示,场景管理树指示几何形体的类型以及每个类型的子类型之间的关系。利用场景管理树,可以将目标场景划分为不同的几何形体。结合场景管理树可以看出,在场景管理树的第一层中,包括了实体、曲线曲面和三角面片。实体可以理解为,其中属于实体的几何形体具有可以使用参数表示的几何形状。例如,球形可以表示为半径的大小和球形的数学公式。曲线曲面可以理解为,其中属于曲线曲面的几何形体具有可以使用方程表示的曲面。例如,贝塞尔曲线曲面,B样条曲线曲面。三角面片可以理解为,其中不属于实体或曲线曲面的几何形体属于三角面片。三角面片是无法使用参数进行结构化表达的类型。As shown, the scene management tree indicates the types of geometry and the relationship between the subtypes of each type. Using the scene management tree, the target scene can be divided into different geometries. Combining with the scene management tree, it can be seen that the first layer of the scene management tree includes solids, curved surfaces and triangular patches. A solid can be understood as one in which the geometry belonging to the solid has a geometric shape that can be represented using parameters. For example, a sphere can be expressed as the size of the radius and the mathematical formula for the sphere. A curved surface can be understood as one in which the geometry belonging to a curved surface has a surface that can be represented using equations. For example, Bezier surfaces, B-spline surfaces. A triangular patch can be understood as a geometry that does not belong to a solid or curved surface as a triangular patch. A triangular patch is a type that cannot be expressed structured with parameters.
可以进一步划分每个类型的子类型。例如,实体类型的子类型包括面、球、圆柱、圆环、拉伸体、旋转体、扫掠体等。曲线曲面类型的子类型包括贝塞尔曲线曲面、B样条曲线曲面、有理贝塞尔曲线曲面等。由于三角面片无法用参数结构化表示,因此没有子类型。Subtypes of each type can be further divided. For example, subtypes of solid types include face, sphere, cylinder, torus, extruded body, revolved body, swept body, and so on. Subtypes of curve surface types include Bezier surfaces, B-spline surfaces, rational Bezier surfaces, and more. Since triangular patches cannot be represented structurally with parameters, there are no subtypes.
图3示意性示出了根据本公开的实施例的GPU渲染管线300的示意图。如图所示,GPU渲染管线300可以包括顶点阶段301,在其中执行坐标变换,并且为后续阶段输出所需的数据。曲面细分阶段302,在其中实现提升几何形体的几何逼真度。几何阶段303,在其中完善几何形体数据。片段阶段304,在其中产生数据信息,用以描述一个三角网格是怎样覆盖每个像素的。FIG. 3 schematically shows a schematic diagram of a
图4示意性示出了根据本公开的实施例的视锥体400的示意图。FIG. 4 schematically shows a schematic diagram of a
如图所示,视锥体400可以根据目标场景自身的坐标系,通过三次坐标变换得到。首先将目标场景自身的坐标系变换为世界坐标系。然后,将世界坐标系转换到视空间坐标系,将得到的视空间坐标系中的坐标投影到裁剪空间,通过透视除法得到符合规范化设备坐标显示特性的视锥体400。可以理解,该过程将在三维空间中的目标场景“压缩”到二维屏幕中,并且以人眼视角观察,所以得到的锥形体被称为“视锥体”。在视锥体400以外的几何形体,无需被渲染。这一过程又被称为“剔除”过程,可以防止无效几何形体被渲染从而影响渲染性能。As shown in the figure, the
图5A示意性示出了根据本公开的示例性实现的着色器的示意图。5A schematically shows a schematic diagram of a shader according to an exemplary implementation of the present disclosure.
如图所示,着色器可以包括顶点着色器501,利用顶点着色器501可以对顶点数据进行转化处理。曲面细分着色器502,是GPU渲染管线一个可选的阶段,利用曲面细分着色器502可以通过增加三角形数量的方式丰富网格细节提升几何形体的逼真度。几何着色器503,是GPU渲染管线一个可选的阶段,利用几何着色器503可以将输入的点或线扩展成多边形来完善几何形体的数据。片段着色器504,利用片段着色器504可以决定屏幕上像素的最终颜色,在这个阶段会进行光照计算以及阴影处理,是GPU渲染管线高级效果产生的地方。As shown in the figure, the shader may include a
图5B示意性示出了根据本公开的示例性实现的曲面细分着色器中的细化的着色器的示意图。5B schematically shows a schematic diagram of a tessellated shader in a tessellation shader according to an exemplary implementation of the present disclosure.
如图所示,在外壳着色器505中定义了一些细分的参数、内部参数的细分因子等数据,以及生成了三角面片的包围盒进行剔除等操作。镶嵌器(tessellator)506不可编程,由硬件根据外壳着色器505中配置的参数自行处理,执行数据细分操作。在域着色器507中,逐面片调用并根据细分因子和镶嵌处理后的顶点UV数据,计算出实际顶点坐标,并将其转换到齐次裁剪空间,生成程序所需显示数据进行后续渲染。As shown in the figure, some subdivision parameters, subdivision factors of internal parameters and other data are defined in the
图6示意性示出了根据本公开的示例性实现的基于GPU驱动的几何形体快速渲染的方法600的流程图。FIG. 6 schematically shows a flowchart of a
在框602处,根据目标场景中的多个几何形体的相应类型和相应渲染属性,在GPU的缓存中确定相应的缓冲区,相应的缓冲区对应于GPU中的多个GPU渲染管线中的相应GPU渲染管线。At
在一些实施例中,将根据场景管理树,提取出目标场景中包括哪些几何形体,以及根据这些几何形体的类型和渲染参数,将几何形体类型和相应的渲染参数存储为条目。该条目可以被更新。渲染参数可以包括颜色、图、数值等。针对每个几何形体,在GPU缓存中,确定一个缓冲区存储这些条目。每个缓冲区都对应相应的GPU渲染管线,在其自己的渲染阶段被渲染。In some embodiments, according to the scene management tree, which geometric bodies are included in the target scene are extracted, and according to the types and rendering parameters of these geometric bodies, the geometric body types and corresponding rendering parameters are stored as entries. This entry can be updated. Rendering parameters can include colors, graphs, values, etc. For each geometry, in the GPU cache, a buffer is determined to store these entries. Each buffer corresponds to the corresponding GPU rendering pipeline and is rendered in its own rendering stage.
在框604处,根据预先确定的优先级,将多个几何形体中的每个几何形体的渲染参数按照优先级填充至相应的缓冲区。At
在一些实施例中,基于使得渲染性能最大化的原则,针对不同的几何形体的类型,确定相应的优先级。将相应几何形体类型和相应的渲染参数填充至相应的缓冲区。然后,针对每个缓冲区,遍历属于该缓冲区的几何形体,调用图形应用来进行图形渲染。In some embodiments, based on the principle of maximizing rendering performance, corresponding priorities are determined for different types of geometry. Fill the corresponding buffer with the corresponding geometry type and the corresponding rendering parameters. Then, for each buffer, the geometry belonging to the buffer is traversed, and the graphics application is called for graphics rendering.
这样,在后续步骤中,可以使得原本在CPU中的过程转移到了GPU中,从而减少了CPU与GPU之间的数据通信,降低了渲染带宽消耗。In this way, in the subsequent steps, the process originally in the CPU can be transferred to the GPU, thereby reducing the data communication between the CPU and the GPU, and reducing the consumption of rendering bandwidth.
在框606处,基于目标场景中的多个几何形体和与目标场景相关联的视角参数来生成视锥体,使用GPU将视锥体范围以外的几何形体的渲染参数从相应的缓冲区中移除。At
可以理解,移除的几何形体(以对应的渲染参数表示)是不能以人的视角观察到的内容,因此也无需被渲染。It can be understood that the removed geometry (represented by the corresponding rendering parameters) is content that cannot be observed from a human perspective, and therefore does not need to be rendered.
在框608处,基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景,其中剩余的渲染参数表示将要被渲染的几何形体。At
在一些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第一多个三角面片数据。以及基于第一多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate the first plurality of triangles patch data. and rendering the target scene based on the first plurality of triangular patch data.
在一些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的几何着色器对剩余的渲染参数进行离散化以生成第二多个三角面片数据。以及基于第二多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using the geometry shader in the GPU rendering pipeline to generate the second plurality of triangular patches data. and rendering the target scene based on the second plurality of triangular patch data.
在一些实施例中,其中使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景包括使用GPU渲染管线中的曲面细分着色器对剩余的渲染参数进行离散化以生成第三多个三角面片数据。基于第三多个三角面片数据,使用GPU渲染管线中的几何着色器生成第四多个三角面片数据,其中第四多个三角面片数据的数目大于第三多个三角面片数据的数目。以及基于第四多个三角面片数据来渲染目标场景。In some embodiments, wherein generating the rendered target scene using at least one shader in the GPU rendering pipeline includes discretizing the remaining rendering parameters using a tessellation shader in the GPU rendering pipeline to generate the third plurality of triangles patch data. Based on the third plurality of triangular patch data, the geometry shader in the GPU rendering pipeline is used to generate the fourth plurality of triangular patch data, wherein the number of the fourth plurality of triangular patch data is greater than that of the third plurality of triangular patch data number. and rendering the target scene based on the fourth plurality of triangular patch data.
例如,生成的第三多个三角面片数据包括10个数据,再针对这10个数据中的每一个数据再次生成4个数据,则总共就可以生成4*10个数据。这样,可以理解,通过基于生成的第三多个三角面片数据来生成第四多个三角面片数据,可以获得更加细腻的渲染效果,因此可以增加用户体验。For example, the generated third plurality of triangular patch data includes 10 pieces of data, and then 4 pieces of data are generated again for each of the 10 pieces of data, so that 4*10 pieces of data can be generated in total. In this way, it can be understood that by generating the fourth plurality of triangular patch data based on the generated third plurality of triangular patch data, a more delicate rendering effect can be obtained, and thus the user experience can be improved.
在一些实施例中,可以利用多边形分解算法或顶点法向量插值算法,生成更细粒度的多个三角面片数据,使用曲面细分着色器生成所述渲染后的目标场景。In some embodiments, a polygon decomposition algorithm or a vertex normal vector interpolation algorithm may be used to generate more fine-grained multiple triangular patch data, and a tessellation shader may be used to generate the rendered target scene.
通过使用多边形分解算法或顶点法向量插值算法,可以达到在几何形体的表面使用更细腻的多图元模拟表达曲面的效果。因此,渲染后的目标场景可以使得用户体验增加。By using the polygon decomposition algorithm or the vertex normal vector interpolation algorithm, the surface of the geometric body can be simulated and expressed with more delicate multi-elements. Therefore, the rendered target scene can enhance the user experience.
在一些实施例中,视锥体通过以下方式来确定:基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的外壳着色器生成多个几何形体中的每个几何形体的包围盒。通过矩阵变换,将每个几何形体的包围盒变换至标准设备空间,变换满足规范化设备坐标(Normalized Device Coordinates)的显示特性。以及将变换的边界确定为视锥体的边界。In some embodiments, the view frustum is determined by generating a bounding box for each of the plurality of geometries using a hull shader in the GPU rendering pipeline based on the rendering parameters remaining in the corresponding buffer. Through matrix transformation, the bounding box of each geometry is transformed into standard device space, and the transformation satisfies the display characteristics of Normalized Device Coordinates. And the bounds of the transform are determined as the bounds of the view frustum.
在一些实施例中,所述多个几何形体通过场景管理树被分类为相应类型,所述场景管理树指示几何形体的类型以及每个类型的子类型之间的关系。In some embodiments, the plurality of geometries are classified into respective types by a scene management tree indicating the types of geometries and the relationship between subtypes of each type.
在一些实施例中,所述几何形体的类型包括:实体,其中属于所述实体的几何形体具有可以使用参数表示的几何形状;曲线曲面,其中属于所述曲线曲面的几何形体具有可以使用方程表示的曲面;三角面片,其中不属于所述实体或所述曲线曲面的几何形体属于所述三角面片。In some embodiments, the types of the geometry include: solid, wherein the geometry belonging to the solid has a geometry that can be represented using parameters; curvilinear surfaces, wherein the geometry belonging to the curvilinear surface has a geometry that can be represented using equations The surface of ; a triangular patch in which geometry that does not belong to the solid or the curvilinear surface belongs to the triangular patch.
在一些实施例中,使用建筑信息模型BIM数据来表示所述多个几何形体。In some embodiments, the plurality of geometries are represented using Building Information Modeling BIM data.
以下提供了实现本公开的实施例的计算机程序的伪代码。Pseudocode for a computer program implementing embodiments of the present disclosure is provided below.
本发明实施例中使用的基于GPU驱动的渲染算法架构示意如下,其中对代码注释体现了主要的步骤。The architecture of the GPU-driven rendering algorithm used in the embodiment of the present invention is as follows, and the main steps are reflected in the code comments.
本发明实施例中使用的基于GPU驱动的球体生成算法如下,其中对代码注释体现了主要的步骤:The GPU-driven sphere generation algorithm used in the embodiment of the present invention is as follows, wherein the main steps are reflected in the code comments:
本发明实施例中使用的基于GPU驱动的有理贝塞尔曲线曲面生成算法如下,其中对代码注释体现了主要的步骤。The GPU-driven rational Bezier curve surface generation algorithm used in the embodiment of the present invention is as follows, and the main steps are reflected in the code comments.
可以理解,通过方法600,可以将原本的CPU中进行的一部分过程(如框606和框608所示的过程)转移到GPU完成,从而使得CPU与GPU两者可以并行计算,在降低CPU符合的同时提升了计算效率,使得CPU与GPU之间的负荷比较平衡,并且降低了CPU与GPU之间通信的数据量,提高了渲染帧率。此外,通过在各个渲染阶段的不同着色器的使用,使得渲染效果更细腻,增加了用户体验。It can be understood that, through the
图7示意性示出了根据本公开的示例性实现的基于GPU驱动的几何形体快速渲染的装置的框图。FIG. 7 schematically shows a block diagram of an apparatus for fast rendering of geometry based on GPU driven according to an exemplary implementation of the present disclosure.
缓冲区确定模块702,被配置为根据目标场景中的多个几何形体的相应类型和相应渲染属性,在GPU的缓存中确定相应的缓冲区,相应的缓冲区对应于GPU中的多个GPU渲染管线中的相应GPU渲染管线。The
填充模块704,被配置为根据预先确定的优先级,将多个几何形体中的每个几何形体的渲染参数按照优先级填充至相应的缓冲区。The filling
渲染参数移除模块706,被配置为基于目标场景中的多个几何形体和与目标场景相关联的视角参数来生成视锥体,使用GPU将视锥体范围以外的几何形体的渲染参数从相应的缓冲区中移除。The rendering
渲染模块708,被配置为基于相应的缓冲区内剩余的渲染参数,使用GPU渲染管线中的至少一个着色器生成渲染后的目标场景,其中剩余的渲染参数表示将要被渲染的几何形体。The
可以理解,装置700也可以实现如方法600所能够实现的有益技术效果。It can be understood that the
图8示出了可以用来实施本公开的实施例的设备800的示意性框图,设备800可以是本公开的实施例所描述的设备或装置。如图8所示,设备800包括中央处理单元(CPU)801,其可以根据存储在只读存储器(ROM)802中的计算机程序指令或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序指令,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。CPU 801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。虽然未在图8中示出,设备800还可以包括协处理器。FIG. 8 shows a schematic block diagram of a
设备800中的多个部件连接至I/O接口805,包括:输入单元806,例如键盘、鼠标等;输出单元807,例如各种类型的显示器、扬声器等;存储单元808,例如磁盘、光盘等;以及通信单元809,例如网卡、调制解调器、无线通信收发机等。通信单元809允许设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the
上文所描述的各个方法或过程可以由处理单元801来执行。例如,在一些实施例中,方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到设备800上。当计算机程序被加载到RAM 803并由CPU 801执行时,可以执行上文描述的方法或过程中的一个或多个步骤或动作。The various methods or processes described above may be performed by the
在一些实施例中,以上所描述的方法和过程可以被实现为计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于执行本公开的各个方面的计算机可读程序指令。In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for carrying out various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
本文所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein can be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network, eg, the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,编程语言包括面向对象的编程语言,以及常规的过程式编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code written in any combination of programming languages, including object-oriented programming languages, and conventional procedural programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present disclosure.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理单元,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理单元执行时,产生了实现流程图和/或框图中的一个或多个框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer or other programmable data processing device to produce a machine that causes the instructions when executed by the processing unit of the computer or other programmable data processing device , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的设备、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这取决于所涉及的功能。也要注意的是,框图和/或流程图中的每个框、以及框图和/或流程图中的框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which contains one or more operables for implementing the specified logical function(s) Execute the instruction. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions, or It may be implemented in a combination of special purpose hardware and computer instructions.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所公开的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中技术的技术改进,或者使得本技术领域的其它普通技术人员能理解本文公开的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or technical improvement over technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本公开,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the disclosure has been described in language specific to structural features and/or methodological logical acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims (19)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210178311.1A CN114581596B (en) | 2022-02-25 | 2022-02-25 | A fast rendering method of geometric shapes based on GPU driver |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210178311.1A CN114581596B (en) | 2022-02-25 | 2022-02-25 | A fast rendering method of geometric shapes based on GPU driver |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114581596A true CN114581596A (en) | 2022-06-03 |
CN114581596B CN114581596B (en) | 2024-11-15 |
Family
ID=81770239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210178311.1A Active CN114581596B (en) | 2022-02-25 | 2022-02-25 | A fast rendering method of geometric shapes based on GPU driver |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114581596B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023241210A1 (en) * | 2022-06-17 | 2023-12-21 | 腾讯科技(深圳)有限公司 | Method and apparatus for rendering virtual scene, and device and storage medium |
CN117893663A (en) * | 2024-03-13 | 2024-04-16 | 北京大学 | Web graphic rendering performance optimization method based on WebGPU |
Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001022370A1 (en) * | 1999-09-24 | 2001-03-29 | Sun Microsystems, Inc. | Method and apparatus for rapid visualization of three-dimensional scenes |
US20080225048A1 (en) * | 2007-03-15 | 2008-09-18 | Microsoft Corporation | Culling occlusions when rendering graphics on computers |
US8379021B1 (en) * | 2008-01-30 | 2013-02-19 | Adobe Systems Incorporated | System and methods for rendering height-field images with hard and soft shadows |
US20130127858A1 (en) * | 2009-05-29 | 2013-05-23 | Luc Leroy | Interception of Graphics API Calls for Optimization of Rendering |
US20140043341A1 (en) * | 2012-08-09 | 2014-02-13 | Qualcomm Incorporated | Gpu-accelerated path rendering |
US20140320523A1 (en) * | 2013-04-30 | 2014-10-30 | Microsoft Corporation | Tessellation of two-dimensional curves using a graphics pipeline |
US9928637B1 (en) * | 2016-03-08 | 2018-03-27 | Amazon Technologies, Inc. | Managing rendering targets for graphics processing units |
CN109978751A (en) * | 2017-12-28 | 2019-07-05 | 辉达公司 | More GPU frame renderings |
CN110827387A (en) * | 2018-08-10 | 2020-02-21 | 辉达公司 | Method for continuous hierarchical bounding box traversal of intersections without shader intervention |
US20200193703A1 (en) * | 2018-12-17 | 2020-06-18 | Advanced Micro Devices, Inc. | Optimizing primitive shaders |
CN112017104A (en) * | 2019-05-30 | 2020-12-01 | 畅想科技有限公司 | Functional security in a graphics processing system |
US20200379864A1 (en) * | 2019-05-31 | 2020-12-03 | Apple Inc. | Graphics Processing Unit Performance Analysis Tool |
CN112270756A (en) * | 2020-11-24 | 2021-01-26 | 山东汇颐信息技术有限公司 | Data rendering method applied to BIM model file |
CN112509108A (en) * | 2020-12-03 | 2021-03-16 | 杭州群核信息技术有限公司 | GPU-based vertex ambient light shading generation method and image rendering method |
CN112614041A (en) * | 2020-12-29 | 2021-04-06 | 完美世界(北京)软件科技发展有限公司 | Data driving method and device for sparse rendering, storage medium and electronic device |
CN112614042A (en) * | 2020-12-29 | 2021-04-06 | 完美世界(北京)软件科技发展有限公司 | Data driving method and device for delayed rendering of map |
CN113012269A (en) * | 2019-12-19 | 2021-06-22 | 中国科学院深圳先进技术研究院 | Three-dimensional image data rendering method and equipment based on GPU |
CN113178014A (en) * | 2021-05-27 | 2021-07-27 | 网易(杭州)网络有限公司 | Scene model rendering method and device, electronic equipment and storage medium |
-
2022
- 2022-02-25 CN CN202210178311.1A patent/CN114581596B/en active Active
Patent Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001022370A1 (en) * | 1999-09-24 | 2001-03-29 | Sun Microsystems, Inc. | Method and apparatus for rapid visualization of three-dimensional scenes |
US20080225048A1 (en) * | 2007-03-15 | 2008-09-18 | Microsoft Corporation | Culling occlusions when rendering graphics on computers |
US8379021B1 (en) * | 2008-01-30 | 2013-02-19 | Adobe Systems Incorporated | System and methods for rendering height-field images with hard and soft shadows |
US20130127858A1 (en) * | 2009-05-29 | 2013-05-23 | Luc Leroy | Interception of Graphics API Calls for Optimization of Rendering |
US20140043341A1 (en) * | 2012-08-09 | 2014-02-13 | Qualcomm Incorporated | Gpu-accelerated path rendering |
US20140320523A1 (en) * | 2013-04-30 | 2014-10-30 | Microsoft Corporation | Tessellation of two-dimensional curves using a graphics pipeline |
US9928637B1 (en) * | 2016-03-08 | 2018-03-27 | Amazon Technologies, Inc. | Managing rendering targets for graphics processing units |
CN109978751A (en) * | 2017-12-28 | 2019-07-05 | 辉达公司 | More GPU frame renderings |
CN110827387A (en) * | 2018-08-10 | 2020-02-21 | 辉达公司 | Method for continuous hierarchical bounding box traversal of intersections without shader intervention |
US20200193703A1 (en) * | 2018-12-17 | 2020-06-18 | Advanced Micro Devices, Inc. | Optimizing primitive shaders |
CN112017104A (en) * | 2019-05-30 | 2020-12-01 | 畅想科技有限公司 | Functional security in a graphics processing system |
US20200379864A1 (en) * | 2019-05-31 | 2020-12-03 | Apple Inc. | Graphics Processing Unit Performance Analysis Tool |
CN113012269A (en) * | 2019-12-19 | 2021-06-22 | 中国科学院深圳先进技术研究院 | Three-dimensional image data rendering method and equipment based on GPU |
CN112270756A (en) * | 2020-11-24 | 2021-01-26 | 山东汇颐信息技术有限公司 | Data rendering method applied to BIM model file |
CN112509108A (en) * | 2020-12-03 | 2021-03-16 | 杭州群核信息技术有限公司 | GPU-based vertex ambient light shading generation method and image rendering method |
CN112614041A (en) * | 2020-12-29 | 2021-04-06 | 完美世界(北京)软件科技发展有限公司 | Data driving method and device for sparse rendering, storage medium and electronic device |
CN112614042A (en) * | 2020-12-29 | 2021-04-06 | 完美世界(北京)软件科技发展有限公司 | Data driving method and device for delayed rendering of map |
CN113178014A (en) * | 2021-05-27 | 2021-07-27 | 网易(杭州)网络有限公司 | Scene model rendering method and device, electronic equipment and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023241210A1 (en) * | 2022-06-17 | 2023-12-21 | 腾讯科技(深圳)有限公司 | Method and apparatus for rendering virtual scene, and device and storage medium |
CN117893663A (en) * | 2024-03-13 | 2024-04-16 | 北京大学 | Web graphic rendering performance optimization method based on WebGPU |
CN117893663B (en) * | 2024-03-13 | 2024-06-07 | 北京大学 | WebGPU-based Web graphic rendering performance optimization method |
Also Published As
Publication number | Publication date |
---|---|
CN114581596B (en) | 2024-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11232534B2 (en) | Scheme for compressing vertex shader output parameters | |
JP7284307B2 (en) | Tessellation method using recursive subdivision of triangles | |
JP5111638B2 (en) | Apparatus and method for dividing a parametric curve into smaller subpatches | |
US8115767B2 (en) | Computer graphics shadow volumes using hierarchical occlusion culling | |
US10089774B2 (en) | Tessellation in tile-based rendering | |
US9367943B2 (en) | Seamless fracture in a production pipeline | |
TWI708208B (en) | Graphics processing systems | |
US8384715B2 (en) | View-dependent rendering of parametric surfaces | |
US8471852B1 (en) | Method and system for tessellation of subdivision surfaces | |
CN114581596A (en) | Geometric body fast rendering method based on graphic processing unit GPU drive | |
US11087511B1 (en) | Automated vectorization of a raster image using a gradient mesh with arbitrary topology | |
CN109934893B (en) | Method and device for displaying any cross section of geometric body and electronic equipment | |
JP2017062789A (en) | Graphics processing apparatus and method for determining lod for texturing | |
US10262391B2 (en) | Graphics processing devices and graphics processing methods | |
JP2004133550A (en) | Non-manifold implicit function expression method, direct drawing method of implicit function surface, and their programs | |
US10388060B2 (en) | System and method for multi-view rendering | |
US11417058B2 (en) | Anti-aliasing two-dimensional vector graphics using a multi-vertex buffer | |
CN114332411A (en) | A method for generating real-time meshes of 3D graphics | |
CN110502305B (en) | Method and device for realizing dynamic interface and related equipment | |
US10580209B2 (en) | Removal of degenerated sub-primitives in tessellation | |
US11869123B2 (en) | Anti-aliasing two-dimensional vector graphics using a compressed vertex buffer | |
US8274513B1 (en) | System, method, and computer program product for obtaining a boundary attribute value from a polygon mesh, during voxelization | |
WO2022120800A1 (en) | Graphics processing method and apparatus, and device and medium | |
US20240338881A1 (en) | Application Programming Interface to Indicate Bounding Volume Output | |
Ma et al. | Rasterization of geometric primitive in graphics based on FPGA |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |