CN114911625A - Virtual object rendering method, device and system and electronic equipment - Google Patents
Virtual object rendering method, device and system and electronic equipment Download PDFInfo
- Publication number
- CN114911625A CN114911625A CN202210611220.2A CN202210611220A CN114911625A CN 114911625 A CN114911625 A CN 114911625A CN 202210611220 A CN202210611220 A CN 202210611220A CN 114911625 A CN114911625 A CN 114911625A
- Authority
- CN
- China
- Prior art keywords
- semi
- transparent
- grids
- sorted
- sorting
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
- G06T17/205—Re-meshing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Image Generation (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域technical field
本文件涉及计算机三维渲染技术领域,尤其涉及一种虚拟对象渲染方法、装置、系统及电子设备。This document relates to the technical field of computer three-dimensional rendering, in particular to a virtual object rendering method, device, system and electronic device.
背景技术Background technique
随着用户对游戏品质的要求越来越高,为了给用户带来更好的视觉体验,有些人物角色的衣服需要有多层半透明的效果,比如多层纱织或丝质衣服重叠一起。而多层半透明衣服在渲染时则会出现穿插的问题,即一些三角形面的渲染先后顺序出现了混淆。As users have higher and higher requirements for game quality, in order to bring users a better visual experience, some characters' clothes need to have multiple layers of translucent effects, such as overlapping layers of yarn or silk clothes. However, when rendering multi-layered translucent clothes, there will be a problem of interspersed, that is, the rendering order of some triangular faces will be confused.
现有技术主要是通过一个大网格重叠的部分拆分成层,再从后向前一层层合并网格来保证层与层之间的渲染顺序。然而,这种方式需要美工通过工具手动拆分层然后重新导出新的fbx格式的文件,这显然增加了手动操作成本。而且,导出的fbx格式的文件只能保证静止状态下的效果是正确的,然而在运动状态下的效果仍然可能会出错,比如如果网格对应的虚拟对象在游戏中旋转后,那么虚拟对象对应的半透明网格的三角形序列的渲染顺序则不能再保证从后向前依次渲染,也就会出现渲染效果出错的情况。In the prior art, the overlapping part of a large grid is divided into layers, and then the grids are merged layer by layer from the back to the front to ensure the rendering order between layers. However, this method requires the artist to manually split the layers through the tool and then re-export the new fbx format file, which obviously increases the manual operation cost. Moreover, the exported file in fbx format can only guarantee that the effect in the static state is correct, but the effect in the moving state may still be wrong. For example, if the virtual object corresponding to the grid is rotated in the game, then the virtual object corresponding to The rendering order of the triangle sequence of the translucent mesh can no longer be guaranteed to be rendered from back to front, and the rendering effect will be wrong.
因此,如何保证半透明网格在静态和动态下的渲染顺序,以及减小渲染过程中的手动操作成本,仍然需要提供进一步的解决方案。Therefore, how to ensure the rendering order of translucent meshes under static and dynamic conditions, and how to reduce the cost of manual operations during rendering, still needs to provide further solutions.
发明内容SUMMARY OF THE INVENTION
本说明书实施例的目的是提供一种虚拟对象渲染方法、装置、系统及电子设备,以保证半透明网格在静态和动态下的渲染顺序,以及减小渲染过程中的手动操作成本。The purpose of the embodiments of this specification is to provide a virtual object rendering method, device, system and electronic device, so as to ensure the rendering order of the translucent mesh in static and dynamic conditions, and reduce the manual operation cost in the rendering process.
为解决上述技术问题,本说明书实施例是这样实现的:In order to solve the above-mentioned technical problems, the embodiments of this specification are implemented as follows:
第一方面,提出了一种虚拟对象渲染方法,包括:In the first aspect, a virtual object rendering method is proposed, including:
通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;Collect a translucent grid queue of image frames to be rendered through the main thread, and send a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;The sorting thread, in response to the sorting notification sent by the main thread, acquires the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, for all the semi-transparent meshes to be sorted. Sorting the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;After the sorting thread finishes sorting the plurality of translucent grids in the translucent grid queue, sending a sorting completion notification to the main thread;
所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
第二方面,提出了一种虚拟对象渲染系统,所述系统包括排序线程和主线程,其中:In a second aspect, a virtual object rendering system is proposed, the system includes a sorting thread and a main thread, wherein:
所述主线程,采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;The main thread collects the translucent grid queue of the image frame to be rendered, and sends a sorting notification to the sorting thread. The translucent grid queue includes multiple translucent grids, and one translucent grid corresponds to a virtual grid. object;
所述排序线程,执行如下单次循环过程:The sorting thread performs the following single cycle process:
响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;In response to the sorting notification sent by the main thread, obtain the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, perform sorting on the semi-transparent meshes to be sorted. Sorting the translucent meshes to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知,以使得所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。After completing the sorting of the plurality of translucent grids in the translucent grid queue, a sorting completion notification is sent to the main thread, so that the main thread receives the sorting completion notification and completes the image Rendering of virtual objects in the frame.
第三方面,提出了一种虚拟对象渲染装置,包括:In a third aspect, a virtual object rendering device is proposed, including:
采集单元,通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;The acquisition unit collects the translucent grid queue of the image frame to be rendered through the main thread, and sends a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
排序单元,所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;A sorting unit, where the sorting thread obtains the semi-transparent meshes to be sorted in the semi-transparent mesh queue in response to the sorting notification sent by the main thread, and based on the triangle index list of the semi-transparent meshes to be sorted , sort the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
发送单元,当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;a sending unit, after the sorting thread completes the sorting of the plurality of translucent grids in the translucent grid queue, sends a sorting completion notification to the main thread;
渲染单元,所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。A rendering unit, where the main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
第四方面,提出了一种电子设备,包括:In a fourth aspect, an electronic device is provided, comprising:
处理器;以及processor; and
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:memory arranged to store computer-executable instructions which, when executed, cause the processor to:
通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;Collect a translucent grid queue of image frames to be rendered through the main thread, and send a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;The sorting thread, in response to the sorting notification sent by the main thread, acquires the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, for all the semi-transparent meshes to be sorted. Sorting the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;After the sorting thread finishes sorting the plurality of translucent grids in the translucent grid queue, sending a sorting completion notification to the main thread;
所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
第五方面,提出了一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行以下操作:In a fifth aspect, a computer-readable storage medium is proposed, the computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of application programs, cause all The described electronic device performs the following actions:
通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;Collect a translucent grid queue of image frames to be rendered through the main thread, and send a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;The sorting thread, in response to the sorting notification sent by the main thread, acquires the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, for all the semi-transparent meshes to be sorted. Sorting the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;After the sorting thread finishes sorting the plurality of translucent grids in the translucent grid queue, sending a sorting completion notification to the main thread;
所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
由以上本说明书实施例提供的技术方案可见,本说明书实施例方案至少具备如下一种技术效果:It can be seen from the technical solutions provided by the above embodiments of this specification that the solutions of the embodiments of this specification have at least one of the following technical effects:
本说明书提供的一种或多个实施例,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。In one or more embodiments provided in this specification, the sorting task of the translucent grid of the image frame to be rendered can be handed over to the sorting thread for execution alone, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered, The translucent grid queue includes a plurality of translucent grids, and for each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism, so as to ensure that the image frame contains the translucent grids. The correctness of the rendering effect of the virtual object of the grid in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
附图说明Description of drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the following briefly introduces the accompanying drawings required in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in this specification. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.
图1是本说明书的一个实施例提供的一种虚拟对象渲染方法的实施流程示意图。FIG. 1 is a schematic flowchart of an implementation of a virtual object rendering method provided by an embodiment of the present specification.
图2是根据本说明书的一个实施例提供的虚拟对象渲染方法中主线程的工作流程示意图。FIG. 2 is a schematic diagram of the workflow of the main thread in the virtual object rendering method provided according to an embodiment of the present specification.
图3是根据本说明书的一个实施例提供的虚拟对象渲染方法中排序线程的工作流程示意图。FIG. 3 is a schematic diagram of the workflow of sorting threads in a virtual object rendering method provided according to an embodiment of the present specification.
图4是本说明书的一个实施例提供的一种虚拟对象渲染系统的结构示意图。FIG. 4 is a schematic structural diagram of a virtual object rendering system provided by an embodiment of the present specification.
图5是本说明书的一个实施例提供的一种虚拟对象渲染装置的结构示意图。FIG. 5 is a schematic structural diagram of a virtual object rendering apparatus provided by an embodiment of the present specification.
图6是本说明书的一个实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present specification.
具体实施方式Detailed ways
为了使得本文件的目的、技术方案和优点更为明显,下面将参照附图详细描述根据本文件的示例实施例。显然,所描述的实施例仅仅是本文件的一部分实施例,而不是本文件的全部实施例,应理解,本文件不受这里描述的示例实施例的限制。In order to make the objectives, technical solutions and advantages of this document more apparent, exemplary embodiments according to this document will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this document, not all of the embodiments of this document, and it should be understood that this document is not limited by the example embodiments described herein.
下面将参照附图更详细地描述本文件的实施例。虽然附图中显示了本文件的某些实施例,然而应当理解的是,本文件可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本文件。应当理解的是,本文件的附图及实施例仅用于示例性作用,并非用于限制本文件的保护范围。Embodiments of the present document will be described in more detail below with reference to the accompanying drawings. While certain embodiments of this document are shown in the drawings, it is to be understood that this document 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 this document. It should be understood that the drawings and embodiments in this document are only used for exemplary purposes, and are not used to limit the protection scope of this document.
应当理解,本文件的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本文件的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of this document may be performed in different orders and/or in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of this document is not limited in this regard.
本文件使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。The term "including" and its variants used in this document are open to include, ie, "including but not limited to". The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below.
需要注意,本文件中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that the concepts such as "first" and "second" mentioned in this document are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or interdependence.
需要注意,本文件中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "plurality" mentioned in this document are illustrative rather than restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or a plurality of" multiple".
本文件实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of this document are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
为保证半透明网格在静态和动态下的渲染顺序,以及减小渲染过程中的手动操作成本,本说明书一个或多个实施例提供一种虚拟对象渲染方法。In order to ensure the rendering order of the translucent mesh under static and dynamic conditions, and to reduce the manual operation cost in the rendering process, one or more embodiments of this specification provide a virtual object rendering method.
如背景技术中所述,现有的虚拟对象对应的半透明网格的三角形序列的渲染顺序在虚拟对象处于动态的情况下,仍然是固定的。这就导致在虚拟对象在变化的图像帧中转换了角度,比如进行旋转等动作时,仍然依据虚拟形象初始状态下的半透明网格的三角形序列的渲染顺序进行渲染,则会出现渲染效果出错的情况。As described in the background art, the rendering order of the triangle sequence of the translucent mesh corresponding to the existing virtual object is still fixed when the virtual object is dynamic. This results in that when the virtual object changes the angle in the changing image frame, such as rotation, etc., the rendering is still performed according to the rendering order of the triangle sequence of the semi-transparent mesh in the initial state of the virtual image, and a rendering effect error occurs. Case.
为了解决这个问题,本说明书一个实施例提供了一种虚拟对象渲染方法,该虚拟对象渲染方法能够在每个图像帧被展示给用户之前,都通过主线程将待渲染图像帧中的半透明网格采集起来加入到该图像帧的半透明网格队列中,再由排序线程响应于主线程发送的排序通知,获取该半透明网格队列中待排序的半透明网格,并基于该待排序的半透明网格的三角形索引列表,对待排序的半透明网格进行排序,以确定待排序的半透明网格中三角形面的渲染顺序,最后由主线程接收排序线程完成半透明网格队列中的半透明网格的排序完成通知后对图像帧中虚拟对象进行渲染。这样不管图像帧中的虚拟对象进行了怎样动态的转变,由于每个图像帧中的虚拟对象对应的半透明网格都进行了排序,因此再展示给用户的图像帧则能够避免出现渲染效果出错的问题。In order to solve this problem, an embodiment of the present specification provides a virtual object rendering method. The virtual object rendering method can use the main thread to render the translucent mesh in the image frame to be rendered before each image frame is displayed to the user. The grid is collected and added to the translucent grid queue of the image frame, and then the sorting thread responds to the sorting notification sent by the main thread to obtain the translucent grid to be sorted in the translucent grid queue, and based on the to-be-sorted The triangular index list of the semi-transparent mesh, sort the semi-transparent mesh to be sorted to determine the rendering order of the triangular faces in the semi-transparent mesh to be sorted, and finally receive the sorting thread by the main thread to complete the semi-transparent mesh queue. Renders the dummy objects in the image frame after the sorting of the translucent mesh is notified. In this way, no matter how the virtual objects in the image frame are dynamically transformed, since the translucent grids corresponding to the virtual objects in each image frame are sorted, the image frame displayed to the user can avoid rendering errors. The problem.
图1是本说明书的一个实施例提供的一种虚拟对象渲染方法的实现流程示意图。图1所示的虚拟对象渲染方法可包括:FIG. 1 is a schematic diagram of an implementation flow of a virtual object rendering method provided by an embodiment of the present specification. The virtual object rendering method shown in FIG. 1 may include:
步骤110,通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象。Step 110: Collect the translucent grid queue of the image frame to be rendered through the main thread, and send a sorting notification to the sorting thread. The translucent grid queue includes multiple translucent grids, and one translucent grid corresponds to one virtual object. .
其中,图像帧可以是游戏视频中的图像帧,该图像帧中往往包含有多个虚拟对象,有些虚拟对象可能会包含有半透明网格。当虚拟对象在动态情况下,比如旋转等改变虚拟对象的角度的动作时,虚拟对象对应的半透明网格可能会有渲染穿插的问题,即出现渲染效果出错,进而给用户不好的视觉体验。在这种情况下,本说明书实施例在每个图像帧被展示给用户之前,都采集该图像帧中的半透明网格,将该图像帧中的半透明网格加入到待渲染图像帧的半透明网格队列,再由主线程向排序线程发送排序通知,以利用多线程机制来完成该图像帧中的虚拟形象对应的半透明网格的排序任务。The image frame may be an image frame in a game video, the image frame often contains multiple virtual objects, and some virtual objects may contain a translucent grid. When the virtual object is in a dynamic situation, such as rotation and other actions to change the angle of the virtual object, the translucent grid corresponding to the virtual object may have the problem of rendering interspersed, that is, the rendering effect will be wrong, which will give the user a bad visual experience. . In this case, before each image frame is displayed to the user, the embodiment of the present specification captures the translucent grid in the image frame, and adds the translucent grid in the image frame to the image frame to be rendered. The translucent grid queue, and then the main thread sends a sorting notification to the sorting thread, so as to use the multi-thread mechanism to complete the sorting task of the translucent grid corresponding to the avatar in the image frame.
其中,多个半透明网格为主线程获取并加入到半透明网格队列中。Among them, multiple translucent grids are acquired by the main thread and added to the translucent grid queue.
应理解,由于主线程负责渲染工作,因此为了提高半透明网格的排序效率,可采用多线程机制来执行每个图像帧的渲染工作,具体可由主线程负责收集每一个待渲染的图像帧中的多个半透明网格以及刷新排序后的半透明网格的三角形索引列表的工作,而待排序的半透明网格的排序工作则可单独由排序线程来执行。It should be understood that since the main thread is responsible for the rendering work, in order to improve the sorting efficiency of the translucent grid, a multi-threading mechanism can be used to perform the rendering work of each image frame. Specifically, the main thread can be responsible for collecting the information in each image frame to be rendered. The work of resetting multiple translucent meshes and refreshing the triangle index list of the sorted translucent meshes, while the sorting work of the translucent meshes to be sorted can be performed by the sorting thread alone.
由于半透明网格才有渲染穿插的问题,为了提高收集半透明网格的效率,可为半透明网格约定一种特殊的命名方式,比如可以在其后缀上统一加上"_a";如果主线程识别到图像帧中有新添加带"_a"命名后缀的半透明网格,那么主线程就会将其收集并添加到半透网格队列中。而如果主线程识别到图像帧中带有"_a"命名后缀的半透明网格从虚拟空间中被移除,那么主线程就会在半透网格队列中删除该半透明网格。Because translucent grids have the problem of rendering interspersed, in order to improve the efficiency of collecting translucent grids, a special naming method can be agreed for the translucent grids, for example, "_a" can be added to the suffix; if The main thread recognizes that there is a newly added translucent mesh with the "_a" naming suffix in the image frame, then the main thread collects and adds it to the translucent mesh queue. And if the main thread recognizes that the translucent mesh with the "_a" named suffix in the image frame is removed from the virtual space, then the main thread deletes the translucent mesh from the translucent mesh queue.
步骤120,排序线程响应于主线程发送的排序通知,获取半透明网格队列中待排序的半透明网格,并基于待排序的半透明网格的三角形索引列表,对待排序的半透明网格进行排序,以确定待排序的半透明网格中三角形面的渲染顺序。
其中,半透明网格队列中的半透明网格为等待被排序的半透明网格,排序线程在启动执行时,可依次从半透明网格队列中拉取待排序的半透明网格来执行排序任务,即由排序线程遍历半透明网格队列中待排序的半透明网格来执行排序任务。Among them, the translucent grids in the translucent grid queue are translucent grids waiting to be sorted. When the sorting thread starts to execute, it can sequentially pull the translucent grids to be sorted from the translucent grid queue for execution. Sorting task, that is, the sorting task is performed by the sorting thread traversing the translucent grids to be sorted in the translucent grid queue.
可选地,由于半透明网格还分为蒙皮网格和非蒙皮网格,而蒙皮网格在排序时,还需要获取蒙皮后的顶点列表信息,以便提高蒙皮网格排序的准确性。具体地,基于待排序的半透明网格的三角形索引列表,对待排序的半透明网格进行排序,包括:Optionally, since translucent meshes are further divided into skinned meshes and non-skinned meshes, and when skinned meshes are sorted, it is also necessary to obtain the vertex list information after skinning, so as to improve the sorting of skinned meshes. accuracy. Specifically, based on the triangle index list of the semitransparent meshes to be sorted, the semitransparent meshes to be sorted are sorted, including:
确定待排序的半透明网格是否为蒙皮网格;Determine whether the translucent mesh to be sorted is a skinned mesh;
如果待排序的半透明网格是蒙皮网格,则基于蒙皮网格的相关数据,获取待排序的半透明网格中蒙皮后的顶点列表信息;If the translucent mesh to be sorted is a skinned mesh, obtain the skinned vertex list information in the translucent mesh to be sorted based on the relevant data of the skinned mesh;
基于待排序的半透明网格中蒙皮后的顶点列表信息,确定待排序的半透明网格的三角形索引列表;Determine the triangle index list of the translucent mesh to be sorted based on the skinned vertex list information in the translucent mesh to be sorted;
基于待排序的半透明网格的三角形索引列表,对待排序的半透明网格进行排序。Sort the translucent meshes to be sorted based on the list of triangle indices of the translucent meshes to be sorted.
其中,蒙皮是三维动画术语,也用于3D游戏中,是三维动画的一种制作技术,在三维软件中创建的模型基础上,为模型添加骨骼。由于骨骼与模型是相互独立的,为了让骨骼驱动模型产生合理的运动,把模型绑定到骨骼上的技术叫做蒙皮。由于蒙皮会随着骨骼运动,因此,在骨骼运动时,可能会出现渲染穿插的问题。Among them, skinning is a term for 3D animation, and is also used in 3D games. It is a production technology of 3D animation. Based on the model created in 3D software, bones are added to the model. Since the bones and the model are independent of each other, in order to allow the bones to drive the model to produce reasonable motion, the technique of binding the model to the bones is called skinning. Since the skin moves with the bones, there may be problems with rendering interspersed when the bones are moving.
本说明书实施例为了解决这个问题,可获取蒙皮网格动态下的每帧蒙皮矩阵,以及基于蒙皮网格动态下的每帧蒙皮矩阵,获取蒙皮网格在当前时刻(即图像帧时刻)下的蒙皮矩阵,并基于蒙皮网格在当前时刻下的蒙皮矩阵,确定半透明网格在当前时刻下的蒙皮后的顶点列表信息。具体地,基于蒙皮网格的相关数据,获取待排序的半透明网格中蒙皮后的顶点列表信息,包括:In order to solve this problem, the embodiments of the present specification can obtain the skinning matrix of each frame under the skinning grid dynamics, and the skinning matrix of each frame under the skinning grid dynamics, and obtain the skinning grid at the current moment (that is, the image frame time), and based on the skin matrix of the skinned mesh at the current time, determine the skinned vertex list information of the translucent mesh at the current time. Specifically, based on the relevant data of the skinned mesh, obtain the skinned vertex list information in the translucent mesh to be sorted, including:
基于蒙皮网格的骨骼矩阵、蒙皮网格中的各顶点对应的骨骼权重、蒙皮网格的初始顶点列表信息,获取蒙皮网格动态下的每帧蒙皮矩阵;Based on the bone matrix of the skinned mesh, the bone weight corresponding to each vertex in the skinned mesh, and the initial vertex list information of the skinned mesh, obtain the skinning matrix of each frame under the dynamic skinning mesh;
基于蒙皮网格动态下的每帧蒙皮矩阵,获取蒙皮网格在图像帧时刻下的蒙皮矩阵;Based on the skinning matrix of each frame under the skinning mesh dynamics, obtain the skinning matrix of the skinning mesh at the image frame moment;
基于蒙皮网格在图像帧时刻下的蒙皮矩阵,确定待排序的半透明网格在当前时刻下的蒙皮后的顶点列表信息。Based on the skinning matrix of the skinned mesh at the image frame time, the skinned vertex list information of the translucent mesh to be sorted at the current time is determined.
可选地,如果待排序的半透明网格不是蒙皮网格,则可直接获取待排序的半透明网格的顶点列表信息;Optionally, if the translucent mesh to be sorted is not a skinned mesh, the vertex list information of the translucent mesh to be sorted can be directly obtained;
基于待排序的半透明网格中的顶点列表信息,确定待排序的半透明网格的三角形索引列表。Based on the vertex list information in the translucent mesh to be sorted, the triangle index list of the translucent mesh to be sorted is determined.
可选地,排序线程可依据待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标对待排序的半透明网格中的三角形面进行排序。具体地,基于待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标,对待排序的半透明网格进行排序,包括:Optionally, the sorting thread may sort the triangular faces in the semi-transparent mesh to be sorted according to the coordinates of the center points of each triangle in the triangle index list of the semi-transparent mesh to be sorted. Specifically, based on the coordinates of the center points of the triangles in the triangle index list of the translucent meshes to be sorted, sort the translucent meshes to be sorted, including:
将待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标转换到相机空间中,得到相机空间下的各三角形的中心点的坐标;Convert the coordinates of the center points of each triangle in the triangle index list of the translucent mesh to be sorted into the camera space to obtain the coordinates of the center points of each triangle in the camera space;
基于相机空间下的各三角形的中心点的坐标,确定各三角形的中心点距离相机空间中的相机的距离;Determine the distance from the center point of each triangle to the camera in the camera space based on the coordinates of the center point of each triangle in the camera space;
按照各三角形的中心点距离相机空间中的相机的距离由大到小的顺序,对待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted in descending order of the distance from the center point of each triangle to the camera in the camera space.
可选地,为便于待排序的半透明网格的三角形索引列表,可将待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标转换到相机空间中,以确定各三角形的中心点距离相机的距离。具体地,按照各三角形的中心点距离相机空间中的相机的距离由大到小的顺序,对待排序的半透明网格的三角形索引列表进行排序,包括:Optionally, in order to facilitate the triangle index list of the translucent mesh to be sorted, the coordinates of the center points of each triangle in the triangle index list of the translucent mesh to be sorted can be converted into camera space to determine each triangle. The distance of the center point from the camera. Specifically, according to the distance from the center point of each triangle to the camera in the camera space in descending order, sort the triangle index list of the semi-transparent mesh to be sorted, including:
按照各三角形的中心点距离相机空间中的相机的距离由大到小的顺序,通过插入排序的方式对待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted by insertion sort according to the distance from the center point of each triangle to the camera in the camera space in descending order.
其中,插入排序是指在待排序的元素中,假设前面n-1(其中n>=2)个数已经是排好顺序的,现将第n个数插到前面已经排好的序列中,然后找到合适自己的位置,使得插入第n个数的这个序列也是排好顺序的。按照此法对所有元素进行插入,直到整个序列排为有序的过程,称为插入排序。Among them, insertion sort means that in the elements to be sorted, assuming that the previous n-1 (where n>=2) numbers are already sorted, now insert the nth number into the previously sorted sequence, Then find a suitable position for yourself, so that the sequence of inserting the nth number is also in order. The process of inserting all elements according to this method until the entire sequence is sorted is called insertion sort.
步骤130,当排序线程完成对半透明网格队列中多个半透明网格的排序后,向主线程发送排序完成通知。Step 130: After the sorting thread completes sorting the multiple translucent grids in the translucent grid queue, it sends a sorting completion notification to the main thread.
例如,主线程在等待排序线程对半透明网格排序完成后,便可刷新半透明网格排序后的三角形索引列表,在等待主线程全部刷新完毕后主线程再通知排序线程执行下一个图像帧中半透明网格的排序任务,即进行当前图像帧的下一个图像帧对应的半透明网格队列中的半透明网格的排序工作。For example, after the main thread waits for the sorting thread to sort the translucent mesh, it can refresh the triangular index list after the translucent mesh is sorted, and after waiting for the main thread to refresh all of them, the main thread notifies the sorting thread to execute the next image frame The task of sorting the translucent grids in the middle is to sort the translucent grids in the translucent grid queue corresponding to the next image frame of the current image frame.
其中,主线程和排序线程同步排序是否完成的方式可采用同步句柄的方式进行同步,具体可.NET库的AutoResetEvent线程同步机制。具体地,排序线程可调用AutoResetEvent.WaitOne来等待信号,当排序线程对图像帧对应的半透明网格队列中的所有半透明网格排序完成后,可调用AutoResetEvent.Set方法来发出信号通知主线程排序完成。Among them, the main thread and the sorting thread can synchronize whether the sorting is completed or not by synchronizing the handle, specifically, the AutoResetEvent thread synchronization mechanism of the .NET library. Specifically, the sorting thread can call AutoResetEvent.WaitOne to wait for the signal. When the sorting thread completes sorting all the translucent grids in the translucent grid queue corresponding to the image frame, it can call the AutoResetEvent.Set method to send a signal to notify the main thread. Sorting is complete.
步骤140,主线程接收排序完成通知并完成图像帧中虚拟对象的渲染。
可选地,为了保证半透明网格中的三角形索引列表的渲染顺序的正确性,避免渲染穿插的问题,主线程接收排序完成通知并完成图像帧中虚拟对象的渲染,包括:Optionally, in order to ensure the correctness of the rendering order of the triangle index list in the translucent mesh and avoid the problem of rendering interspersed, the main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame, including:
主线程接收排序完成通知,并刷新多个半透明网格的三角形索引列表;The main thread receives the sorting completion notification and refreshes the triangle index list of multiple translucent meshes;
主线程基于刷新后的多个半透明网格的三角形索引列表,完成图像帧中虚拟对象的渲染。The main thread completes the rendering of the virtual objects in the image frame based on the refreshed triangle index list of multiple translucent meshes.
其中,主线程刷新多个半透明网格的三角形索引列表,具体是将排序线程排序前的多个半透明网格的三角形索引列表替换为排序线程排序后的多个半透明网格的三角形索引列表,使得主线程能够基于排序线程排序后的多个半透明网格的三角形索引列表,完成对图像帧中多个虚拟对象的渲染。The main thread refreshes the triangle index lists of multiple translucent meshes, specifically, replacing the triangle index lists of multiple translucent meshes before sorting by the sorting thread with the triangle indices of multiple semitransparent meshes sorted by the sorting thread list, so that the main thread can complete the rendering of multiple virtual objects in the image frame based on the triangle index list of multiple translucent meshes sorted by the sorting thread.
其中,对半透明网格进行渲染具体可由渲染引擎来执行,即由主线程将渲染任务交给渲染引擎,由渲染引擎基于图像帧中刷新后的半透明网格的三角形索引列表的从前往后的顺序,对图像帧中的多个虚拟对象进行渲染。Specifically, the rendering of the translucent mesh can be performed by the rendering engine, that is, the main thread passes the rendering task to the rendering engine, and the rendering engine is based on the refreshed translucent mesh in the image frame from front to back in the triangle index list of the translucent mesh order to render multiple virtual objects in the image frame.
图2是根据本说明书的一个实施例提供的虚拟对象渲染方法中主线程的工作流程示意图,包括:2 is a schematic diagram of the workflow of a main thread in a virtual object rendering method provided according to an embodiment of the present specification, including:
步骤21,将待排序的目标虚拟对象的半透明网格加入到半透明网格队列中。
步骤22,确定排序线程单次循环是否结束。Step 22: Determine whether the single cycle of the sorting thread ends.
如果排序线程单次循环结束,则执行步骤23。If the single loop of the sorting thread ends,
步骤23,刷新半透明网格队列中多个半透明网格的三角形索引列表。Step 23: Refresh the triangle index list of multiple translucent meshes in the translucent mesh queue.
步骤24,确定半透明网格队列中多个半透明网格的三角形索引列表是否刷新完成。Step 24: Determine whether the triangular index lists of multiple translucent meshes in the translucent mesh queue are refreshed.
步骤25,通知排序线程下次循环开始。
此时,排序线程可从下一个图像帧的半透明网格队列中拉取待排序的半透明网格进行排序。At this point, the sorting thread can pull the semi-transparent grid to be sorted from the semi-transparent grid queue of the next image frame for sorting.
图3是根据本说明书的一个实施例提供的虚拟对象渲染方法中排序线程的工作流程示意图,包括:3 is a schematic diagram of the workflow of sorting threads in a virtual object rendering method provided according to an embodiment of the present specification, including:
步骤31,遍历新半透明网格队列中待排序的半透明网格,确定其是否为蒙皮网格。Step 31: Traverse the translucent meshes to be sorted in the new translucent mesh queue to determine whether they are skin meshes.
如果待排序的半透明网格为蒙皮网格则执行步骤33,如果待排序的半透明网格不是蒙皮网格则执行步骤32。If the translucent mesh to be sorted is a skinned mesh, go to step 33 , and if the translucent mesh to be sorted is not a skinned mesh, go to step 32 .
步骤32,获取顶点列表信息。
如果待排序的半透明网格不是蒙皮网格,则可直接获取待排序的半透明网格的顶点列表信息。If the translucent mesh to be sorted is not a skinned mesh, the vertex list information of the translucent mesh to be sorted can be directly obtained.
步骤33,获取蒙皮后的顶点列表信息。Step 33: Obtain the vertex list information after skinning.
如果待排序的半透明网格是蒙皮网格,则需要获取蒙皮后的顶点列表信息。If the translucent mesh to be sorted is a skinned mesh, you need to obtain the skinned vertex list information.
步骤34,确定三角形索引列表以及基于三角形索引列表进行排序。Step 34: Determine the triangle index list and sort based on the triangle index list.
本说明书提供的一种或多个实施例,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。In one or more embodiments provided in this specification, the sorting task of the translucent grid of the image frame to be rendered can be handed over to the sorting thread for execution alone, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered, The translucent grid queue includes a plurality of translucent grids, and for each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism, so as to ensure that the image frame contains the translucent grids. The correctness of the rendering effect of the virtual object of the grid in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
图4是本说明书的一个实施例提供的一种虚拟对象渲染系统的结构示意图。图4的系统可包括主线程401和排序线程402,其中:FIG. 4 is a schematic structural diagram of a virtual object rendering system provided by an embodiment of the present specification. The system of FIG. 4 may include a
所述主线程401,采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;The
所述排序线程402,执行如下单次循环过程:The sorting
响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;In response to the sorting notification sent by the main thread, obtain the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, perform sorting on the semi-transparent meshes to be sorted. Sorting the translucent meshes to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知,以使得所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。After completing the sorting of the plurality of translucent grids in the translucent grid queue, a sorting completion notification is sent to the main thread, so that the main thread receives the sorting completion notification and completes the image Rendering of virtual objects in the frame.
可选地,所述排序线程402在执行基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序的步骤时,具体执行:Optionally, when the sorting
确定所述待排序的半透明网格是否为蒙皮网格;determining whether the translucent mesh to be sorted is a skin mesh;
如果所述待排序的半透明网格是蒙皮网格,则基于所述蒙皮网格的相关数据,获取所述待排序的半透明网格中蒙皮后的顶点列表信息;If the translucent mesh to be sorted is a skinned mesh, obtain skinned vertex list information in the translucent mesh to be sorted based on the relevant data of the skinned mesh;
基于所述待排序的半透明网格中蒙皮后的顶点列表信息,确定所述待排序的半透明网格的三角形索引列表;determining, based on the skinned vertex list information in the translucent mesh to be sorted, a triangle index list of the translucent mesh to be sorted;
基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序。The semi-transparent meshes to be sorted are sorted based on the list of triangle indices of the semi-transparent meshes to be sorted.
可选地,所述排序线程402在执行基于所述蒙皮网格的相关数据,获取所述待排序的半透明网格中蒙皮后的顶点列表信息的步骤时,具体执行:Optionally, when the sorting
基于所述蒙皮网格的骨骼矩阵、所述蒙皮网格中的各顶点对应的骨骼权重、所述蒙皮网格的初始顶点列表信息,获取所述蒙皮网格动态下的每帧蒙皮矩阵;Based on the bone matrix of the skinned mesh, the bone weights corresponding to the vertices in the skinned mesh, and the initial vertex list information of the skinned mesh, obtain each frame under the dynamic condition of the skinned mesh skin matrix;
基于所述蒙皮网格动态下的每帧蒙皮矩阵,获取所述蒙皮网格在所述图像帧时刻下的蒙皮矩阵;Obtaining the skin matrix of the skin mesh at the image frame moment based on the skin matrix of each frame under the skin mesh dynamics;
基于所述蒙皮网格在当前时刻下的蒙皮矩阵,确定所述待排序的半透明网格在所述图像帧时刻下的蒙皮后的顶点列表信息。Based on the skinning matrix of the skinned mesh at the current moment, the skinned vertex list information of the translucent mesh to be sorted at the image frame moment is determined.
可选地,所述排序线程402在执行基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序的步骤时,具体执行:Optionally, when the sorting
确定所述待排序的半透明网格的三角形索引列表中的各三角形的中心点;determining the center point of each triangle in the triangle index list of the semitransparent mesh to be sorted;
基于所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标,对所述待排序的半透明网格进行排序。The semitransparent meshes to be sorted are sorted based on the coordinates of the center points of the triangles in the triangle index list of the semitransparent meshes to be sorted.
可选地,所述排序线程402在执行基于所述半透明网格的三角形索引列表中的各三角形的中心点的坐标,对所述半透明网格进行排序的步骤时,具体执行:Optionally, when the sorting
按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,通过插入排序的方式对所述半透明网格的三角形索引列表进行排序。Sort the triangle index list of the translucent mesh by insertion sort according to the distance from the center point of each triangle to the camera in the camera space in descending order.
可选地,所述排序线程402在执行基于所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标,对所述待排序的半透明网格进行排序的步骤时,具体执行:Optionally, when the sorting
将所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标转换到相机空间中,得到相机空间下的各所述三角形的中心点的坐标;Converting the coordinates of the center points of the triangles in the triangle index list of the translucent mesh to be sorted into the camera space to obtain the coordinates of the center points of the triangles in the camera space;
基于所述相机空间下的各所述三角形的中心点的坐标,确定各所述三角形的中心点距离所述相机空间中的相机的距离;determining the distance between the center point of each triangle and the camera in the camera space based on the coordinates of the center point of each triangle in the camera space;
按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,对所述待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted in descending order of the distance between the center point of each triangle and the camera in the camera space.
可选地,所述排序线程402在执行按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,对所述待排序的半透明网格的三角形索引列表进行排序的步骤时,具体执行:Optionally, the sorting
按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,通过插入排序的方式对所述待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted by insertion sort according to the distance from the center point of each triangle to the camera in the camera space in descending order.
可选地,所述主线程401在执行接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染的步骤时,具体执行:Optionally, when the
所述主线程接收所述排序完成通知,并刷新所述多个半透明网格的三角形索引列表;The main thread receives the sorting completion notification, and refreshes the triangle index list of the plurality of translucent meshes;
所述主线程基于所述刷新后的所述多个半透明网格的三角形索引列表,对所述多个半透明网格对应的多个虚拟对象进行渲染,以完成所述图像帧中虚拟对象的渲染。The main thread renders a plurality of virtual objects corresponding to the plurality of translucent grids based on the refreshed triangle index list of the plurality of translucent grids, so as to complete the virtual objects in the image frame rendering.
图4所示实施例相关步骤的具体实现可参考图1~图3所示实施例中对应的步骤的具体实现,本说明书一个或多个实施例在此不再赘述。For the specific implementation of the relevant steps in the embodiment shown in FIG. 4 , reference may be made to the specific implementation of the corresponding steps in the embodiments shown in FIG. 1 to FIG. 3 , and details of one or more embodiments of this specification are not repeated here.
本说明书提供的虚拟对象渲染系统,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。The virtual object rendering system provided in this specification can hand over the sorting task of the translucent grid of the image frame to be rendered to the sorting thread alone, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered. The grid queue includes multiple translucent grids. For each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism, so as to ensure that the virtual objects containing the translucent grids are included in the image frame. The correctness of the rendering effect of the object in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
图5是本说明书的一个实施例提供的一种虚拟对象渲染装置500的结构示意图。请参考图5,在一种软件实施方式中,虚拟对象渲染装置500可包括:FIG. 5 is a schematic structural diagram of a virtual
采集单元501,通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;The
排序单元502,所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;Sorting
发送单元503,当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;The sending
渲染单元504,所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The
本说明书实施例提供的虚拟对象渲染装置,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。The virtual object rendering apparatus provided by the embodiments of this specification can hand over the sorting task of the translucent grid of the image frame to be rendered to the sorting thread alone for execution, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered. The translucent grid queue includes multiple translucent grids, and for each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism to ensure that the image frames contain translucent grids. The correctness of the rendering effect of the virtual object in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
可选地,在一种实施方式中,所述排序单元502在执行基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序时,具体执行:Optionally, in an implementation manner, when the
确定所述待排序的半透明网格是否为蒙皮网格;determining whether the translucent mesh to be sorted is a skinned mesh;
如果所述待排序的半透明网格是蒙皮网格,则基于所述蒙皮网格的相关数据,获取所述待排序的半透明网格中蒙皮后的顶点列表信息;If the translucent mesh to be sorted is a skinned mesh, obtain skinned vertex list information in the translucent mesh to be sorted based on the relevant data of the skinned mesh;
基于所述待排序的半透明网格中蒙皮后的顶点列表信息,确定所述待排序的半透明网格的三角形索引列表;determining, based on the skinned vertex list information in the translucent mesh to be sorted, a triangle index list of the translucent mesh to be sorted;
基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序。The semi-transparent meshes to be sorted are sorted based on the list of triangle indices of the semi-transparent meshes to be sorted.
可选地,在一种实施方式中,所述排序单元502在执行基于所述蒙皮网格的相关数据,获取所述待排序的半透明网格中蒙皮后的顶点列表信息,具体执行:Optionally, in an implementation manner, the
基于所述蒙皮网格的骨骼矩阵、所述蒙皮网格中的各顶点对应的骨骼权重、所述蒙皮网格的初始顶点列表信息,获取所述蒙皮网格动态下的每帧蒙皮矩阵;Based on the skeleton matrix of the skinned mesh, the bone weights corresponding to the vertices in the skinned mesh, and the initial vertex list information of the skinned mesh, obtain each frame under the dynamic condition of the skinned mesh skin matrix;
基于所述蒙皮网格动态下的每帧蒙皮矩阵,获取所述蒙皮网格在所述图像帧时刻下的蒙皮矩阵;Obtaining the skin matrix of the skin mesh at the image frame moment based on the skin matrix of each frame under the skin mesh dynamics;
基于所述蒙皮网格在当前时刻下的蒙皮矩阵,确定所述待排序的半透明网格在所述图像帧时刻下的蒙皮后的顶点列表信息。Based on the skinning matrix of the skinned mesh at the current moment, the skinned vertex list information of the translucent mesh to be sorted at the image frame moment is determined.
可选地,在一种实施方式中,所述排序单元502在执行基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,具体执行:Optionally, in an implementation manner, the
确定所述待排序的半透明网格的三角形索引列表中的各三角形的中心点;determining the center point of each triangle in the triangle index list of the semitransparent mesh to be sorted;
基于所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标,对所述待排序的半透明网格进行排序。The semi-transparent meshes to be sorted are sorted based on the coordinates of the center points of the triangles in the triangle index list of the semi-transparent meshes to be sorted.
可选地,在一种实施方式中,所述排序单元502在执行基于所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标,对所述待排序的半透明网格进行排序,具体执行:Optionally, in an implementation manner, the
将所述待排序的半透明网格的三角形索引列表中的各三角形的中心点的坐标转换到相机空间中,得到相机空间下的各所述三角形的中心点的坐标;Converting the coordinates of the center points of the triangles in the triangle index list of the translucent mesh to be sorted into the camera space to obtain the coordinates of the center points of the triangles in the camera space;
基于所述相机空间下的各所述三角形的中心点的坐标,确定各所述三角形的中心点距离所述相机空间中的相机的距离;determining the distance between the center point of each triangle and the camera in the camera space based on the coordinates of the center point of each triangle in the camera space;
按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,对所述待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted in descending order of the distance between the center point of each triangle and the camera in the camera space.
可选地,在一种实施方式中,所述排序单元502在执行按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,对所述待排序的半透明网格的三角形索引列表进行排序,具体执行:Optionally, in an implementation manner, the
按照各所述三角形的中心点距离所述相机空间中的相机的距离由大到小的顺序,通过插入排序的方式对所述待排序的半透明网格的三角形索引列表进行排序。Sort the triangle index list of the semi-transparent mesh to be sorted by insertion sort according to the distance from the center point of each triangle to the camera in the camera space in descending order.
可选地,在一种实施方式中,所述渲染单元504在执行所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染,具体执行:Optionally, in an implementation manner, the
所述主线程接收所述排序完成通知,并刷新所述多个半透明网格的三角形索引列表;The main thread receives the sorting completion notification, and refreshes the triangle index list of the plurality of translucent meshes;
所述主线程基于所述刷新后的所述多个半透明网格的三角形索引列表,对所述多个半透明网格对应的多个虚拟对象进行渲染,以完成所述图像帧中虚拟对象的渲染。The main thread renders a plurality of virtual objects corresponding to the plurality of translucent grids based on the refreshed triangle index list of the plurality of translucent grids, so as to complete the virtual objects in the image frame rendering.
虚拟对象渲染装置500能够实现图1~图3的方法实施例的方法,具体可参考图1~图3所示实施例的虚拟对象渲染装置方法,不再赘述。The virtual
图6是本说明书的一个实施例电子设备的结构示意图。请参考图6,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to FIG. 6 , at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The memory may include memory, such as high-speed random-access memory (Random-Access Memory, RAM), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Of course, the electronic equipment may also include hardware required for other services.
处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(PeripheralComponent Interconnect,外设部件互连标准)总线或EISA(Extended Industry StandardArchitecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The processor, the network interface, and the memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture, industry standard architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard) bus. StandardArchitecture, extended industry standard structure) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bidirectional arrow is shown in FIG. 6, but it does not mean that there is only one bus or one type of bus.
存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。memory for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include memory and non-volatile memory and provide instructions and data to the processor.
处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成虚拟对象渲染装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:The processor reads the corresponding computer program from the non-volatile memory into the memory and then executes it, forming a virtual object rendering device on a logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:
通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;Collect a translucent grid queue of image frames to be rendered through the main thread, and send a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;The sorting thread, in response to the sorting notification sent by the main thread, acquires the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, for all the semi-transparent meshes to be sorted. Sorting the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;After the sorting thread finishes sorting the plurality of translucent grids in the translucent grid queue, sending a sorting completion notification to the main thread;
所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
本说明书实施例提供的电子设备,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。The electronic device provided by the embodiments of this specification can hand over the sorting task of the translucent grid of the image frame to be rendered to the sorting thread alone for execution, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered. The grid queue includes multiple translucent grids. For each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism, so as to ensure that the virtual objects containing the translucent grids are included in the image frame. The correctness of the rendering effect of the object in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
上述如本说明书图1~图3所示实施例揭示的虚拟对象渲染装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central ProcessingUnit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本说明书实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本说明书实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。The above-mentioned methods performed by the virtual object rendering apparatus disclosed in the embodiments shown in FIG. 1 to FIG. 3 of this specification may be applied to a processor, or implemented by a processor. A processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software. The above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit ( Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the methods disclosed in conjunction with the embodiments of this specification may be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
该电子设备还可执行图1~图3的方法,并实现虚拟对象渲染装置在图4所示实施例的功能,本说明书实施例在此不再赘述。The electronic device can also execute the methods shown in FIGS. 1 to 3, and implement the functions of the virtual object rendering apparatus in the embodiment shown in FIG.
本说明书实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的便携式电子设备执行时,能够使该便携式电子设备执行图1~图3所示实施例的方法,并具体用于执行以下操作:The embodiments of the present specification also provide a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs include instructions, and the instructions, when used by a portable electronic device including a plurality of application programs During execution, the portable electronic device can be made to execute the method of the embodiment shown in FIG. 1 to FIG. 3 , and is specifically configured to execute the following operations:
通过主线程采集待渲染图像帧的半透明网格队列,并向排序线程发送排序通知,所述半透明网格队列中包括多个半透明网格,一个半透明网格对应于一个虚拟对象;Collect a translucent grid queue of image frames to be rendered through the main thread, and send a sorting notification to the sorting thread, the translucent grid queue includes a plurality of translucent grids, and one translucent grid corresponds to one virtual object;
所述排序线程响应于所述主线程发送的排序通知,获取所述半透明网格队列中待排序的半透明网格,并基于所述待排序的半透明网格的三角形索引列表,对所述待排序的半透明网格进行排序,以确定所述待排序的半透明网格中三角形面的渲染顺序;The sorting thread, in response to the sorting notification sent by the main thread, acquires the semi-transparent meshes to be sorted in the semi-transparent mesh queue, and based on the triangle index list of the semi-transparent meshes to be sorted, for all the semi-transparent meshes to be sorted. Sorting the translucent meshes to be sorted to determine the rendering order of the triangular faces in the translucent meshes to be sorted;
当所述排序线程完成对所述半透明网格队列中所述多个半透明网格的排序后,向所述主线程发送排序完成通知;After the sorting thread finishes sorting the plurality of translucent grids in the translucent grid queue, sending a sorting completion notification to the main thread;
所述主线程接收所述排序完成通知并完成所述图像帧中虚拟对象的渲染。The main thread receives the sorting completion notification and completes the rendering of the virtual objects in the image frame.
本说明书实施例提供的计算机可读存储介质,能够将待渲染图像帧的半透明网格的排序任务单独交由排序线程来执行,主线程则负责采集待渲染图像帧的半透明网格队列,该半透明网格队列中包括多个半透明网格,对每一个图像帧都通过多线程机制对其中包含有半透明网格的虚拟对象进行实时渲染,以保证图像帧中包含有半透明网格的虚拟对象在动态状态下渲染效果的正确性。而且采用多线程机制进行每个图像帧中半透明网格的排序,也充分利用了多核CPU的优势性能,提高了半透明网格的排序效率,并省去手动对半透明网格进行排序操作耗费的资源。The computer-readable storage medium provided by the embodiments of this specification can hand over the sorting task of the translucent grid of the image frame to be rendered to the sorting thread alone for execution, and the main thread is responsible for collecting the translucent grid queue of the image frame to be rendered, The translucent grid queue includes a plurality of translucent grids, and for each image frame, the virtual objects containing the translucent grids are rendered in real time through a multi-threading mechanism, so as to ensure that the image frame contains the translucent grids. The correctness of the rendering effect of the virtual object of the grid in the dynamic state. Moreover, the multi-threading mechanism is used to sort the translucent grids in each image frame, which also makes full use of the superior performance of multi-core CPUs, improves the sorting efficiency of the translucent grids, and saves the need to manually sort the translucent grids. expended resources.
当然,除了软件实现方式之外,本说明书的电子设备并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Of course, in addition to software implementations, the electronic devices in this specification do not exclude other implementations, such as logic devices or the combination of software and hardware, etc. That is to say, the execution subjects of the following processing procedures are not limited to each logic unit. It can also be a hardware or logic device.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
总之,以上所述仅为本说明书的较佳实施例而已,并非用于限定本说明书的保护范围。凡在本说明书的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本说明书的保护范围之内。In a word, the above descriptions are only preferred embodiments of the present specification, and are not intended to limit the protection scope of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the protection scope of this specification.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device comprising a series of elements includes not only those elements, but also Other elements not expressly listed, or which are inherent to such a process, method, article of manufacture, or apparatus are also included. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article of manufacture, or device that includes the element.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210611220.2A CN114911625B (en) | 2022-05-31 | 2022-05-31 | Virtual object rendering method, device, system and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210611220.2A CN114911625B (en) | 2022-05-31 | 2022-05-31 | Virtual object rendering method, device, system and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114911625A true CN114911625A (en) | 2022-08-16 |
CN114911625B CN114911625B (en) | 2025-06-06 |
Family
ID=82770692
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210611220.2A Active CN114911625B (en) | 2022-05-31 | 2022-05-31 | Virtual object rendering method, device, system and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114911625B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070103462A1 (en) * | 2005-11-09 | 2007-05-10 | Miller Gavin S | Method and apparatus for rendering semi-transparent surfaces |
CN104008525A (en) * | 2014-06-06 | 2014-08-27 | 无锡梵天信息技术股份有限公司 | Low-resolution particle drawing method for improving resolution based on double buffering |
CN106803278A (en) * | 2016-12-07 | 2017-06-06 | 珠海金山网络游戏科技有限公司 | A kind of translucent layer sorting method and system of virtual portrait |
CN107507262A (en) * | 2017-08-31 | 2017-12-22 | 城市生活(北京)资讯有限公司 | A kind of three-dimensional rendering method and system of large scene |
CN109669739A (en) * | 2017-10-16 | 2019-04-23 | 阿里巴巴集团控股有限公司 | A kind of interface rendering method, device, terminal device and storage medium |
CN109741413A (en) * | 2018-12-29 | 2019-05-10 | 北京金山安全软件有限公司 | Rendering method and device for semitransparent objects in scene and electronic equipment |
CN114387374A (en) * | 2022-01-13 | 2022-04-22 | 北京中航双兴科技有限公司 | Terrain rendering method and device |
-
2022
- 2022-05-31 CN CN202210611220.2A patent/CN114911625B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070103462A1 (en) * | 2005-11-09 | 2007-05-10 | Miller Gavin S | Method and apparatus for rendering semi-transparent surfaces |
CN104008525A (en) * | 2014-06-06 | 2014-08-27 | 无锡梵天信息技术股份有限公司 | Low-resolution particle drawing method for improving resolution based on double buffering |
CN106803278A (en) * | 2016-12-07 | 2017-06-06 | 珠海金山网络游戏科技有限公司 | A kind of translucent layer sorting method and system of virtual portrait |
CN107507262A (en) * | 2017-08-31 | 2017-12-22 | 城市生活(北京)资讯有限公司 | A kind of three-dimensional rendering method and system of large scene |
CN109669739A (en) * | 2017-10-16 | 2019-04-23 | 阿里巴巴集团控股有限公司 | A kind of interface rendering method, device, terminal device and storage medium |
CN109741413A (en) * | 2018-12-29 | 2019-05-10 | 北京金山安全软件有限公司 | Rendering method and device for semitransparent objects in scene and electronic equipment |
CN114387374A (en) * | 2022-01-13 | 2022-04-22 | 北京中航双兴科技有限公司 | Terrain rendering method and device |
Also Published As
Publication number | Publication date |
---|---|
CN114911625B (en) | 2025-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020220915A1 (en) | Virtual object display method and apparatus, electronic device, and storage medium | |
TWI376641B (en) | Multi-threads vertex shader, graphics processing unit, and flow control method thereof | |
US20250022216A1 (en) | Shader binding management in ray tracing | |
CN104468777B (en) | Data manipulation method and device | |
CN105095261A (en) | Data insertion method and device | |
JP6882992B2 (en) | How and devices to preview moving images, and how and devices to display representation packages | |
CN103455396A (en) | Test method and test device of hardware performance of electronic equipment | |
CN111462283B (en) | Method, medium, device and apparatus for playing large number of same character animations | |
WO2020233709A1 (en) | Model compression method, and device | |
CN114596423A (en) | Model rendering method, device and computer equipment based on virtual scene meshing | |
US11966765B2 (en) | Memory bandwidth throttling for virtual machines | |
CN116302363A (en) | Virtual machine creation method, system, computer equipment and storage medium | |
CN119917208A (en) | Display interface layout control method and system based on user operation analysis | |
CN102810133A (en) | Ray query method for network game, and scene server | |
CN107273124A (en) | The processing method of running software performance information, apparatus and system | |
WO2022262856A1 (en) | Model loading method and apparatus for head-mounted display device, and head-mounted display device | |
CN114911625A (en) | Virtual object rendering method, device and system and electronic equipment | |
CN118036668B (en) | GPT model-oriented comprehensive evaluation method | |
CN115576681A (en) | Scheduling in a container orchestration system using hardware topology hints | |
EP3559813B1 (en) | Parallel replay of executable code | |
CN103714511B (en) | GPU-based branch processing method and device | |
CN115809956B (en) | Graphics processor performance analysis method, device, computer equipment and storage medium | |
CN119045710B (en) | Picture sector display switching method and related system | |
CN112433841A (en) | Resource pool scheduling method, system, server and storage medium | |
CN118338003B (en) | Video decoding method, apparatus, computer device, readable storage medium, and program product |
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 |