CN115690284A - A rendering method, device and storage medium - Google Patents
A rendering method, device and storage medium Download PDFInfo
- Publication number
- CN115690284A CN115690284A CN202111627202.5A CN202111627202A CN115690284A CN 115690284 A CN115690284 A CN 115690284A CN 202111627202 A CN202111627202 A CN 202111627202A CN 115690284 A CN115690284 A CN 115690284A
- Authority
- CN
- China
- Prior art keywords
- rendering
- area
- angle area
- rendering result
- target angle
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/06—Ray-tracing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机领域,特别涉及一种渲染方法、装置及存储介质。The present application relates to the computer field, in particular to a rendering method, device and storage medium.
背景技术Background technique
光线追踪渲染技术一直是计算机图形学领域的基础技术,至今为止,该技术是实现高品质,真实感,高画质图像的最主要技术。但该技术一直以来,需要较长的计算时间,才能完成大量的蒙特卡洛积分计算过程,生成最终计算结果。所以,该技术一直应用在离线渲染场景,如影视,动画等领域。但是近年来,业界在不断尝试将光线追踪渲染技术应用于实时渲染场景,如游戏、增强现实等。Ray tracing rendering technology has always been the basic technology in the field of computer graphics. So far, this technology is the most important technology to achieve high-quality, realistic and high-quality images. However, this technology has always required a long calculation time to complete a large number of Monte Carlo integral calculations and generate the final calculation results. Therefore, this technology has been applied in offline rendering scenes, such as film and television, animation and other fields. But in recent years, the industry has been trying to apply ray tracing rendering technology to real-time rendering scenarios, such as games and augmented reality.
因此,如何在保证高画质的情况下,提升实时光线追踪渲染技术的效率成为了亟待解决的问题。Therefore, how to improve the efficiency of real-time ray tracing rendering technology while ensuring high image quality has become an urgent problem to be solved.
发明内容Contents of the invention
本申请提供了一种渲染方法,该方法可以提升渲染效率。The present application provides a rendering method, which can improve rendering efficiency.
本申请的第一方面提供了一种渲染方法,该渲染方法用于渲染应用,该应用包括至少一个模型,每个模型包括多个空间缓存区域,每个空间缓存区域包括多个角度区域,该方法包括:渲染该应用的当前帧的过程中,将出射光线与模型的交点所在的角度区域确定为目标角度区域;获取在渲染该当前帧之前预先计算的该目标角度区域的中间渲染结果,该目标角度区域的中间渲染结果是根据通过该目标角度区域所在的目标空间缓存区域的多根入射光线的预渲染结果确定的;根据该目标角度区域的中间渲染结果,计算当前视平面中像素的渲染结果。The first aspect of the present application provides a rendering method, the rendering method is used for rendering an application, the application includes at least one model, each model includes multiple spatial buffer areas, each spatial buffer area includes multiple angle areas, the The method includes: during the process of rendering the current frame of the application, determining the angle area where the intersection point of the outgoing ray and the model is located as the target angle area; obtaining the intermediate rendering result of the target angle area pre-calculated before rendering the current frame, the The intermediate rendering result of the target angle area is determined according to the pre-rendering results of multiple incident rays passing through the target space buffer area where the target angle area is located; according to the intermediate rendering result of the target angle area, the rendering of the pixels in the current viewing plane is calculated result.
通过在渲染当前帧的时刻前,对目标角度区域进行预渲染,获得中间渲染结果,并在渲染当前帧时,根据该中间渲染结果获得当前帧的渲染结果。避免了在渲染当前帧时,进行大量的、实时的光线追踪计算,有效地节约了计算时间,提升了渲染效率。By pre-rendering the target angle area before rendering the current frame, an intermediate rendering result is obtained, and when the current frame is rendered, the rendering result of the current frame is obtained according to the intermediate rendering result. It avoids a large number of real-time ray tracing calculations when rendering the current frame, effectively saving calculation time and improving rendering efficiency.
在一些可能的设计中,该方法还包括:根据该目标角度区域的中间渲染结果和像素与角度区域的对应关系,计算像素的渲染结果。通过建立角度区域与像素的对应关系,在确定角度区域的中间渲染结果后,可以确定像素的渲染结果。通过获取角度区域的中间渲染结果,避免了进行大量的实时渲染计算,提升了渲染的效率。In some possible designs, the method further includes: calculating a pixel rendering result according to the intermediate rendering result of the target angle area and the corresponding relationship between the pixel and the angle area. By establishing the corresponding relationship between the angle area and the pixel, after the intermediate rendering result of the angle area is determined, the rendering result of the pixel can be determined. By obtaining the intermediate rendering results of the angle area, a large number of real-time rendering calculations are avoided, and the rendering efficiency is improved.
在一些可能的设计中,该方法还包括:根据该目标角度区域的中间渲染结果和角度区域集的中间渲染结果,计算当前视平面中像素的渲染结果,其中,该像素对应的多个角度区域包括该目标角度区域以及该角度区域集,该角度区域集包括该模型上的至少一个角度区域。In some possible designs, the method further includes: calculating the rendering result of the pixel in the current viewing plane according to the intermediate rendering result of the target angle area and the intermediate rendering result of the angle area set, wherein the plurality of angle areas corresponding to the pixel It includes the target angle area and the set of angle areas, the set of angle areas includes at least one angle area on the model.
在计算一个像素的渲染结果时,基于中间渲染结果,确定每一通过该像素的光线的RGB值,有效地提升了计算每一像素的渲染结果的效率。When calculating the rendering result of a pixel, the RGB value of each light passing through the pixel is determined based on the intermediate rendering result, which effectively improves the efficiency of calculating the rendering result of each pixel.
在一些可能的设计中,该方法还包括:根据该目标角度区域的中间渲染结果和角度区域集的中间渲染结果,计算当前视平面中另一像素的渲染结果,其中,该另一像素对应的多个角度区域包括该目标角度区域以及该角度区域集,该角度区域集包括该模型上的至少一个角度区域。In some possible designs, the method further includes: calculating the rendering result of another pixel in the current viewing plane according to the intermediate rendering result of the target angle area and the intermediate rendering result of the angle area set, wherein the other pixel corresponds to A plurality of angular regions includes the target angular region and the set of angular regions includes at least one angular region on the model.
通过对目标角度区域的渲染结果进行预计算,可以为多个像素的渲染结果计算所复用,从而提升实时渲染的计算效率。By pre-computing the rendering result of the target angle area, it can be multiplexed for the calculation of rendering results of multiple pixels, thereby improving the computing efficiency of real-time rendering.
在一些可能的设计中,该方法还包括:对通过该目标空间缓存区域的该多根入射光线进行光线追踪渲染,获得该多根入射光线的预渲染结果;根据该多根入射光线的预渲染结果,计算该目标角度区域的中间渲染结果。In some possible designs, the method further includes: performing ray-tracing rendering on the multiple incident rays passing through the object space cache area, to obtain pre-rendering results of the multiple incident rays; As a result, an intermediate rendering result for the target angle region is calculated.
根据穿过目标空间缓存区域的多根入射光线的预渲染结果,确定出射光线的中间计算结果。避免了按照传统方法对于目标角度区域进行大量的光线追踪,并且同一空间缓存区域中多个目标角度区域均可共用入射光线的预渲染结果。因此,相比于传统的光线追踪,基于对预渲染结果的复用,在计算中间渲染结果时显著地提升了渲染效率。Determines the intermediate calculation results for outgoing rays based on the pre-rendered results of multiple incoming rays passing through the target space cache region. A large amount of ray tracing for the target angle area according to the traditional method is avoided, and multiple target angle areas in the same space cache area can share the pre-rendering result of the incident light. Therefore, compared with traditional ray tracing, based on the multiplexing of pre-rendering results, the rendering efficiency is significantly improved when calculating intermediate rendering results.
在一些可能的设计中,该方法还包括:将该的多根入射光线的预渲染结果进行加权求和,获得该目标角度区域的中间渲染结果。In some possible designs, the method further includes: performing weighted summation of the pre-rendering results of the multiple incident rays to obtain an intermediate rendering result of the target angle area.
根据穿过目标空间缓存区域的多根入射光线的预渲染结果,基于加权求和的方式确定出射光线的中间计算结果。避免了按照传统方法对于目标角度区域进行大量的光线追踪,并且同一空间缓存区域中多个目标角度区域均可共用入射光线的预渲染结果。因此,相比于传统的光线追踪,基于对预渲染结果的复用,在计算中间渲染结果时显著地提升了渲染效率。According to the pre-rendering results of multiple incident rays passing through the buffer area of the target space, the intermediate calculation result of the outgoing rays is determined based on a weighted summation. A large amount of ray tracing for the target angle area according to the traditional method is avoided, and multiple target angle areas in the same space cache area can share the pre-rendering result of the incident light. Therefore, compared with traditional ray tracing, based on the multiplexing of pre-rendering results, the rendering efficiency is significantly improved when calculating intermediate rendering results.
在一些可能的设计中,该目标空间缓存区域为半球形,每一入射光线由该目标空间缓存区域的球心发出并指向该目标空间缓存区域。In some possible designs, the object space buffer area is hemispherical, and each incident ray is emitted from the center of the object space buffer area and points to the object space buffer area.
将目标空间缓存区域近似为球形或半球形后,将球心作为虚拟视点,实现了空间缓存区域的预计算,因为光线的发射角度是由球心指向空间缓存区域,可以更方便地用于计算出射光线的中间渲染结果。After the target space cache area is approximated as a sphere or hemisphere, the center of the sphere is used as a virtual viewpoint to realize the precalculation of the space cache area, because the emission angle of the light is from the center of the sphere to the space cache area, which can be more conveniently used for calculation Intermediate rendering results for outgoing rays.
在一些可能的设计中,该方法还包括:存储该中间渲染结果。在进行实时的光线追踪渲染时,当前帧以及后续帧的实时渲染结果可以从存储的中间渲染结果中获取需要的渲染结果。其中,同一空间缓存区域的中间渲染结果可以被多次的复用,有效地提升实现渲染中针对存在中间渲染结果的空间缓存区域的渲染效率。In some possible designs, the method further includes: storing the intermediate rendering result. When performing real-time ray tracing rendering, the real-time rendering results of the current frame and subsequent frames can obtain the required rendering results from the stored intermediate rendering results. Among them, the intermediate rendering results of the same spatial cache area can be reused multiple times, effectively improving the rendering efficiency for the spatial cache area with intermediate rendering results in rendering.
本申请的第二方面提供了一种渲染引擎,该系统包括处理单元:该处理单元,用于在渲染应用的当前帧的过程中,将出射光线与模型的交点所在的角度区域确定为目标角度区域;获取在渲染该当前帧之前预先计算的该目标角度区域的中间渲染结果,该目标角度区域的中间渲染结果是根据通过该目标角度区域所在的目标空间缓存区域的多根入射光线的预渲染结果确定的;根据该目标角度区域的中间渲染结果,计算当前视平面中像素的渲染结果。The second aspect of the present application provides a rendering engine. The system includes a processing unit: the processing unit is configured to determine the angle area where the intersection point of the outgoing ray and the model is located as the target angle during the process of rendering the current frame of the application Area; obtain the intermediate rendering result of the target angle area pre-calculated before rendering the current frame. The intermediate rendering result of the target angle area is pre-rendered according to multiple incident rays passing through the target space cache area where the target angle area is located The result is determined; calculate the rendering result of the pixels in the current viewing plane according to the intermediate rendering result of the target angle area.
在一些可能的设计中,该处理单元还用于,根据该目标角度区域的中间渲染结果和像素与角度区域的对应关系,计算像素的渲染结果。通过建立角度区域与像素的对应关系,在确定角度区域的中间渲染结果后,可以确定像素的渲染结果。通过获取角度区域的中间渲染结果,避免了进行大量的实时渲染计算,提升了渲染的效率。In some possible designs, the processing unit is further configured to calculate a pixel rendering result according to the intermediate rendering result of the target angle area and the corresponding relationship between the pixel and the angle area. By establishing the corresponding relationship between the angle area and the pixel, after the intermediate rendering result of the angle area is determined, the rendering result of the pixel can be determined. By obtaining the intermediate rendering results of the angle area, a large number of real-time rendering calculations are avoided, and the rendering efficiency is improved.
在一些可能的设计中,该处理单元还用于,根据该目标角度区域的中间渲染结果和角度区域集的中间渲染结果,计算当前视平面中像素的渲染结果,其中,该像素对应的多个角度区域包括该目标角度区域以及该角度区域集,该角度区域集包括该模型上的至少一个角度区域。In some possible designs, the processing unit is further configured to calculate the rendering result of the pixel in the current viewing plane according to the intermediate rendering result of the target angle area and the intermediate rendering result of the angle area set, wherein the pixel corresponds to a plurality of The angle area includes the target angle area and the set of angle areas, and the set of angle areas includes at least one angle area on the model.
在一些可能的设计中,该处理单元还用于,根据该目标角度区域的中间渲染结果和角度区域集的中间渲染结果,计算当前视平面中另一像素的渲染结果,其中,该另一像素对应的多个角度区域包括该目标角度区域以及该角度区域集,该角度区域集包括该模型上的至少一个角度区域。In some possible designs, the processing unit is further configured to calculate the rendering result of another pixel in the current viewing plane according to the intermediate rendering result of the target angle area and the intermediate rendering result of the angle area set, wherein the other pixel The corresponding plurality of angle areas include the target angle area and the set of angle areas, and the set of angle areas includes at least one angle area on the model.
在一些可能的设计中,该处理单元还用于,对通过该目标空间缓存区域的该多根入射光线进行光线追踪渲染,获得该多根入射光线的预渲染结果;根据该多根入射光线的预渲染结果,计算该目标角度区域的中间渲染结果。In some possible designs, the processing unit is also used to perform ray-tracing rendering on the multiple incident rays passing through the target space buffer area, to obtain pre-rendering results of the multiple incident rays; Pre-rendering result, calculate the intermediate rendering result of the target angle area.
在一些可能的设计中,该处理单元还用于,将该的多根入射光线的预渲染结果进行加权求和,获得该目标角度区域的中间渲染结果。In some possible designs, the processing unit is further configured to perform weighted summation of the pre-rendering results of the multiple incident rays to obtain an intermediate rendering result of the target angle area.
在一些可能的设计中,目标空间缓存区域为半球形,每一入射光线由该目标空间缓存区域的球心发出并指向该目标空间缓存区域。In some possible designs, the object space buffer area is hemispherical, and each incident ray is emitted from the center of the object space buffer area and points to the object space buffer area.
在一些可能的设计中,存储单元,用于存储该中间渲染结果。In some possible designs, the storage unit is used to store the intermediate rendering result.
本申请的第三方面提供了一种计算设备集群,包括至少一个计算设备,每个计算设备包括处理器和存储器;至少一个计算设备的处理器用于执行至少一个计算设备的存储器中存储的指令,以使得该计算设备执行如第一方面提供的方法。A third aspect of the present application provides a cluster of computing devices, including at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, So that the computing device executes the method provided in the first aspect.
本申请的第四方面提供了一种包含指令的计算机程序产品,当该指令被计算机设备集群运行时,使得该计算机设备集群执行如第一方面提供的方法。A fourth aspect of the present application provides a computer program product containing instructions, when the instruction is executed by a cluster of computer equipment, the cluster of computer equipment executes the method as provided in the first aspect.
本申请的第五方面提供了一种计算机可读存储介质,包括计算机程序指令,当该计算机程序指令由计算设备集群执行时,该计算设备集群执行如第一方面提供的方法。A fifth aspect of the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a cluster of computing devices, the cluster of computing devices executes the method as provided in the first aspect.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方法,下面将对实施例中所需使用的附图作以简单地介绍。In order to more clearly illustrate the technical methods of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments.
图1为本申请实施例提供的一种空间缓存区域与虚拟视点的示意图;FIG. 1 is a schematic diagram of a spatial buffer area and a virtual viewpoint provided by an embodiment of the present application;
图2为本申请实施例提供的一种角度分辨率的示意图;FIG. 2 is a schematic diagram of an angular resolution provided by an embodiment of the present application;
图3为本申请实施例提供的一种三维模型角度区域的示意图;FIG. 3 is a schematic diagram of a three-dimensional model angle area provided by an embodiment of the present application;
图4为本申请实施例提供的又一种三维模型角度区域的示意图;Fig. 4 is a schematic diagram of another three-dimensional model angle area provided by the embodiment of the present application;
图5为本申请实施例提供的一种渲染方法的流程图;FIG. 5 is a flowchart of a rendering method provided by an embodiment of the present application;
图6为本申请实施例提供的一种入射光的示意图;FIG. 6 is a schematic diagram of an incident light provided by an embodiment of the present application;
图7为本申请实施例提供的一种出射光的示意图;FIG. 7 is a schematic diagram of an outgoing light provided by an embodiment of the present application;
图8为本申请实施例提供的一种渲染引擎的结构示意图;FIG. 8 is a schematic structural diagram of a rendering engine provided by an embodiment of the present application;
图9为本申请实施例提供的一种计算设备的结构示意图;FIG. 9 is a schematic structural diagram of a computing device provided by an embodiment of the present application;
图10为本申请实施例提供的一种计算设备集群的结构示意图;FIG. 10 is a schematic structural diagram of a computing device cluster provided by an embodiment of the present application;
图11为本申请实施例提供的一种计算设备集群的连接方式示意图;FIG. 11 is a schematic diagram of a connection mode of a computing device cluster provided by an embodiment of the present application;
图12为本申请实施例提供的一种计算设备集群的连接方式示意图。FIG. 12 is a schematic diagram of a connection manner of a computing device cluster provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图对本申请实施例进行描述。In order to make the purpose, technical solution and advantages of the present application clearer, the following will describe the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application.
本申请的说明书、权利要求书及附图中的术语“第一”和“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备等,没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元等,或可选地还包括对于这些过程、方法、产品或设备等固有的其它步骤或单元。The terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally It also includes other steps or units inherent to these processes, methods, products, or devices.
在本文中提及的“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员可以显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It will be understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上,“至少两个(项)”是指两个或三个及三个以上,“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in this application, "at least one (item)" means one or more, "multiple" means two or more, and "at least two (items)" means two or three And three or more, "and/or", is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, "A and/or B" can mean: only A exists, only B exists, and A exists at the same time and B, where A and B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one item (piece) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c ", where a, b, c can be single or multiple.
本申请提供了一种渲染方法,为了更清楚地描述本申请的方案,下面先介绍一些与渲染相关的知识。This application provides a rendering method. In order to describe the solution of this application more clearly, some knowledge related to rendering will be introduced below.
空间缓存区域(space cache area):空间缓存区域是指二维或者三维空间中最小的平面构成单元。通常在渲染中,可以基于面片的重心点、纹理/贴图空间的像素点或者点云中的任意一种构建空间缓存区域。例如,以面片的重心点为球心,可以建立一个球形/半球形的空间缓存区域,所述空间缓存区域用于缓存渲染数据。Space cache area (space cache area): The space cache area refers to the smallest plane constituent unit in two-dimensional or three-dimensional space. Usually in rendering, a spatial cache area can be constructed based on any one of the barycenter point of the patch, the pixel point of the texture/texture space, or the point cloud. For example, with the center of gravity of the patch as the center of the sphere, a spherical/hemispherical spatial cache area may be established, and the spatial cache area is used for caching rendering data.
角度区域(angle area):角度区域是指二维或三维空间中进行缓存的最小单位。通常在渲染中,对于空间缓存区域可以按照与坐标轴的夹角,将其表面划分成多个角度区域。这些角度区域可以是任意多边形,常用的是四边形。这些角度区域各条边的交点则是各个角度区域的顶点。Angle area (angle area): The angle area refers to the smallest unit for caching in a two-dimensional or three-dimensional space. Usually in rendering, the surface of the space cache area can be divided into multiple angle areas according to the included angle with the coordinate axis. These angular areas can be any polygon, quadrilaterals are commonly used. The intersection point of each side of these angle areas is the vertex of each angle area.
每角度区域追踪光线数(sample per angle area,SPAA):每角度区域追踪光线数是指每一个角度区域中通过的光线数量。其中,角度区域是在二维或三维空间中的最小单元。通常我们看到的屏幕是由一个个的像素排列而成的,每一个像素可以对应空间中的一个或多个角度区域。像素的颜色是根据其对应角度区域的颜色(red,green,blue,RGB)计算得到的。在光线追踪中,每角度区域追踪光线数的大小可以影响渲染的结果。每角度区域追踪光线数越大,意味着从视点会有更多的光线投向三维空间中的模型。每一角度区域上被投射的光线数越多,各个角度区域的渲染结果计算就可以更为准确。The number of rays traced per angle area (sample per angle area, SPAA): the number of rays traced per angle area refers to the number of rays passing through each angle area. Among them, the angle region is the smallest unit in two-dimensional or three-dimensional space. Usually the screen we see is made up of pixels arranged one by one, and each pixel can correspond to one or more angular areas in space. The color of a pixel is calculated based on the color (red, green, blue, RGB) of its corresponding angular region. In ray tracing, the number of rays traced per angular area can affect the rendering result. The higher the number of rays traced per angle area, the more rays will be cast from the viewpoint to the model in 3D space. The more rays are cast on each angle area, the more accurate the calculation of the rendering result of each angle area can be.
光线追踪(ray tracing):光线追踪又称为光迹跟踪或光线追迹,来自于几何光学的一项通用技术,它通过跟踪与光学表面发生交互作用的光线从而得到光线经过路径的模型。它用于光学系统设计,如照相机镜头、显微镜、望远镜以及双目镜等。当用于渲染时,跟踪从眼睛发出的光线而不是光源发出的光线,通过这样一项技术生成编排好的场景的数学模型显现出来。这样得到的结果类似于光线投射与扫描线渲染方法的结果,但是这种方法有更好的光学效果。例如对于反射与透射有更准确的模拟效果,并且效率非常高,所以当追求这样高质量结果时候经常使用这种方法。具体地,光线追踪方法首先计算一条光线在被介质吸收,或者改变方向前,光线在介质中传播的距离、方向以及到达的新位置。然后从这个新的位置产生出一条新的光线,使用同样的处理方法,最终计算出一个完整的光线在介质中传播的路径。由于该算法是成像系统的完全模拟,所以可以模拟生成复杂的图片。Ray tracing (ray tracing): Ray tracing, also known as ray tracing or ray tracing, is a general technique from geometric optics, which obtains a model of the path of light by tracing the rays that interact with optical surfaces. It is used in the design of optical systems such as camera lenses, microscopes, telescopes, and binoculars. When used for rendering, the mathematical model of the choreographed scene emerges through a technique that traces the rays emanating from the eye rather than from the light source. The results obtained are similar to those of ray casting and scanline rendering methods, but this method has better optical effects. For example, reflection and transmission have more accurate simulation effects, and the efficiency is very high, so this method is often used when pursuing such high-quality results. Specifically, the ray tracing method first calculates the distance, direction, and new position that a ray travels in a medium before it is absorbed by the medium or changes direction. Then a new ray is generated from this new position, and the same processing method is used to finally calculate a complete path of the ray in the medium. Since the algorithm is a complete simulation of the imaging system, complex pictures can be simulated.
材质:空间中模型的材质按照折反射情况可以分为透射材质、镜面反射材质和漫反射材质。其中,透射材质是指会发生透射的材质,例如水珠、水晶等;镜面反射材质则是指发生规律的全反射的材质,例如镜面、光滑的金属表面等;而漫反射材质则是指发生不规律的反射的材质,例如粗糙的石头和桌面等。空间中包括多个空间缓存区域,而每一空间缓存区域中包括多个角度区域。通常认为,一个空间缓存区域的对应一种,因此同一空间缓存区域包括的每一角度区域也对应同一种材质。Material: The material of the model in the space can be divided into transmission material, specular reflection material and diffuse reflection material according to the refraction and reflection conditions. Among them, the transmission material refers to the material that will transmit, such as water drops, crystals, etc.; the specular reflection material refers to the material that undergoes regular total reflection, such as a mirror surface, smooth metal surface, etc.; and the diffuse reflection material refers to the material that occurs Irregularly reflective materials, such as rough stones and table tops. The space includes multiple spatial buffer areas, and each spatial buffer area includes multiple angle areas. It is generally believed that one spatial buffer area corresponds to one material, so each angle area included in the same spatial buffer area also corresponds to the same material.
传统的光线追踪技术需要对三维空间中大量的光线进行海量的实时计算,这对执行计算的硬件(如中央处理器(central processing unit,CPU)或者GPU(Graphicsprocessing unit,GPU))的计算能力有着很高的要求。通常来说高质量地完成一帧画面的计算需要花费数小时,甚至数天。换言之,难以在保证画面质量的同时保证计算效率。Traditional ray tracing technology needs to perform massive real-time calculations on a large number of rays in a three-dimensional space, which has an impact on the computing power of the hardware (such as a central processing unit (CPU) or GPU (Graphics processing unit, GPU)) that performs calculations. Very demanding. Generally speaking, it takes hours or even days to complete the calculation of a frame with high quality. In other words, it is difficult to ensure computational efficiency while maintaining image quality.
因此,为了解决这一问题,本发明提出一种渲染方法。该方法可以在保证较高的画面质量的同时,大幅度的提升计算效率。Therefore, in order to solve this problem, the present invention proposes a rendering method. This method can greatly improve computing efficiency while ensuring high picture quality.
具体的,对于空间中角度区域的RGB值进行预计算,并且将预计算的结果以角度区域为单位缓存下来。前述预计算的操作发生在实时计算之前,因此在进行实时计算时,按照光线追踪的方法确定(追踪到)了像素点对应的角度区域后,可以在不对角度区域的RGB值进行实时计算的情况下,直接从缓存数据中获取相应角度区域的RGB值。进一步地,根据角度区域的RGB值以及角度区域与像素点的对应关系,可以快速地获得像素点的RGB值,从而完成渲染的操作。Specifically, pre-computation is performed on the RGB values of the angle area in the space, and the pre-calculation result is cached in units of the angle area. The aforementioned pre-computation operation occurs before real-time calculation, so when performing real-time calculation, after determining (tracking) the angle area corresponding to the pixel point according to the method of ray tracing, the RGB value of the angle area can not be calculated in real time. Next, directly obtain the RGB value of the corresponding angle area from the cached data. Further, according to the RGB value of the angle area and the corresponding relationship between the angle area and the pixel point, the RGB value of the pixel point can be quickly obtained, so as to complete the rendering operation.
接下来以图1为例,介绍一下空间中角度区域以及虚拟视点等概念,以及它们之间的关系。Next, take Figure 1 as an example to introduce concepts such as angular regions and virtual viewpoints in space, and the relationship between them.
如图1所示,空间中至少包括模型100、虚拟视点102、虚拟视平面104以及光源106。其中,模型100的外表面被划分为多个区域,图1示出了其中一个面的划分情况。如图1所示,模型100的一个外表面被划分成了6个大小不一的区域。需要说明的是,各区域的大小可以相同,也可以不同。通常来说,这些区域都是非常微小的,又可以称为空间缓存区域。如前所述,每一空间缓存区域对应一种材质。进一步地,在确定了空间缓存区域后,可按照角度将所述空间缓存区域的表面划分为多个角度区域。关于如何进行划分将在下文中进行介绍。As shown in FIG. 1 , the space includes at least a
虚拟视点102是用于在虚拟的三维空间中模拟人眼的存在,用于感知三维结构。在一些可能的实现方式中,虚拟十点102可以是双目视点。具体地,双目视点或多目视点是指从两个及两个以上的不同的视点获取两幅或多幅图像来重构目标模型3D结构或深度信息。The
虚拟视平面104是用于在虚拟的三维空间中模拟显示屏的存在。如显示屏一样,虚拟视平面104被划分成多个像素点。如图1所示,虚拟视平面104中包括至少9个像素点。每一像素点与空间中模型包含的空间缓存区域存在一定的对应关系。也即,每一像素点与空间中模型包含的角度区域也存在一定的对应关系。进一步地,通过计算角度区域的RGB值可以确定每一像素点的RGB值。The
可以看到,穿过图1中示出的加黑框的像素点(虚拟视平面104中正中间的像素点)的三根第一光线在第一次接触到模型100时,命中了两个空间缓存区域。也即,该像素点至少对应这两个命中的空间缓存区域。换言之,这两个空间缓存区域的RGB可以用于计算这一像素点的RGB值。It can be seen that the three first rays passing through the black framed pixel shown in FIG. 1 (the pixel in the middle of the virtual viewing plane 104 ) hit the two spatial buffers when they first touch the
需要说明的是,同一空间缓存区域可以对应多个像素点,而一个像素点也可以对应多个空间缓存区域。It should be noted that the same spatial buffer area may correspond to multiple pixel points, and one pixel point may also correspond to multiple spatial buffer areas.
在确定了虚拟视平面104中每一像素点的RGB值后,即可获得一帧渲染结果。也即,每进行一次光线追踪,即可获得一帧渲染结果。After the RGB value of each pixel in the
反向光线追踪方法属于光线追踪方法中的一种。空间中的模型能被看见是因为其表面折/反射了来自光源的光线并且进入眼睛(虚拟视点102)。传统的光线追踪需要对于大量未能进入眼睛(虚拟视点102)的光线进行追踪计算,因此大量的计算是没有意义的。而反向光线追踪则是假设光线从眼睛(虚拟视点102)处发出,在接触到模型之后回到光源。通过这一方法,尽量保证计算的都是有效光线,从而提升了光线追踪的计算效率。The reverse ray tracing method is one of the ray tracing methods. The model in space can be seen because its surfaces refract/reflect light from the light source and enter the eye (virtual viewpoint 102). Traditional ray tracing requires tracing calculations for a large number of rays that fail to enter the eye (virtual viewpoint 102 ), so a large number of calculations is meaningless. In reverse ray tracing, it is assumed that light rays are emitted from the eye (virtual viewpoint 102), and return to the light source after touching the model. Through this method, try to ensure that all calculations are effective rays, thereby improving the calculation efficiency of ray tracing.
例如,从虚拟视点102中发出多根第一光线,在穿过虚拟视平面104中的某一个像素点后,确定第一次接触到的模型(如模型100),以及接触点所在的空间缓存区域(或角度区域)。根据模型的材质,继续进行光线的追踪,直到追踪到光源106处,或者达到最大的追踪次数。其中,光源106可以是下列光源中的一种或多种:点光源、线光源或者面光源等。For example, a plurality of first rays are emitted from the
根据光源的参数、模型的参数和入射的角度等,可以确定每一第一光线的RGB值。进一步地,可以根据经过同一像素点的第一光线的RGB值确定该像素点的RGB值。以此类推,可以获得整个虚拟视平面104中每一像素点的RGB值,进而获得一帧渲染结果。According to the parameters of the light source, the parameters of the model, the angle of incidence, etc., the RGB value of each first ray can be determined. Further, the RGB value of the pixel point may be determined according to the RGB value of the first ray passing through the same pixel point. By analogy, the RGB value of each pixel in the entire
可选的,也可以根据同一空间缓存区域接触的第一光线的RGB值确定该空间缓存区域的RGB值,还可以根据同一角度区域接触的第一光线的RGB值确定该角度区域的RGB值。Optionally, the RGB value of the spatial buffer area may also be determined according to the RGB value of the first ray contacted by the same spatial buffer area, and the RGB value of the angular area may also be determined according to the RGB value of the first ray contacted by the same angular area.
具体地,在确定了所述多根第一光线的RGB值后,可以根据同一空间缓存区域上的多条追踪光线的RGB确定该空间缓存区域的RGB值。可选的,可以是通过求取均值的方式获得。Specifically, after the RGB values of the multiple first rays are determined, the RGB values of the spatial buffer area may be determined according to the RGB values of multiple tracing rays on the same spatial buffer area. Optionally, it can be obtained by calculating the mean value.
同理,在确定了所述多根第一光线的RGB值后,也可以根据同一角度区域上的多条追踪光线的RGB确定该角度区域的RGB值。Similarly, after the RGB values of the plurality of first rays are determined, the RGB values of the angle area may also be determined according to the RGB values of multiple tracing rays on the same angle area.
接下来以图2为例,针对图1中的模型100中的空间缓存区域介绍一下角度分辨率的概念,并介绍空间缓存区域与角度区域之间的关系。Next, taking FIG. 2 as an example, the concept of angular resolution is introduced for the spatial buffer area in the
如图2所示,模型201表示一个“兔子”的3D模型,该3D模型的表面由多个空间缓存区域构成。接下来以该“兔子”模型中的一个空间缓存区域202为例进行介绍。如前所述,每一空间缓存区域对应一种材质,假设空间缓存区域202的材质为漫反射材质。As shown in FIG. 2 , the
空间缓存区域202表示模型201中的一个空间缓存区域(半球形)。在该半球上存储了以该半球心(空间缓存区域的球心)为虚拟视点,按照不同方向指向半球外的入射光的颜色。其中,球心为图1中的眼睛(虚拟视点102)。The
图2示出了若干从球心发出的入射光,传统的光线追踪中一个空间缓存区域中通过的入射光的光线数量越多,空间缓存区域的RGB的计算就越准确。而本申请提供的实施例中,每一角度区域中通过的入射光的光线数量SPAA越多,意味着从3D模型的虚拟视点会有更多的光线投向三维空间。每个角度区域上投射的光线数越多,其渲染结果的计算就更准确。Figure 2 shows several incident lights emitted from the center of the sphere. In traditional ray tracing, the more rays of incident light that pass through a spatial buffer area, the more accurate the RGB calculation of the spatial buffer area will be. However, in the embodiment provided by the present application, the more the number of incident light rays SPAA passing through each angle area, the more light rays will be projected into the three-dimensional space from the virtual viewpoint of the 3D model. The more rays cast on each angular area, the more accurate the calculation of its rendering result.
如前所述,按照角度可以将3D模型的表面分割成多个空间缓存区域。进一步地,可以根据角度将每一空间缓存区域划分为多个角度区域。下面将分别结合具体的实施例对角度区域的划分进行说明。As mentioned above, the surface of the 3D model can be divided into multiple spatial buffer regions according to the angle. Further, each spatial buffer area may be divided into multiple angle areas according to angles. The division of angle regions will be described below in conjunction with specific embodiments.
首先,角度分辨率指示的是一个空间缓存区域中包含角度区域的数量。以一个半球形的空间缓存区域为例,以1度为单位,可以将该半球形划分为360*90个角度区域。也即,该空间缓存区域的角度分辨率为360*90。First, the angular resolution indicates the number of angular regions contained in a spatial buffer region. Taking a hemispherical spatial buffer area as an example, the hemispherical shape can be divided into 360*90 angular areas with a unit of 1 degree. That is, the angular resolution of the spatial buffer area is 360*90.
请参阅图3,图3为本申请实施例提供的一种三维模型角度区域的效果示意图。Please refer to FIG. 3 . FIG. 3 is a schematic diagram of an effect of a three-dimensional model angle area provided by an embodiment of the present application.
如图3所示,以三维模型为球体为例,角度区域可以表示为中心点以及中心点邻域的点构成的球体表面上的四边略鼓的近似方块S0。以球体的球心O作为原点构建三维正交坐标系,其中,三维正交坐标系包括x轴,y轴以及z轴。中心点P的各个坐标中,r表示为球心O至中心点P的线段OP的长度,θ表示为线段OP与正z轴之间的夹角,φ表示为线段OP在xOy平面上的投影与x轴之间的夹角。在一些具体的实施例中,可以在球体上均匀地设置n个中心点P_1,P_2,…,P_n,如果非中心点Q_i与中心点P_i的距离最短,则非中心点Q_i与中心点P_i属于同一个角度区域。As shown in Figure 3, taking the 3D model as a sphere as an example, the angle area can be expressed as the center point and the center point An approximate square S0 with slightly bulging four sides on the surface of a sphere formed by the points in the neighborhood. A three-dimensional orthogonal coordinate system is constructed with the center O of the sphere as an origin, wherein the three-dimensional orthogonal coordinate system includes an x-axis, a y-axis and a z-axis. In each coordinate of the center point P, r represents the length of the line segment OP from the center O to the center point P, θ represents the angle between the line segment OP and the positive z-axis, and φ represents the projection of the line segment OP on the xOy plane Angle with the x-axis. In some specific embodiments, n center points P_1, P_2,..., P_n can be evenly set on the sphere. If the distance between the non-central point Q_i and the central point P_i is the shortest, then the non-central point Q_i and the central point P_i belong to same angle area.
基于上述三维模型角度区域的效果示意图可以看出,当三维正交坐标的划分标准越精细,以非中心点Q_i与中心点P_i构成的角度区域也越精细。因此,可以通过图3中的角度区域划分方法得到模型的多个角度区域。Based on the above schematic diagram of the effect of the angular area of the 3D model, it can be seen that when the division standard of the 3D orthogonal coordinates is finer, the angular area formed by the non-central point Q_i and the central point P_i is also finer. Therefore, multiple angular regions of the model can be obtained through the angular region division method in Fig. 3 .
请参阅图4,图4为本申请实施例提供的一种三维模型角度区域的效果示意图。Please refer to FIG. 4 . FIG. 4 is a schematic diagram of an effect of a three-dimensional model angle area provided by an embodiment of the present application.
如图4所示,以三维模型为曲面模型为例,角度区域可以表示为P(u,t)所代表的曲面表面上的方块。以曲面的一个设定原点构建二维正交坐标系,其中,坐标系包括u轴,t轴。u表示为曲面设定原点一个方向的偏移量,t表示另一个正交方向的偏移量,P(u,t)表示如图4所示的(u,t)坐标系中四个顶点所组成的方块。As shown in FIG. 4 , taking the three-dimensional model as a curved surface model as an example, the angular region can be expressed as a square on the curved surface represented by P(u,t). Construct a two-dimensional orthogonal coordinate system with a set origin of the surface, where the coordinate system includes u-axis and t-axis. u represents the offset in one direction for setting the origin of the surface, t represents the offset in the other orthogonal direction, and P(u,t) represents the four vertices in the (u,t) coordinate system as shown in Figure 4 composed of blocks.
同理,基于上述三维模型角度区域的效果示意图可以看出,当二维正交坐标的划分标准越精细,P(u,t)所表示的方块也越精细。因此,还可以通过图4中的角度区域划分方法得到模型的多个角度区域。Similarly, based on the above schematic diagram of the effect of the angular area of the 3D model, it can be seen that when the division standard of the 2D orthogonal coordinates is finer, the block represented by P(u,t) is also finer. Therefore, multiple angular regions of the model can also be obtained through the angular region division method in Fig. 4 .
可以理解的是,上述的角度区域的形状仅仅是作为具体的举例,在实际应用中,角度区域还可能是其他的形状,此处不作具体限定。另外,角度区域的尺寸可以根据需要进行设置,对渲染出的图像的精度要求越高的情况下,角度区域的尺寸可以设置得越小。It can be understood that the above-mentioned shape of the angle region is only used as a specific example, and in practical applications, the angle region may also have other shapes, which are not specifically limited here. In addition, the size of the angle area can be set as required, and the smaller the size of the angle area can be set when the higher the accuracy of the rendered image is required.
接下来介绍一种渲染方法100,图5示出了所述渲染方法的流程图。Next, a
S101:渲染系统200计算空间中各入射光的预渲染结果。S101: The rendering system 200 calculates a pre-rendering result of each incident light in a space.
在进行渲染之前,首先对于空间中各个模型的来源进行介绍。当前空间中的模型和参数均是由渲染应用生成的。可选地,可以根据渲染应用包含的参数和指令在模型库中对模型进行选择和组合后形成空间中的待渲染内容(空间中的各模型)。Before rendering, first introduce the source of each model in the space. The models and parameters in the current space are generated by the rendering application. Optionally, the models can be selected and combined in the model library according to the parameters and instructions included in the rendering application to form the content to be rendered in the space (models in the space).
接下来以空间中的一个空间缓存区域为例,介绍本申请实施例提供的渲染方法。Next, taking a spatial cache area in the space as an example, the rendering method provided by the embodiment of the present application is introduced.
图6示出了一个半球形的空间缓存区域,点o为该半球形的球心。入射光指示的是由o点发出,通过空间缓存区域的表面的光线。图6中示例性地示出了该空间缓存区域的部分入射光。FIG. 6 shows a hemispherical spatial buffer area, and point o is the center of the hemispheric shape. Incident light refers to the light emitted by point o and passing through the surface of the spatial buffer region. FIG. 6 exemplarily shows part of the incident light in the spatial buffer area.
在进行实时计算之前,可以在该空间缓存区域上模拟一定数量的入射光,以实现对于该空间缓存区域的预计算。此外,上述一定数量的入射光的分布情况也可以根据需要进行设置。Before performing real-time calculation, a certain amount of incident light can be simulated on the spatial cache area, so as to realize pre-computation for the spatial cache area. In addition, the distribution of the aforementioned certain amount of incident light may also be set as required.
例如,在进行预计算时,可以在一个空间缓存区域上模拟10000根入射光,并且这10000根入射光在整个半球体中呈均匀分布。需要注意的是,入射光的分布与角度分辨率无关。For example, when performing precomputation, 10,000 incident lights can be simulated on a spatial cache area, and the 10,000 incident lights are uniformly distributed throughout the hemisphere. It should be noted that the distribution of the incident light is independent of the angular resolution.
又例如,当所述空间缓存区域为球体时,入射光可以在整个球体中成均匀分布。For another example, when the spatial buffer area is a sphere, the incident light may be uniformly distributed throughout the sphere.
上述一定数量的入射光对应在空间缓存区域上的交点与o点的连线的长度r相同,而夹角θ、中至少有一个不相同。进一步地,根据设置的夹角的分布情况可以确定每一入射光对应的r、θ和从而实现入射光的模拟。The above-mentioned certain amount of incident light corresponds to the intersection point on the space buffer area and the length r of the line connecting point o is the same, and the included angle θ, At least one of them is different. Further, according to the distribution of the set angles, the corresponding r, θ and In this way, the simulation of incident light is realized.
在确定了入射光的分布情况后,可以按照光线追踪方法或反向光线追踪方法计算所述一定数量的入射光的预渲染结果(RGB值)。也即,对应于图1,图6中的点o为虚拟视点102,半球形的空间缓存区域则对应模型100中的某一个空间缓存区域。具体地,每一入射光的预渲染结果是根据空间中的光源、接触的空间缓存区域的材质、接触的空间缓存区域的接触角度等因素中的一个或多个确定的。After the distribution of the incident light is determined, the pre-rendering result (RGB value) of the certain amount of incident light may be calculated according to the ray tracing method or the reverse ray tracing method. That is, corresponding to FIG. 1 , the point o in FIG. 6 is the
以上是以一个空间缓存区域中的一根光线为例,介绍了如何计算入射光的预渲染结果的方法。依据此方法,可以进一步地计算出所述一定数量的入射光的预渲染结果,以及多个空间缓存区域对应的一定数量的入射光的预渲染结果。The above is an example of a ray in a spatial cache area, and introduces how to calculate the pre-rendered result of the incident light. According to this method, the pre-rendering results of the certain number of incident lights and the pre-rendering results of the certain number of incident lights corresponding to the plurality of spatial buffer areas can be further calculated.
S103:渲染系统200存储空间中各入射光的预渲染结果。S103: The rendering system 200 stores a pre-rendering result of each incident light in a space.
在S101中完成对于一定数量的入射光的预渲染结果的计算之后,需要将其存储起来。具体地,可以以交点为单位进行存储。其中,交点指示的是入射光与空间缓存区域的交点。After the calculation of the pre-rendering result for a certain amount of incident light is completed in S101, it needs to be stored. Specifically, storage may be performed in units of intersections. Wherein, the intersection point indicates the intersection point of the incident light and the spatial buffer area.
可选的,还可以是以二维夹角为单位进行存储。其中,二维夹角指示的是入射光的θ和这两个参数组成的二维数组 Optionally, storage may also be performed in units of two-dimensional included angles. Among them, the two-dimensional included angle indicates the θ and A two-dimensional array of these two parameters
需要说明的是,上述的存储操作是以一个空间缓存区域为例进行介绍的。依据此方法,可以进一步地对一定数量的入射光的预渲染结果,以及多个空间缓存区域对应的一定数量的入射光的预渲染结果进行存储。It should be noted that the above-mentioned storage operation is introduced using a spatial cache area as an example. According to this method, the pre-rendering results of a certain number of incident lights and the pre-rendering results of a certain number of incident lights corresponding to multiple spatial buffer areas can be further stored.
S105:渲染系统200计算空间中各出射光的RGB值。S105: The rendering system 200 calculates RGB values of each outgoing light in the space.
前述进行的预计算是不以角度区域为单位进行的,而是根据一定的分布规律在空间缓存区域对应的半球/球体中进行光线的模拟。也即,无论图6包括的角度区域有多少个,预计算时使用的入射光线的数量可以均为10000根。在确定了各空间缓存区域的入射光的预渲染结果后,可以进一步地获得各出射光的RGB值。The above-mentioned pre-prediction is not carried out in the unit of angle area, but simulates light in the hemisphere/sphere corresponding to the space buffer area according to a certain distribution rule. That is, no matter how many angle regions are included in FIG. 6 , the number of incident rays used in the pre-calculation may be 10,000. After the pre-rendering results of the incident light in each spatial buffer area are determined, RGB values of each outgoing light can be further obtained.
图7示例性的给出了一根出射光L1,该出射光由空间缓存区域外的区域指向球心o。出射光L1的方向正是在实时计算中进行反向光线追踪时光线的方向,因此只要在预计算过程中将L1的RGB值存储下来,未来在实时计算过程中对于出射方向与出射光L1一致的光线,将无需再次进行计算,可以直接获取存储的预计算的RGB值。FIG. 7 exemplarily shows an outgoing light L1, which is directed to the center o of the sphere from an area outside the spatial buffer area. The direction of the outgoing light L1 is exactly the direction of the ray during reverse ray tracing in the real-time calculation, so as long as the RGB value of L1 is stored in the pre-calculation process, the outgoing direction will be consistent with the outgoing light L1 in the real-time calculation process in the future The rays of light will not need to be calculated again, and the stored pre-calculated RGB values can be directly obtained.
但是考虑到一个空间缓存区域对应的光线数量可以是无数多根,因此考虑以角度区域为存储单元。当在实时计算过程中出射光落入了某一角度区域时,获取该角度区域的RGB值作为该入射光的RGB值。为了获取一个角度区域的RGB值,需要对该角度区域包含的多根出射光进行预计算。However, considering that the number of rays corresponding to a spatial cache area can be infinitely many, the angle area is considered as the storage unit. When the outgoing light falls into a certain angle area during the real-time calculation, the RGB value of the angle area is obtained as the RGB value of the incident light. In order to obtain the RGB value of an angle area, it is necessary to pre-calculate the multiple outgoing lights contained in the angle area.
以出射光L1所在的角度区域S1为例。首先,对出射光L1的RGB值进行计算。出射光L1在接触到o点后,可能发生镜面反射、透射或者漫反射。基于以上三种反/透射的原理,出射光L1的RGB值可以根据在S101中获取的一定数量的入射光的预渲染结果进行加权获得,具体的获得方法如下所述。Take the angle region S1 where the outgoing light L1 is located as an example. First, the RGB values of the emitted light L1 are calculated. After the outgoing light L1 touches the point o, specular reflection, transmission or diffuse reflection may occur. Based on the above three principles of reflection/transmission, the RGB value of the outgoing light L1 can be obtained by weighting according to the pre-rendering results of a certain amount of incident light obtained in S101, and the specific obtaining method is as follows.
需要说明的是,图7示出的是该空间缓存区域的材质为漫反射材质的情况。当所述空间缓存区域的材质为透透射材质时,所述空间缓存区域应为一个完整的球体。It should be noted that what is shown in FIG. 7 is a case where the material of the spatial buffer area is a diffuse reflection material. When the material of the spatial buffer area is a transparent material, the spatial buffer area should be a complete sphere.
以图7中的空间缓存区域的材质为漫反射材质为例,在确定了出射光L1之后,基于双向反射分布函数(bidirectional reflectance distribution function,BRDF)方法可以获得与之相对的漫反射后的光线的RGB值。具体地,该RGB值可以通过将S101中计算的各入射光的RGB值乘以一个权值矩阵获得。其中,权值矩阵是根据BRDF方法获得的。Taking the material of the space cache area in Figure 7 as an example of a diffuse reflection material, after determining the outgoing light L1, based on the bidirectional reflection distribution function (bidirectional reflection distribution function, BRDF) method, the corresponding light after diffuse reflection can be obtained RGB value. Specifically, the RGB value can be obtained by multiplying the RGB value of each incident light calculated in S101 by a weight matrix. Among them, the weight matrix is obtained according to the BRDF method.
可选的,权值矩阵的获得方法还可以是随机生成或者基于人工智能算法生成。Optionally, the method for obtaining the weight matrix may also be randomly generated or generated based on an artificial intelligence algorithm.
可选的,由于漫反射材质的特点是反射后的光线与法线方向的夹角与入射角度无关,因此任意角度的入射光线在计算出射光的RGB值时的贡献可近似认为相同。进一步地,任意角度的入射光线对应的权值也近似认为相同。应理解,本发明不对此处权值的计算方法进行限定。Optionally, since the characteristic of the diffuse reflection material is that the angle between the reflected light and the normal direction has nothing to do with the incident angle, the contribution of incident light at any angle to the calculation of the RGB value of the outgoing light can be considered approximately the same. Furthermore, the weights corresponding to the incident rays at any angle are also approximately considered to be the same. It should be understood that the present invention does not limit the calculation method of the weight here.
以图7中的空间缓存区域的材质为镜面反射为例,在确定了出射光L1的出射角度之后,可以基于BRDF方法获得出射光L1对应的镜面反射的光线的RGB值。Taking the material of the spatial buffer area in FIG. 7 as specular reflection as an example, after determining the outgoing angle of the outgoing light L1, the RGB value of the specularly reflected light corresponding to the outgoing light L1 can be obtained based on the BRDF method.
可选的,在这一可能的实现方式中,权值矩阵的获得方法也可以是随机生成或者基于人工智能算法生成。Optionally, in this possible implementation manner, the method for obtaining the weight matrix may also be randomly generated or generated based on an artificial intelligence algorithm.
以图7中的空间缓存区域的材质为透射为例,在确定了出射光L1的出射角度之后,可以基于双向散射分布函数(bidirectional scattering distribution function,BSDF)方法获得出射光L1的RGB值。Taking the material of the spatial buffer area in FIG. 7 as transmission as an example, after determining the outgoing angle of the outgoing light L1, the RGB value of the outgoing light L1 can be obtained based on a bidirectional scattering distribution function (BSDF) method.
需要说明的是,上述模拟入射光的方法可以是直接根据相对于球心o的两个夹角来确定,无需从空间缓存区域以外发射一根入射光。在这一实现方式中,无需执行求交计算。其中,求交计算指示对入射光与空间缓存区域的交点进行计算。通过以角度为单位对中间渲染结果进行存储,有效地避免了进行求交计算,可以进一步地减少计算量,提升预计算的效率。It should be noted that the above method of simulating the incident light can be directly determined according to the two included angles relative to the center o of the sphere, without emitting an incident light from outside the spatial buffer area. In this implementation, no intersection calculations need to be performed. Wherein, the intersection calculation indicates to calculate the intersection point of the incident light and the spatial buffer area. By storing the intermediate rendering result in the unit of angle, the intersection calculation is effectively avoided, which can further reduce the amount of calculation and improve the efficiency of pre-computation.
S107:渲染系统200计算空间中各空间缓存区域的各角度区域的中间渲染结果。S107: The rendering system 200 calculates an intermediate rendering result of each angle area of each space cache area in the space.
在确定了一根出射光的中间渲染结果后,可以依据相同的方法获取同一角度区域中其他出射光的中间渲染结果。After the intermediate rendering result of one outgoing light is determined, the intermediate rendering results of other outgoing lights in the same angle area can be obtained according to the same method.
进一步地,通过求取同一角度区域中多根出射光的中间渲染结果的均值,可以获得该角度区域的中间渲染结果。其中,所述求取平均值的方法可以是算术平均值法,也可以是加权平均值法。Further, the intermediate rendering result of the angle area can be obtained by calculating the average value of the intermediate rendering results of multiple outgoing lights in the same angle area. Wherein, the method for calculating the average value may be an arithmetic average method or a weighted average method.
可选的,在计算各角度区域的中间渲染结果时,对于漫反射材质的角度区域,可以根据一根出射光的中间渲染结果直接确认该角度区域的中间渲染结果。这是因为对于漫反射材质而言,入射角度不影响渲染结果的计算,因此可以近似地认为漫反射材质的角度区域的中间渲染结果等于穿过该角度区域的一根出射光线的中间渲染结果。可选地,也可以近似地认为漫反射材质的空间缓存区域的中间渲染结果等于穿过该空间缓存区域的一根出射光线的中间渲染结果。也即,该空间缓存区域的角度分辨率为1。Optionally, when calculating the intermediate rendering result of each angle area, for the angle area of the diffuse reflection material, the intermediate rendering result of the angle area can be directly confirmed according to the intermediate rendering result of an outgoing light. This is because for diffuse reflection materials, the angle of incidence does not affect the calculation of the rendering result, so it can be approximately considered that the intermediate rendering result of the angle area of the diffuse reflection material is equal to the intermediate rendering result of an outgoing ray passing through the angle area. Optionally, it can also be considered approximately that the intermediate rendering result of the spatial buffer area of the diffuse reflection material is equal to the intermediate rendering result of an outgoing ray passing through the spatial buffer area. That is, the angular resolution of the spatial buffer area is 1.
以上介绍了如何计算一个空间缓存区域上的一个角度区域的中间渲染结果的方法。依据此方法,可以进一步地获取空间中所有空间缓存区域的各个角度区域的中间渲染结果。The above describes how to calculate the intermediate rendering result of an angle area on a space buffer area. According to this method, intermediate rendering results of all angle areas of all space cache areas in the space can be further obtained.
S109:渲染系统200存储空间中各空间缓存区域的各角度区域的中间渲染结果。S109: The rendering system 200 stores intermediate rendering results of each angle area in each space cache area in the space.
对于计算获得的空间中各空间缓存区域上各角度区域的中间渲染结果,可以以各角度区域所在空间缓存区域的位置为单位进行存储。The calculated intermediate rendering results of each angle area on each space cache area in the space may be stored in units of the position of the space cache area where each angle area is located.
可选的,也可以以角度区域的顶点对应的二维数组为单位进行存储。Optionally, it can also be a two-dimensional array corresponding to the vertices of the angle area Store as a unit.
S111:渲染系统200获取实时计算中出射光的实时渲染结果。S111: The rendering system 200 acquires a real-time rendering result of outgoing light in real-time calculation.
S101至S109对于空间中空间缓存区域的RGB值进行了预计算和存储,因此在实时光线追踪的过程中,可以根据预计算获得的中间渲染结果确定实时渲染结果。S101 to S109 pre-calculate and store the RGB values of the space cache area in the space, so in the process of real-time ray tracing, the real-time rendering result can be determined according to the intermediate rendering result obtained by pre-calculation.
当空间中的光源、模型位置等要素不发生变化时,可以认为预计算获得的空间缓存区域的中间渲染结果就是实时光线追踪中出射光的渲染结果。When elements such as light sources and model positions in the space do not change, it can be considered that the intermediate rendering result of the space cache area obtained by precomputation is the rendering result of the outgoing light in real-time ray tracing.
需要说明的是,步骤S111可以认为是对某一帧(当前帧)渲染结果的计算,而上述的步骤S101至S109的发生时间先于该帧。可选的,步骤S101至S109的发生时间可以先于该空间中第一帧的渲染结果计算时间。It should be noted that step S111 can be regarded as the calculation of the rendering result of a certain frame (current frame), and the above-mentioned steps S101 to S109 occur before this frame. Optionally, the occurrence time of steps S101 to S109 may be earlier than the calculation time of the rendering result of the first frame in the space.
上述方法以空间中空间缓存区域上的角度区域为单位,对各角度区域的渲染结果进行预计算并储存。相比于实时光线追踪的计算,上述方法通过将大量的中间渲染结果求取的计算放在实时计算之前,大幅度地减少了实时光线追踪的计算量,有效地提升了实时光线追踪的计算效率。The above method precalculates and stores the rendering results of each angle area by taking the angle area on the spatial cache area as a unit in the space. Compared with the calculation of real-time ray tracing, the above method greatly reduces the calculation amount of real-time ray tracing by placing the calculation of a large number of intermediate rendering results before real-time calculation, and effectively improves the calculation efficiency of real-time ray tracing. .
接下来以一个空间缓存区域为例,介绍本实施例提供的渲染方法所需的计算量相比于传统的的光线追踪所需的计算量的区别。Next, taking a spatial cache area as an example, the difference between the calculation amount required by the rendering method provided by this embodiment and the calculation amount required by traditional ray tracing is introduced.
以图2中的“兔子”的3D模型中的一个空间缓存区域为例。所述空间缓存区域为半球形的情况下,在传统的实时光线追踪中,需要基于角度分辨率对每一个角度区域进行一定数量的采样。其中,每一次采样都需要光线进行求交、计算透/反射。可选的,所述透/反射的次数可以为多次。Take a spatial cache area in the 3D model of the "rabbit" in Figure 2 as an example. In the case where the spatial buffer area is hemispherical, in traditional real-time ray tracing, it is necessary to perform a certain number of samples for each angular area based on the angular resolution. Among them, each sampling requires rays to intersect and calculate transmission/reflection. Optionally, the times of the transmission/reflection may be several times.
以角度分辨率为360*90、每一角度区域采样数为10000、求交计算量为A、一次透/反射计算量为B,透/反射次数为n为例,实时光线追踪在对一个空间缓存区域进行计算时,所需的实时的计算量M1为:360*90*10000*(A+nB)。其中,n为大于等于1的正整数。Taking the angular resolution of 360*90, the sampling number of each angular area as 10000, the calculation amount of intersection calculation as A, the calculation amount of one transmission/reflection as B, and the number of transmission/reflection as n as an example, real-time ray tracing is used in a space When performing calculations in the cache area, the required real-time calculation amount M1 is: 360*90*10000*(A+nB). Wherein, n is a positive integer greater than or equal to 1.
而在本实施例提供的方案中,首先在预计算的过程中,在不考虑角度分辨率的情况下对空间缓存区域进行一定数量的入射光计算。具体地,对于每一入射光需要进行求交以及透/反射的计算。可选的,所述透/反射的次数可以为多次。进一步地,对于每一空间缓存区域中每一角度区域计算一定数量的出射光的中间渲染结果。在计算出射光的中间渲染结果的过程中,对于每一出射光需要进行一次权值矩阵的计算以及将所述权值矩阵与入射光的预渲染结果相乘的计算。其次,在实时计算的过程中,当基于角度分辨率对每一个角度区域进行一定数量的采样时,可以直接获取与实时光线的角度一致或相近的出射光(预计算阶段)的中间渲染结果,或者获取该角度区域的中间渲染结果。其中,该角度区域的中间渲染结果是根据预计算阶段获得的出射光的中间渲染结果求取均值获得的。However, in the solution provided by this embodiment, firstly, in the pre-calculation process, a certain amount of incident light calculations are performed on the spatial buffer area without considering the angular resolution. Specifically, calculation of intersection and transmission/reflection needs to be performed for each incident light. Optionally, the times of the transmission/reflection may be several times. Further, a certain number of intermediate rendering results of outgoing light are calculated for each angle area in each space buffer area. In the process of calculating the intermediate rendering result of the outgoing light, the calculation of the weight matrix and the calculation of multiplying the weight matrix by the pre-rendering result of the incoming light need to be performed once for each outgoing light. Secondly, in the process of real-time calculation, when a certain amount of sampling is performed on each angular region based on the angular resolution, the intermediate rendering result of the outgoing light (pre-calculation stage) that is consistent with or similar to the angle of the real-time light can be directly obtained, Or get the intermediate rendering result of the angle area. Wherein, the intermediate rendering result of the angle area is obtained by calculating the average value of the intermediate rendering results of the outgoing light obtained in the pre-calculation stage.
同样,以入射光的数量为10000、求交计算量为A、一次透/反射计算量为B、透/反射次数为n、角度分辨率为360*90、每一角度区域采样数为10000、权值矩阵的计算量为C1、将所述权值矩阵与入射光的预渲染结果相乘的计算量为C2为例,本实施例提供的方法在对同一个空间缓存区域进行计算时,所需要的计算量分为预计算阶段和实时计算两个部分。其中预计算阶段的计算量M2为:10000*(A+nB)+360*90*10000*(C1+C2)。而实时计算阶段的计算量M3则是360*90*10000*1。其中,M3中的“1”表示获取预计算中获得的出射光或角度区域的中间渲染结果。Similarly, the number of incident light is 10000, the calculation amount of intersection is A, the calculation amount of one transmission/reflection is B, the number of transmission/reflection is n, the angular resolution is 360*90, and the sampling number of each angular area is 10000. The calculation amount of the weight matrix is C1, and the calculation amount of multiplying the weight matrix and the pre-rendering result of the incident light is C2. For example, when the method provided in this embodiment calculates the same spatial buffer area, the The amount of calculation required is divided into two parts: the pre-calculation stage and the real-time calculation. The calculation amount M2 in the pre-calculation stage is: 10000*(A+nB)+360*90*10000*(C1+C2). The calculation amount M3 in the real-time calculation stage is 360*90*10000*1. Among them, "1" in M3 means to obtain the intermediate rendering result of the outgoing light or angle area obtained in the pre-computation.
首先,对比M1和M3,即对比传统方法和本实施例提供的方案在实时计算量上的差别,可以看到M1是M3的(A+nB)倍。换言之,传统方法在实时计算时花费的时间是本实施例提供方案的(A+nB)倍。而通常来说,在三维模型数量较多或较复杂时,求交计算和透/反射的计算量是很大的,需要占用较长的时间。其中,最占用时间的是求交计算。因此,本实施例提供的方案大大地减少了实时计算量,提升了实时光线追踪的效率。First, compare M1 and M3, that is, compare the difference in real-time calculation amount between the traditional method and the solution provided by this embodiment. It can be seen that M1 is (A+nB) times of M3. In other words, the traditional method takes (A+nB) times longer than the solution provided in this embodiment for real-time calculation. Generally speaking, when the number of 3D models is large or complex, the amount of intersection calculation and transmission/reflection calculation is very large, and it takes a long time. Among them, the intersection calculation takes the most time. Therefore, the solution provided by this embodiment greatly reduces the amount of real-time calculation and improves the efficiency of real-time ray tracing.
其次,对比M1和(M2+M3),即对于传统方法和本实施例提供的方案在整体计算量上的差别。其中,M2+M3等于10000*(360*90*(C1+C2+1)+(A+nB))。具体地,权值矩阵的计算量C1、将所述权值矩阵与入射光的预渲染结果相乘的计算量C2属于典型的数值计算,计算量远小于求交和透/反射计算。此外,占用计算量较大的部分(即A+nB)也无需乘以角度分辨率。因此从整体计算量来看,本实施例提供的方案也是小于传统方法的。Secondly, compare M1 with (M2+M3), that is, the difference in the overall calculation amount between the traditional method and the solution provided in this embodiment. Among them, M2+M3 is equal to 10000*(360*90*(C1+C2+1)+(A+nB)). Specifically, the calculation amount C1 of the weight matrix and the calculation amount C2 of multiplying the weight matrix by the pre-rendering result of the incident light belong to typical numerical calculations, and the calculation amount is much smaller than the calculation of intersection and transmission/reflection. In addition, the part (ie, A+nB) that takes up a large amount of calculation does not need to be multiplied by the angular resolution. Therefore, from the perspective of the overall calculation amount, the solution provided by this embodiment is also smaller than the traditional method.
需要说明的是,在整体计算量以及实时计算量均小于传统方法的情况下,本实施例依然可以保障高质量的渲染结果。因为在本实施例的方案中,对于空间中每一空间缓存区域中的每一角度区域,依然是进行了较高频次(如10000次)的采样。而在渲染方法中,高采样频率是提升画面质量的重要因素。It should be noted that this embodiment can still guarantee a high-quality rendering result when the overall calculation amount and the real-time calculation amount are smaller than those of the traditional method. Because in the solution of this embodiment, for each angle area in each space buffer area in the space, a relatively high frequency (eg, 10,000 times) is still sampled. In the rendering method, high sampling frequency is an important factor to improve the picture quality.
因此,本方案通过对入射光和出射光进行预计算,减少了光线追踪过程中的整体计算量以及实时计算量,有效地提升了光线追踪计算的效率,并同时保障了渲染结果的高质量。Therefore, this solution reduces the overall and real-time calculations in the ray tracing process by pre-calculating the incident light and outgoing light, effectively improves the efficiency of ray tracing calculations, and at the same time ensures the high quality of rendering results.
本申请还提供一种渲染引擎300,如图8所示,包括:The present application also provides a rendering engine 300, as shown in FIG. 8 , including:
通信单元302,用于在S101获取待渲染内容及相关参数。The communication unit 302 is configured to obtain the content to be rendered and related parameters at S101.
存储单元304,用于存储在S101中获取的各个模型的模型数据及相关参数。在S103中,用于存储各入射光的预渲染结果。存储单元304还用于在S105中存储各出射光的RGB值。在S107中,空间中各空间缓存区域的各角度区域的中间渲染结果也被存储至存储单元304中。The storage unit 304 is configured to store the model data and related parameters of each model acquired in S101. In S103, it is used to store the pre-rendering results of each incident light. The storage unit 304 is also used for storing RGB values of each outgoing light in S105. In S107 , the intermediate rendering results of each angle area of each space cache area in the space are also stored in the storage unit 304 .
处理单元306,用于在S101中对空间中各模型进行预渲染,计算各入射光线的预渲染结果。在S105中,针对每一空间缓存模型计算出射光线的RGB值的操作是由处理单元305执行。处理单元306,还用于在S107中根据前述出射光线的RGB值计算空间中各空间缓存区域的各角度区域的中间渲染结果。在S111中,基于所述中间渲染结果,获取实时计算中出射光的实时渲染结果的操作也是由处理单元305执行的。The processing unit 306 is configured to perform pre-rendering on each model in the space in S101, and calculate a pre-rendering result of each incident light. In S105 , the operation of calculating the RGB value of the outgoing light for each spatial cache model is performed by the processing unit 305 . The processing unit 306 is further configured to calculate an intermediate rendering result of each angle area of each space buffer area in the space according to the RGB value of the aforementioned outgoing light in S107. In S111 , based on the intermediate rendering result, the operation of acquiring the real-time rendering result of the outgoing light in the real-time calculation is also performed by the processing unit 305 .
可选的,通信单元302还用于返回S109中的获得的中间渲染结果。Optionally, the communication unit 302 is further configured to return the intermediate rendering result obtained in S109.
本申请还提供一种计算设备400。如图9所示,计算设备包括:总线402、处理器404、存储器406和通信接口408。处理器404、存储器406和通信接口408之间通过总线402通信。计算设备400可以是服务器或终端设备。应理解,本申请不限定计算设备400中的处理器、存储器的个数。The present application also provides a computing device 400 . As shown in FIG. 9 , the computing device includes: a bus 402 , a processor 404 , a memory 406 and a communication interface 408 . The processor 404 , the memory 406 and the communication interface 408 communicate through the bus 402 . Computing device 400 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 400 .
总线402可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线404可包括在计算设备400各个部件(例如,存储器406、处理器404、通信接口408)之间传送信息的通路。The bus 402 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one line is used in FIG. 9 , but it does not mean that there is only one bus or one type of bus. Bus 404 may include pathways for communicating information between various components of computing device 400 (eg, memory 406 , processor 404 , communication interface 408 ).
处理器404可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。The processor 404 may include processing such as a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU), a microprocessor (micro processor, MP) or a digital signal processor (digital signal processor, DSP). Any one or more of them.
在一些可能的实现方式中,处理器404可以包含一个或多个图形处理器。该处理器404用于执行存储在存储器406中的指令以实现前述渲染方法100。In some possible implementations, processor 404 may include one or more graphics processors. The processor 404 is configured to execute instructions stored in the memory 406 to implement the
在一些可能的实现方式中,处理器404可以包括一个或多个中央处理器和一个或多个图形处理器。该处理器404用于执行存储在存储器406中的指令以实现前述渲染方法100。In some possible implementations, the processor 404 may include one or more central processing units and one or more graphics processors. The processor 404 is configured to execute instructions stored in the memory 406 to implement the
存储器406可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。处理器404还可以包括非易失性存储器(non-volatilememory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard diskdrive,HDD)或固态硬盘(solid state drive,SSD)。存储器406中存储有可执行的程序代码,处理器404执行该可执行的程序代码以实现前述渲染方法100。具体的,存储器406上存有渲染引擎300用于执行渲染方法100的指令。The memory 406 may include a volatile memory (volatile memory), such as random access memory (random access memory, RAM). The processor 404 may also include a non-volatile memory (non-volatile memory), such as a read-only memory (read-only memory, ROM), a flash memory, a mechanical hard disk (hard diskdrive, HDD) or a solid state disk (solid state drive, SSD). Executable program codes are stored in the memory 406 , and the processor 404 executes the executable program codes to implement the
通信接口403使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备400与其他设备或通信网络之间的通信。The communication interface 403 implements communication between the computing device 400 and other devices or communication networks by using transceiver modules such as but not limited to network interface cards and transceivers.
本申请实施例还提供了一种计算设备集群。如图10所示,所述计算设备集群包括至少一个计算设备400。该计算设备集群中包括的计算设备集群可以全部是终端设备,也可以全部是云服务器,还可以部分是云服务器部分是终端设备。The embodiment of the present application also provides a computing device cluster. As shown in FIG. 10 , the computing device cluster includes at least one computing device 400 . The computing device clusters included in the computing device cluster may all be terminal devices, all may be cloud servers, or partly be cloud servers and partly be terminal devices.
在上述的三种关于计算设备集群的部署方式下,计算设备集群中的一个或多个计算设备400中的存储器406中可以存有相同的渲染引擎300用于执行渲染方法100的指令。In the above three deployment modes related to computing device clusters, the same rendering engine 300 may store instructions for executing the
在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备400也可以用于执行渲染引擎300用于执行渲染方法100的部分指令。换言之,一个或多个计算设备400的组合可以共同执行渲染引擎300用于执行渲染方法100的指令。In some possible implementation manners, one or more computing devices 400 in the computing device cluster may also be used to execute some instructions of the rendering engine 300 for executing the
需要说明的是,计算设备集群中的不同的计算设备400中的存储器406可以存储不同的指令,用于执行渲染方法100的部分功能。It should be noted that the memory 406 in different computing devices 400 in the computing device cluster may store different instructions for executing some functions of the
图11示出了一种可能的实现方式。如图11所示,两个计算设备400A和400B通过通信接口408实现连接。计算设备400A中的存储器上存有用于执行通信单元302和处理单元306的功能的指令。计算设备400B中的存储器上存有用于执行存储单元304的功能的指令。换言之,计算设备400A和400B的存储器406共同存储了渲染引擎300用于执行渲染方法100的指令。Figure 11 shows a possible implementation. As shown in FIG. 11 , two computing devices 400A and 400B are connected through a communication interface 408 . Instructions for performing the functions of communication unit 302 and processing unit 306 are stored on memory in computing device 400A. Instructions for performing the functions of the storage unit 304 are stored on the memory in the computing device 400B. In other words, the memories 406 of the computing devices 400A and 400B jointly store instructions for the rendering engine 300 to execute the
图11所示的计算设备集群之间的连接方式可以是考虑到本申请提供的渲染方法100需要大量存储预先计算的渲染结果。因此,考虑将存储功能交由计算设备400B执行。The connection mode between the computing device clusters shown in FIG. 11 may be based on the consideration that the
应理解,图11中示出的计算设备400A的功能也可以由多个计算设备400完成。同样,计算设备400B的功能也可以由多个计算设备400完成。It should be understood that the functions of the computing device 400A shown in FIG. 11 may also be performed by multiple computing devices 400 . Likewise, the functions of computing device 400B may also be performed by multiple computing devices 400 .
在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,所述网络可以是广域网或局域网等等。图12示出了一种可能的实现方式。如图12所示,两个计算设备400C和400D之间通过网络进行连接。具体地,通过各个计算设备中的通信接口与所述网络进行连接。在这一类可能的实现方式中,计算设备400C中的存储器406中存有执行通信单元302的指令。同时,计算设备400D中的存储器406中存有执行存储单元304和处理单元306的指令。In some possible implementations, one or more computing devices in a cluster of computing devices may be connected through a network. Wherein, the network may be a wide area network or a local area network or the like. Figure 12 shows a possible implementation. As shown in FIG. 12 , two computing devices 400C and 400D are connected through a network. Specifically, it is connected to the network through a communication interface in each computing device. In this type of possible implementation, the memory 406 in the computing device 400C stores instructions for executing the communication unit 302 . Meanwhile, the memory 406 in the computing device 400D stores instructions for executing the storage unit 304 and the processing unit 306 .
图12所示的计算设备集群之间的连接方式可以是考虑到本申请提供的渲染方法100需要大量存储预先计算的渲染结果和进行光线追踪的大量计算,因此考虑将处理单元306和存储单元304实现的功能交由计算设备400D执行。The connection mode between the computing device clusters shown in FIG. 12 can be considered that the
应理解,图12中示出的计算设备400C的功能也可以由多个计算设备400完成。同样,计算设备400D的功能也可以由多个计算设备400完成。It should be understood that the functions of the computing device 400C shown in FIG. 12 may also be performed by multiple computing devices 400 . Likewise, the functions of computing device 400D may also be performed by multiple computing devices 400 .
本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行上述应用于渲染引擎300的渲染方法100。The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that includes one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state hard disk), etc. The computer-readable storage medium includes instructions, and the instructions instruct a computing device to execute the above-mentioned
本申请实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算机设备上运行时,使得至少一个计算机设备执行上述渲染方法100。The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product containing instructions, executable on a computing device or stored on any available medium. When the computer program product runs on at least one computer device, at least one computer device is caused to execute the
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims (17)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2022/104247 WO2023005631A1 (en) | 2021-07-28 | 2022-07-07 | Rendering method and apparatus, and storage medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110858925X | 2021-07-28 | ||
| CN202110858925 | 2021-07-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115690284A true CN115690284A (en) | 2023-02-03 |
Family
ID=85059904
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111627202.5A Pending CN115690284A (en) | 2021-07-28 | 2021-12-28 | A rendering method, device and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115690284A (en) |
| WO (1) | WO2023005631A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116342789A (en) * | 2023-03-20 | 2023-06-27 | 南京大学 | Layered material rendering method and device based on meta learning |
| CN116977556A (en) * | 2023-07-18 | 2023-10-31 | 广东国地规划科技股份有限公司 | Rendering method, device and storage medium of CIM system |
| CN120446060A (en) * | 2025-07-09 | 2025-08-08 | 中国科学院长春光学精密机械与物理研究所 | Light sampling method based on two-dimensional BSDF |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120472054B (en) * | 2025-07-14 | 2025-09-12 | 湘潭谷田网络科技有限公司 | 3D animation real-time rendering optimization method and system based on physical rendering |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7289119B2 (en) * | 2005-05-10 | 2007-10-30 | Sony Computer Entertainment Inc. | Statistical rendering acceleration |
| CN105261059B (en) * | 2015-09-18 | 2017-12-12 | 浙江大学 | A kind of rendering intent based in screen space calculating indirect reference bloom |
| CN112669426B (en) * | 2020-12-25 | 2024-01-02 | 武汉青图科技工程有限公司 | Three-dimensional geographic information model rendering method and system based on generation countermeasure network |
| CN112957731B (en) * | 2021-03-26 | 2021-11-26 | 深圳市凉屋游戏科技有限公司 | Picture rendering method, picture rendering device and storage medium |
-
2021
- 2021-12-28 CN CN202111627202.5A patent/CN115690284A/en active Pending
-
2022
- 2022-07-07 WO PCT/CN2022/104247 patent/WO2023005631A1/en not_active Ceased
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116342789A (en) * | 2023-03-20 | 2023-06-27 | 南京大学 | Layered material rendering method and device based on meta learning |
| CN116977556A (en) * | 2023-07-18 | 2023-10-31 | 广东国地规划科技股份有限公司 | Rendering method, device and storage medium of CIM system |
| CN116977556B (en) * | 2023-07-18 | 2024-02-06 | 广东国地规划科技股份有限公司 | Rendering method, device and storage medium of CIM system |
| CN120446060A (en) * | 2025-07-09 | 2025-08-08 | 中国科学院长春光学精密机械与物理研究所 | Light sampling method based on two-dimensional BSDF |
| CN120446060B (en) * | 2025-07-09 | 2025-09-02 | 中国科学院长春光学精密机械与物理研究所 | Light sampling method based on two-dimensional BSDF |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2023005631A1 (en) | 2023-02-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023005631A1 (en) | Rendering method and apparatus, and storage medium | |
| US10481684B2 (en) | System and method for foveated image generation using an optical combiner | |
| WO2021228031A1 (en) | Rendering method, apparatus and system | |
| US12182927B2 (en) | Denoising techniques suitable for recurrent blurs | |
| US20230230311A1 (en) | Rendering Method and Apparatus, and Device | |
| US20240029338A1 (en) | Ray-tracing with irradiance caches | |
| CN116758208A (en) | Global illumination rendering method and device, storage medium and electronic equipment | |
| KR20240074815A (en) | 3D model rendering method and apparatus, electronic device, and storage medium | |
| JP7617728B2 (en) | Image generation system and method | |
| CN115830202A (en) | A three-dimensional model rendering method and device | |
| WO2019042028A1 (en) | All-around spherical light field rendering method | |
| WO2023088047A1 (en) | Rendering method and apparatus | |
| US20090284524A1 (en) | Optimized Graphical Calculation Performance by Removing Divide Requirements | |
| WO2022105641A1 (en) | Rendering method, device and system | |
| US12322037B2 (en) | System and method for real-time ray tracing in a 3D environment | |
| WO2023029424A1 (en) | Method for rendering application and related device | |
| WO2023197689A1 (en) | Data processing method, system, and device | |
| WO2023109582A1 (en) | Light ray data processing method and apparatus, device and storage medium | |
| KR102332920B1 (en) | System and method for rendering of 6 degree of freedom virtual reality | |
| CN114748874A (en) | Water body reflection processing method, device, equipment and storage medium | |
| WO2022042003A1 (en) | Three-dimensional coloring method and apparatus, and computing device and storage medium | |
| CN119762655A (en) | Image rendering method, device, storage medium and program product | |
| CN118172473A (en) | Method, device, equipment and storage medium for determining illumination information | |
| WO2024109006A1 (en) | Light source elimination method and rendering engine | |
| GB2604744A (en) | Image generation system and method |
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 |