Object rendering method, apparatus, device, and storage medium

By determining the position and spatial relationship of the circumcircle center of a semi-transparent object, the problem of balancing rendering accuracy and performance overhead in existing technologies is solved, achieving efficient and accurate rendering of semi-transparent objects.

CN121527281BActive Publication Date: 2026-05-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-16
Publication Date
2026-05-22

Smart Images

  • Figure CN121527281B_ABST
    Figure CN121527281B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an object rendering method and device, equipment and a storage medium, belonging to the technical field of computer, the method comprises: obtaining a model corresponding to an object, the model is used to represent the shape of a primitive in the object and the spatial position of the primitive, and the object has a visual characteristic of allowing part of light to pass through; determining the circumcircle center position of the primitive based on a vertex set corresponding to the primitive in the model; determining the spatial position relationship of at least two primitives based on the circumcircle center positions of the at least two primitives; and rendering the object model according to the rendering order of the at least two primitives determined based on the spatial position relationship, to obtain a rendering result of the object. The present application realizes the consideration of semi-transparent object rendering precision and performance overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to object rendering methods, apparatus, devices and storage media. Background Technology

[0002] Semi-transparent materials are those that allow some light to pass through, but do not completely and clearly reveal the characteristics of objects behind them. These materials are neither completely transparent nor completely opaque. Currently, rendering schemes for semi-transparent objects mainly include order-independent and order-dependent schemes. The order refers to the rendering sequence of different primitives used to compose the semi-transparent object. Order-independent schemes have a higher probability of errors in occlusion relationships between different parts of the object, resulting in generally lower rendering accuracy. Order-dependent schemes, on the other hand, incur significant runtime overhead. Therefore, these technologies generally suffer from the problem of balancing rendering accuracy and performance overhead when rendering semi-transparent objects. Summary of the Invention

[0003] This application provides an object rendering method, apparatus, device, and storage medium to solve at least one of the aforementioned technical problems.

[0004] According to one aspect of the embodiments of this application, an object rendering method is provided, the method comprising:

[0005] Obtain the model corresponding to the object, the model being used to characterize the shape of the primitives in the object and the spatial position of the primitives, the object having the visual characteristic of allowing some light to pass through;

[0006] Based on the set of vertices corresponding to the primitives in the model, determine the position of the circumcircle center of the primitive;

[0007] The spatial relationship between the at least two graphic elements is determined based on the positions of the centers of their respective circumcircles.

[0008] The object model is rendered according to the rendering order of the at least two primitives determined based on the spatial relationship, and the rendering result of the object is obtained.

[0009] According to another aspect of the embodiments of this application, an object rendering apparatus is provided, the apparatus comprising:

[0010] The model acquisition module is used to acquire the model corresponding to the object. The model is used to represent the shape of the primitives in the object and the spatial position of the primitives. The object has the visual characteristic of allowing some light to pass through.

[0011] The circumcircle center determination module is used to determine the position of the circumcircle center of the primitive based on the vertex set corresponding to the primitive in the model;

[0012] The positional relationship determination module is used to determine the spatial positional relationship of the at least two graphic elements based on the center positions of their respective circumcircles.

[0013] The rendering module is used to render the object model according to the rendering order of the at least two primitives determined based on the spatial position relationship, and obtain the rendering result of the object.

[0014] In an exemplary embodiment, the spatial positional relationship of the at least two primitives includes an occlusion relationship characterizing the first primitive being occluded by the second primitive, wherein the first primitive and the second primitive belong to the at least two primitives; the rendering module is configured to:

[0015] Render the first primitive to obtain the rendering result of the first primitive;

[0016] After rendering the first primitive, the second primitive is rendered to obtain the rendering result of the second primitive;

[0017] The rendering result of the object includes the rendering result of the first primitive and the rendering result of the second primitive.

[0018] In one exemplary embodiment, the rendering module is configured to:

[0019] Based on the spatial relationship between the at least two graphic elements, the at least two graphic elements are sorted to obtain a graphic element sorting result; in the graphic element sorting result, if the third graphic element is located before the fourth graphic element, the spatial relationship between the third graphic element and the fourth graphic element includes: the third graphic element is occluded by the fourth graphic element, or the third graphic element and the fourth graphic element do not occlude each other, and the third graphic element and the fourth graphic element are any two graphic elements in the graphic element sequence;

[0020] Each element in the element sorting result is rendered sequentially to obtain the rendering result of the object.

[0021] In one exemplary embodiment, the positional relationship determination module is configured to:

[0022] The bounding box corresponding to the model is divided in a manner perpendicular to the line of sight to obtain at least two spatial regions;

[0023] The spatial region into which the circumcircle center of a graphic element falls is defined as the spatial region corresponding to the graphic element.

[0024] Based on the spatial region corresponding to each of the at least two graphic elements, determine the spatial location code of each graphic element.

[0025] The spatial positional relationship between the at least two graphic elements is determined based on the spatial position code of each graphic element in the at least two graphic elements.

[0026] In one exemplary embodiment, the positional relationship determination module is configured to:

[0027] The at least two spatial regions are sequentially sorted in ascending order along the line of sight from far to near to obtain the region identifiers corresponding to each of the at least two spatial regions.

[0028] Based on the spatial region corresponding to each graphic element and the region identifier corresponding to each spatial region, the spatial location code of each graphic element is determined.

[0029] In one exemplary embodiment, the positional relationship determination module is configured to perform the following operation for the fifth graphic element among the graphic elements:

[0030] Determine a first region identifier, which is the region identifier of the spatial region where the fifth graphic element is located;

[0031] If the first region identifier is not the smallest region identifier, count the total number of graphic elements whose circumcircle centers fall into the spatial region corresponding to the second region identifier, where the second region identifier is less than the first region identifier.

[0032] Based on the total quantity, the spatial location code of the fifth graphic element is determined.

[0033] In one exemplary embodiment, the rendering module is configured to:

[0034] Based on the spatial position codes of each of the graphic elements indicating the spatial positional relationships between different graphic elements, the vertices of each of the graphic elements are sorted to determine the vertex index of each vertex of each graphic element.

[0035] Based on the vertex index of each vertex of each primitive, the rendering order of each vertex in the object model is determined;

[0036] Based on the rendering order, the object model is rendered to obtain the rendering result of the object.

[0037] In one exemplary embodiment, the rendering module is configured to:

[0038] The vertices of the relevant primitives are encoded sequentially in ascending order of spatial location codes to obtain the vertex index of each vertex of each primitive.

[0039] The rendering order of each vertex in the object model is determined according to the ascending order of the vertex index.

[0040] In one exemplary embodiment, the graphic element is a triangular graphic element, and the circumcircle center determination module is used for:

[0041] Obtain a first vector and a second vector, wherein the first vector and the second vector respectively represent the first side and the second side of the primitive;

[0042] Based on the first vector and the second vector, determine the normal vector perpendicular to the primitive;

[0043] The position of the circumcenter of the primitive is determined by squaring the first vector and the second vector, and using the normal vector.

[0044] In one exemplary embodiment, the positional relationship determination module is configured to:

[0045] Transform the model from world space to view space.

[0046] In one exemplary embodiment, the positional relationship determination module is configured to:

[0047] Based on the scene information corresponding to the model, the segmentation granularity is determined;

[0048] Based on the segmentation granularity, the bounding box corresponding to the model is segmented in a manner perpendicular to the line of sight to obtain the at least two spatial regions.

[0049] In one exemplary implementation, the scene information corresponding to the model includes at least one of the following:

[0050] The complexity of the model;

[0051] Rendering quality requirements;

[0052] Rendering speed requirements;

[0053] The model is viewed from the perspective of the observation camera.

[0054] In one exemplary embodiment, the model acquisition module is configured to:

[0055] Receive first scene description data, the first scene description data including the identifier of the object and the first state data of the object in the scene;

[0056] Based on the first scene description data, obtain the model corresponding to the object;

[0057] The rendering module is used for:

[0058] Based on the rendering result of the object, the first video frame corresponding to the first scene description data is obtained.

[0059] In one exemplary embodiment, the rendering module is configured to:

[0060] Receive second scene description data, the second scene description data including the identifier of the object and the second state data of the object in the scene;

[0061] A second video frame corresponding to the second scene description data is generated, and the second video frame is the next video frame after the first video frame.

[0062] In one exemplary embodiment, the rendering module is configured to:

[0063] Send a video stream, the video stream including the first video frame and the second video frame.

[0064] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the above-described object rendering method.

[0065] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, the storage medium storing at least one instruction, the at least one instruction being loaded and executed by a processor to implement the above-described object rendering method.

[0066] According to one aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform an action to implement the object rendering method described above.

[0067] The technical solution provided in this application can bring the following beneficial effects:

[0068] This application proposes an object rendering method. This method can first obtain the model corresponding to a semi-transparent object. A semi-transparent object refers to an object with the visual characteristic of allowing some light to pass through. The model corresponding to the semi-transparent object refers to the spatial image of the semi-transparent object, which represents the shape of the primitives used to compose the semi-transparent object and the spatial position of the primitives.

[0069] This application embodiment determines the circumcenter of a primitive, and the distance from the circumcenter to each vertex of the primitive is equal, thus more accurately representing the "overall position" of the primitive in space. Based on the position of the circumcenter, the spatial positional relationship of different primitives can be accurately determined. Especially for primitives that are close in space, the accuracy of the determination of their spatial positional relationship can be significantly improved, thereby more accurately determining the rendering order of different primitives. By improving the rationality and accuracy of the rendering order, the error in the occlusion relationship between different parts of a semi-transparent object is significantly reduced, and the rendering accuracy is improved. Furthermore, the process of calculating the circumcenter in this application embodiment is very short, which significantly improves the rendering speed, thus ensuring a balance between rendering accuracy and performance overhead. Attached Figure Description

[0070] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0071] Some of the accompanying drawings in this application are in color. Because this application involves semi-transparent object rendering technology, the rendering effects of different parts of a semi-transparent object rendered in different rendering orders need to be distinguished by color. To ensure clarity of expression in the specification, this application provides corresponding grayscale drawings while retaining the color drawings for review purposes.

[0072] Figure 1 This is a schematic diagram of a semi-transparent object rendering result in the related technology provided in one embodiment of this application. Figure 1 ;

[0073] Figure 2 This is a schematic diagram of a semi-transparent object rendering result in the related technology provided in one embodiment of this application. Figure 2 ;

[0074] Figure 3 This is a schematic diagram of a semi-transparent object rendering result in the related technology provided in one embodiment of this application. Figure 3 ;

[0075] Figure 4 This is a schematic diagram of an application runtime environment provided in one embodiment of this application;

[0076] Figure 5 This is a flowchart of an object rendering method provided in one embodiment of this application;

[0077] Figure 6 This is a schematic diagram of a spatial position relationship determination method provided in one embodiment of this application;

[0078] Figure 7 This is a schematic diagram of a spatial location code determination method provided in one embodiment of this application;

[0079] Figure 8 This is a schematic diagram of a method for rendering a model corresponding to a rendering object according to an embodiment of this application;

[0080] Figure 9 This is a schematic diagram of an object rendering process provided in one embodiment of this application;

[0081] Figure 10 This is a schematic diagram of the rendering result of an object rendering method provided in one embodiment of this application;

[0082] Figure 11 This is a schematic diagram comparing the rendering results of the object rendering method proposed in this application with those of related technologies, provided in one embodiment of this application. Figure 1 ;

[0083] Figure 12 This is a schematic diagram comparing the rendering results of the object rendering method proposed in this application with those of related technologies, provided in one embodiment of this application. Figure 2 ;

[0084] Figure 13 This is a block diagram of an object rendering apparatus provided in one embodiment of this application;

[0085] Figure 14 This is a structural block diagram of a computer device provided in one embodiment of this application;

[0086] Figure 15 This is a structural block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0087] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0088] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present application described herein can be implemented in orders other than those illustrated or described herein. Thus, features defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments, unless otherwise stated, "a plurality of" means two or more. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0089] To make the objectives, technical solutions, and advantages disclosed in the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. To facilitate a deeper understanding of the embodiments of this application, the relevant background of the embodiments of this application will first be explained:

[0090] A semi-transparent object is an object that allows some light to pass through. The challenge in rendering such an object lies in ensuring the realism of its transparency. The transparency of a semi-transparent object can fluctuate within a certain range, as long as it allows some light, rather than all light, to pass through. For example, a semi-transparent object can be an object made of materials such as glass, silk, or satin.

[0091] The rendering effect of semi-transparent objects has a significant impact on the realism of a scene. Accurately rendering semi-transparent objects can dramatically enhance the realism and vividness of a scene. Taking game scenes as an example, correctly displaying semi-transparent objects plays a crucial role in improving the visual quality of the game and enhancing player immersion.

[0092] For example, in a game, when a player walks through a forest made of translucent materials, the interaction between fog and light directly affects the overall visual appeal. If the translucent nature of the fog is accurately rendered, the light spots and shadows formed by sunlight filtering through the fog will appear more natural, thus enhancing the player's immersion in the virtual world.

[0093] Furthermore, in the field of film and television production, the accurate rendering of translucent objects is equally crucial. For example, when simulating water surfaces or glass windows, if the translucent effect of the water surface is not accurately rendered, details such as swaying aquatic plants and swimming fish will appear blurry and distorted, failing to create a crystal-clear visual experience. On the other hand, when the translucent characteristics of glass windows are accurately rendered, the changes in light and shadow outside the window can naturally be reflected into the interior through the glass. The refracted light spots on the edge of the glass under sunlight intertwine with the projections of objects inside, making the entire picture more layered and spatially deep, allowing the audience to feel as if they are actually there.

[0094] By optimizing rendering algorithms, these materials can present a more realistic visual effect under different lighting conditions, bringing viewers a more impactful visual experience. Related technologies for rendering objects in a scene typically rely on a standard rasterization process. This process usually assumes the object is opaque and uses the depth values ​​of various primitives within the object to determine which primitives need to be drawn and the order in which they are drawn. Specifically, based on the depth values ​​between different primitives, it determines which primitives are in front (near) and which are behind (far) in the viewing direction, and then draws the different primitives in the object in a "near to far" order. However, this application proposes that semi-transparent objects typically lack depth values, making it difficult to determine the spatial relationships between different primitives using depth values. Furthermore, even if the relative positions of different primitives can be determined, drawing them in a "near to far" order cannot achieve a semi-transparent effect, making the rendering of semi-transparent objects a persistent challenge.

[0095] This application proposes that different elements in a semi-transparent object should be drawn in a "from far to near" order as much as possible. Only in this way can the correct color mixing of different elements in the semi-transparent object be achieved. However, the related technology currently lacks a technical solution that can effectively achieve drawing different elements in an object in a "from far to near" order, which leads to visual defects in the rendered semi-transparent object.

[0096] Furthermore, this application proposes a technical solution that manages the display order of pixels of semi-transparent objects through a per-pixeled linked list. This technical solution requires a large amount of video memory to store the linked list and needs to use the dynamic memory access mode of the linked list to render pixels in order, resulting in huge performance overhead, raising the hardware threshold, high operating load, and severely limiting the scenarios. It cannot be applied to high real-time scenarios and mobile rendering scenarios. This is essentially because the idea of ​​solving the display order problem by recording the display order at the pixel level is difficult to meet the efficiency and compatibility requirements of modern graphics rendering, and this pixel-level solution is not suitable for rendering semi-transparent objects.

[0097] Furthermore, this application embodiment also proposes that some solutions in related technologies may lead to errors in the representation of occlusion relationships between primitives due to the inability to accurately determine the spatial positional relationships between primitives, resulting in rendering errors of semi-transparent objects. For example, if the centroid of a primitive is used as a reference to determine the spatial positional relationships between primitives, the probability of incorrect representation of occlusion relationships between primitives will increase significantly, leading to a high probability of rendering errors for semi-transparent objects.

[0098] Please refer to Figure 1 It illustrates the rendering result of a semi-transparent object in the related technology proposed in the embodiments of this application. Figure 1 . Figure 1 Figure (a) in the image is a color image. Figure 1 Figure (b) is Figure 1 The grayscale image corresponding to image (a) in the image. Figure 1 The cube in figure (a) is a semi-transparent object. Figure 1 In Figure (a), the right side of the cube appears blue-purple, but this blue-purple color is projected onto the primitives on the front of the cube, causing a rendering error.

[0099] This application further proposes that the scheme of using the center of gravity of primitives as a reference to determine the spatial positional relationship between primitives and then rendering semi-transparent objects is more likely to make errors when expressing the spatial positional relationship of close primitives when the viewing direction is relatively off, thus leading to rendering errors. In other words, the more off the viewing direction, the higher the probability of error. With the deviation of the viewing direction, the probability of error increases dramatically, which further leads to poor rendering effect of this type of technical solution.

[0100] Please refer to Figure 2 It illustrates the rendering result of a semi-transparent object in the related technology proposed in the embodiments of this application. Figure 2 . Figure 2 Figure (a) in the image is a color image. Figure 2 Figure (b) is Figure 2 The grayscale image corresponding to image (a) in the image. Figure 2 The cube in figure (a) is a semi-transparent object. Figure 2 In Figure (a), when the cube is in the center of the image, the rendering of each element is correct. However, when the cube moves to the edge of the image, the viewpoint is off-center, and an error occurs. Side elements are rendered before bottom elements, which breaks the "from far to near" rendering rule and results in a rendering error.

[0101] Please refer to Figure 3 It illustrates the rendering result of a semi-transparent object in the related technology proposed in the embodiments of this application. Figure 3 , Figure 3Figure (a) in the image is in color. Figure 3 Image (b) in the image is the corresponding grayscale image. Figure 3 The primitives of semi-transparent objects are represented using triangular facets. The leftmost element of the data table is the natural order number, the middle element is the vertex number, and the rightmost element is the vertex position information. It can be seen that if the centroid of the primitives is used as a reference to determine the spatial relationship between primitives, the facet consisting of vertices numbered 30-32-28 will be located at -178.0 to -178.9, and the facet consisting of vertices numbered 0-1-2 will be located at -178.0 to -228.0. In fact, the facet consisting of vertices numbered 0-1-2 is farther away, while the facet consisting of vertices numbered 30-32-28 is closer. However, using the centroid as a reference will misjudge the facet consisting of vertices numbered 0-1-2 as closer and the facet consisting of vertices numbered 30-32-28 as farther away, leading to an error in calculating the spatial relationship between different faces and thus causing an error in the rendering order.

[0102] This application proposes that, when the viewing direction is off-center (e.g., a semi-transparent object is located at the edge of the image), the distance calculation error between adjacent triangles is significant, leading to misjudgment of spatial relationships and rendering errors. This is because the barycentric coordinates only represent the "geometric center" of the primitive and do not consider the "projected position" of the primitive in view space. Primitives are rendered based on the spatial region they occupy. When the viewing direction shifts, the distance difference between the barycentric coordinates of adjacent primitives is minimal. If this difference is less than the width of the spatial region, it will lead to incorrect spatial region mapping, resulting in rendering order errors. Moreover, the barycentric coordinates are sensitive to the shape of the primitive; if the primitive is an obtuse triangle with "unevenly distributed vertices," the probability of rendering errors is even higher.

[0103] In summary, existing technologies lack a solution that can balance rendering efficiency with improving rendering accuracy and reducing rendering sorting errors for semi-transparent objects. Therefore, these technologies struggle to achieve fast and accurate rendering of semi-transparent objects, especially when the viewing direction is off-center. In view of this, this application proposes an object rendering method to achieve highly efficient and accurate rendering of semi-transparent objects.

[0104] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be noted that all data used in the embodiments of this application has been fully authorized by the relevant parties before use.

[0105] Please refer to Figure 4This diagram illustrates an application runtime environment provided in one embodiment of this application under an exemplary implementation. The application can be any program capable of object rendering. The application runtime environment may include a terminal 10 and a server 20. This embodiment can be implemented independently on the terminal 10, or it can be implemented jointly based on the terminal 10 and the server 20.

[0106] Terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, game consoles, e-book readers, multimedia playback devices, and wearable devices. Terminal 10 can have user clients on which applications can be installed.

[0107] In this embodiment, the application described above can be any application that can provide object rendering services. Typically, the application is a game application. Of course, in addition to game applications, other types of applications can also provide object rendering services. For example, cloud service applications, e-commerce applications, social applications, search applications, interactive entertainment applications, browser applications, content sharing applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., are not limited in this embodiment. Optionally, the terminal 10 is a user client running the above-mentioned application.

[0108] Server 20 can be used to provide background services for the user terminals of applications in terminal 10. For example, server 20 can be a background server for the aforementioned applications. Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, server 20 can simultaneously provide background services for applications in multiple terminals 10.

[0109] Optionally, terminal 10 and server 20 can communicate with each other via network 30. Terminal 10 and server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0110] Please refer to Figure 5The diagram illustrates a flowchart of an object rendering method according to an embodiment of this application. This method can be applied to a computer device, which refers to an electronic device capable of data computation and processing. For example, the entity executing each step may be... Figure 4 The relevant devices in the runtime environment of the object rendering method shown, such as terminal 10, server 20, or the steps are executed collaboratively by terminal 10 and server 20. Next, regarding... Figure 5 The object rendering method described in the detailed explanation includes the following steps:

[0111] S510. Obtain the model corresponding to the object, the model being used to characterize the shape of the primitives in the object and the spatial position of the primitives, the object having the visual characteristic of allowing some light to pass through.

[0112] The object rendering method proposed in this application targets semi-transparent objects. A semi-transparent object refers to an object that allows some light to pass through; it is neither completely transparent nor completely opaque. In practical applications, the materials of semi-transparent objects often possess unique optical properties, such as frosted glass, ice, smoke, or water. These materials can reflect some light while allowing others to pass through, thus creating complex lighting effects. The rendering effect of semi-transparent objects can significantly enhance the realism and immersion of virtual scenes, especially in game development, film and television special effects production, and architectural design visualization. Furthermore, accurate rendering of semi-transparent objects can provide more intuitive simulation results for scientific research, such as in fluid dynamics analysis or biological tissue imaging.

[0113] In this embodiment, the core function of the model is to accurately describe the geometry of primitives within a semi-transparent object and their specific locations in three-dimensional space. This description includes not only the basic shapes of the primitives, such as points, lines, surfaces, or volumes, but also their relative relationships and arrangement. For example, when rendering frosted glass, the model can define the shape characteristics of the primitives representing the minute bumps and depressions on the glass surface and how these primitives are distributed across the entire glass plane. For instance, suppose we need to render a thin mist in a forest. In this case, the model will decompose the mist into multiple primitives, and by setting the shape (e.g., spherical or irregular cloud-like) and spatial location (e.g., the height and distance around the trees) of these primitives, a realistic reproduction of the overall mist effect can be achieved.

[0114] In this application, the shape of the primitives is not limited. For example, the primitives can be polygonal patches. As a basic geometric primitive, polygonal patches can flexibly represent various complex shapes. During the rendering process, by adjusting the vertex positions, normal directions, and texture coordinates of the polygonal patches, the detailed features of the surface of a semi-transparent object can be accurately simulated. For example, when representing water ripples or the edges of smoke, polygonal patches can achieve delicate visual effects through subdivision and deformation. In addition, polygonal patches support various shading models and lighting calculation methods, which allows the rendering results to achieve a high degree of realism while maintaining efficiency. This flexibility makes polygonal patches one of the ideal choices for describing semi-transparent objects. This application does not limit the shape of the polygonal patches; they can be triangles, quadrilaterals, or other arbitrary polygonal forms. The specific choice depends on the rendering requirements and the limitations of computing resources. In practical applications, triangular patches are often used due to their simplicity and stability, while quadrilateral patches are more suitable for handling certain specific geometric structures.

[0115] S520. Based on the set of vertices corresponding to the primitives in the model, determine the position of the circumcircle center of the primitive.

[0116] This application proposes using the circumcenter of a circle instead of the centroid used in related technologies. This more accurately represents the overall position of a graphic element in the view space, thus allowing for a more precise determination of the spatial relationship between different graphic elements based on the circumcenter. In this application, the view space is a three-dimensional coordinate system with the observer as the origin and the Z-axis as the direction of their line of sight.

[0117] Taking a triangular facet as an example, the circumcenter of the triangle is chosen as the reference point, rather than the centroid. The circumcenter is the intersection of the perpendicular bisectors of the three sides of the triangle, and its core characteristic is that it is "equidistant from the three vertices," which more accurately represents the "overall position" of the triangular facet in visual space, especially suitable for distinguishing triangular faces that are close together in space. This design has the following significant advantages:

[0118] a. Stronger positional representativeness: The coordinates of the circumcircle's center integrate the spatial distribution of the three sides of the triangular facet, rather than simply taking the average, which can effectively distinguish the spatial positional relationship of "similar triangles" that are difficult to identify with the centroid as a reference;

[0119] b. Better resistance to offset: When the viewing direction shifts, the position of the circumscribed circle's center changes more stably, making it less prone to the "spatial region mapping error" mentioned earlier, thus reducing the probability of rendering errors when semi-transparent objects are at the edge of the image.

[0120] The so-called "spatial region mapping error" refers to the following: When dividing a semi-transparent object into multiple spatial regions, determining which region each primitive falls into, and rendering primitives in order from farthest to nearest, if primitive A is originally located in a farther spatial region C1 but is mistakenly assigned to a closer spatial region C2, the rendering order of primitive A will be delayed, which may lead to errors in rendering the occlusion relationship between primitive A and other primitives. This application uses the circumcenter to represent the overall position of primitives. By using the circumcenter of different primitives to determine which spatial region they belong to, the probability of "spatial region mapping errors" can be significantly reduced, especially when the viewing direction shifts, maintaining high accuracy. This method, by accurately calculating the position of the circumcenter, effectively avoids region division deviations caused by changes in viewing angle, thereby improving the reliability of the rendering results. Furthermore, compared to traditional centroid reference points, the circumcenter exhibits stronger adaptability when handling complex scenes, especially when multiple primitives are densely distributed, clearly distinguishing the spatial regions to which each primitive belongs, ensuring the correct rendering order. This improvement not only increases rendering efficiency but also significantly optimizes visual effects, providing users with a more realistic and smooth experience.

[0121] This application does not limit the method for determining the circumcenter of a primitive. For example, a geometric calculation method can be used to determine the position of the circumcenter by analyzing the vertex distribution of the primitive. This method can adapt to primitives of different shapes and sizes, ensuring accurate reflection of the overall spatial position of the primitive in various scenarios. Furthermore, specific algorithms can be combined to decompose complex primitives, further improving the accuracy of the circumcenter calculation.

[0122] Taking a triangular primitive as an example, determining the position of the circumcenter of the primitive based on the vertex set corresponding to the primitive in the model includes: obtaining a first vector and a second vector, where the first vector and the second vector represent the first side and the second side of the primitive, respectively; determining a normal vector perpendicular to the primitive based on the first vector and the second vector; and determining the position of the circumcenter of the primitive by squaring the first vector and the second vector, and using the normal vector.

[0123] Please refer to the following code and comments. In step 1, ab and ac are the first and second vectors, respectively, and a, b, and c are the three vertices of the triangle primitive. In step 2, the normal vector abXac is obtained by performing a cross product on the first and second vectors. In step 3, the squared lengths of ab and ac are calculated. In step 4, the offset vector of the circumcircle center relative to vertex a is calculated using the squared lengths of ab and ac, and the normal vector abXac. Then, in step 5, the exact position of the circumcircle center is obtained.

[0124] float3circumcenter(float3a,float3b,float3c){

[0125] / / Step 1: Calculate the vectors on the two sides of the triangle (ab=ba, ac=ca)

[0126] float3ab = ba;

[0127] float3ac=ca;

[0128] / / Step 2: Calculate the cross product of ab and ac to obtain the normal vector perpendicular to the triangle plane (used for subsequent perpendicular bisector calculation).

[0129] float3abXac=cross(ab,ac);

[0130] / / Step 3: Calculate the squares of the lengths of ab and ac (avoid taking square roots to reduce computational overhead)

[0131] float ab_len2 = dot(ab, ab);

[0132] float ac_len2 = dot(ac, ac);

[0133] / / Step 4: Calculate the offset vector of the circumcircle center relative to vertex a (based on the intersection formula of perpendicular bisectors)

[0134] float3to_circumcenter=(ac_len2*cross(abXac,ab)+ab_len2*cross(ac,abXac)) / (2.0*dot(abXac,abXac));

[0135] / / Step 5: Return the coordinates of the circumcircle center (a + offset vector)

[0136] return a + to _circumcenter;

[0137] }

[0138] The circumcircle center calculation method provided in this application has significant advantages at the code level: it avoids complex geometric solutions through vector operations, resulting in high computational efficiency (involving only cross product, dot product, and linear operations), thereby improving rendering efficiency. This gives the application a significant advantage in efficiency, making it suitable for scenarios with limited computing power on mobile devices. Replacing "length" with "length squared" reduces square root operations, further lowering runtime overhead, allowing this application to be applied to high real-time scenarios and mobile rendering scenarios.

[0139] S530. Determine the spatial positional relationship of the at least two graphic elements based on the position of the center of their respective circumcircles.

[0140] This spatial relationship refers to the occlusion relationship between different primitives. By analyzing the relative positions of the centers of the circumcircles, the order of primitives in 3D space can be determined. This method can determine the differences in distance between different primitives in the viewing direction without requiring depth values, thus effectively reducing the computational burden caused by traditional depth testing calculations and improving rendering accuracy.

[0141] In practical applications, the relative position of primitives can be inferred by comparing the projected coordinates of their circumcircle centers in view space. View space is a three-dimensional coordinate system with the observer as the origin and the Z-axis as the viewing direction. Assume there are two primitives A and B, with their circumcircle centers O1 and O2, respectively. Project O1 and O2 onto the Z-axis of view space. If the Z-value of O1 is less than the Z-value of O2, then primitive A is in front of primitive B; conversely, if the Z-value is greater than the Z-value of O2, then primitive B is in front of primitive A. This method avoids the complex pixel-by-pixel comparison required in traditional depth testing, thus significantly reducing computational resource consumption.

[0142] S540. Render the object model according to the rendering order of the at least two primitives determined based on the spatial position relationship, and obtain the rendering result of the object.

[0143] This application embodiment ensures that the rendering order of the at least two primitives determined based on the spatial relationship is followed by rendering of these primitives. These primitives should be rendered in a "from far to near" order, ensuring that occluded primitives are rendered before their occluders, reducing the probability of rendering errors. For example, after determining the order of primitives using the above method, the rendering engine is triggered to generate corresponding drawing instructions according to this order. For instance, in a scene containing multiple overlapping primitives, primitives located further away are submitted to the rendering pipeline for processing first, followed by those closer to the scene. This approach effectively avoids visual defects caused by incorrect rendering order.

[0144] This application proposes an object rendering method that determines the circumcenter of a primitive. The distance from the circumcenter to each vertex of the primitive is equal, thus more accurately representing the "overall position" of the primitive in space. Based on the position of the circumcenter, the spatial positional relationship of different primitives can be accurately determined. Especially for primitives that are close in space, the accuracy of the determination of their spatial positional relationship can be significantly improved, thereby more accurately determining the rendering order of different primitives. By improving the rationality and accuracy of the rendering order, the error in the occlusion relationship between different parts of a semi-transparent object is significantly reduced, improving rendering accuracy. Furthermore, the process of calculating the circumcenter in this application embodiment is very short, significantly improving the rendering speed. Therefore, it ensures a balance between rendering accuracy and performance overhead, making this application applicable to high-precision real-time semi-transparent object rendering and mobile semi-transparent object rendering.

[0145] This application does not limit the specific rendering method. In an exemplary embodiment, the spatial positional relationship of the at least two primitives includes an occlusion relationship characterizing that the first primitive is occluded by the second primitive, wherein the first primitive and the second primitive belong to the at least two primitives; the step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship to obtain the rendering result of the object includes: rendering the first primitive to obtain the rendering result of the first primitive; after rendering the first primitive, rendering the second primitive to obtain the rendering result of the second primitive; wherein the rendering result of the object includes the rendering result of the first primitive and the rendering result of the second primitive. In this application embodiment, the occlusion relationship can indicate that the first primitive is at least partially occluded by the second primitive.

[0146] The first and second primitives are any two of the aforementioned at least two primitives. Although this embodiment describes the rendering order of these two primitives, the principle also applies to complex semi-transparent objects containing more primitives. For example, if a semi-transparent object includes five primitives, namely primitive 1, primitive 2, primitive 3, primitive 4, and primitive 5, then a reasonable rendering order can be determined based on their spatial relationships. For instance, if primitive 1 is occluded by primitive 2, and primitive 2 is occluded by primitive 3, and so on, then primitive 1, primitive 2, primitive 3, primitive 4, and primitive 5 can be rendered sequentially. If primitive 1 is occluded by primitive 2, primitive 4 is occluded by primitive 5, and primitive 3 is not occluded by any other primitives, then primitive 3 can be rendered first, followed by primitive 1, primitive 2, and primitive 4 and primitive 5 in sequence according to the occlusion relationships.

[0147] In this embodiment, the determination of the rendering order depends on the spatial relationship between primitives, and the core of this relationship lies in the accurate judgment of occlusion relationships. The definition of primitive occlusion relationships for semi-transparent objects in this application refers to the phenomenon in three-dimensional space where one primitive of a semi-transparent object is partially or completely occluded due to the presence of another primitive. However, since these primitives are semi-transparent, the occlusion does not result in them becoming invisible, but it does affect the visual rendering overlay effect of the primitives. For semi-transparent objects, when the first primitive is occluded by the second primitive, according to visual logic, the first primitive should be rendered before the second primitive, which is exactly the opposite of the rendering logic for opaque objects.

[0148] This application embodiment, through the calculation of the circumcircle's center, can accurately determine the overall position of primitives, thus providing a reliable basis for judging occlusion relationships. Compared to traditional schemes that judge the spatial positional relationship between different primitives based on the centroid, this application embodiment can still ensure the accuracy of the judgment result even when the semi-transparent object is in a relatively off-center position or at the edge of the image. Therefore, this application embodiment is more accurate and stable, especially suitable for situations where multiple primitives overlap in complex scenes. In practical applications, incorrect rendering order often leads to obvious flaws in the rendering effect of semi-transparent objects, such as abnormal display of local areas of semi-transparent objects or reversed occlusion relationships. This application embodiment, through precise judgment of occlusion relationships, accurately controls the rendering order of primitives, thereby significantly reducing the probability of such problems and improving rendering accuracy. Furthermore, due to the high efficiency of the circumcircle's center calculation method, the entire process is extremely short and will not significantly affect the overall rendering efficiency. This makes this application embodiment suitable for high-performance desktop rendering tasks as well as meeting the strict requirements of mobile devices for real-time performance and resource consumption.

[0149] In an exemplary embodiment, rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, and obtaining the rendering result of the object, includes: sorting the at least two primitives based on the spatial positional relationship of the at least two primitives to obtain a primitive sorting result; in the primitive sorting result, if the third primitive is located before the fourth primitive, the spatial positional relationship between the third primitive and the fourth primitive includes: the third primitive is occluded by the fourth primitive, or the third primitive and the fourth primitive do not occlude each other, and the third primitive and the fourth primitive are any two primitives in the primitive sequence; and rendering each primitive in the primitive sorting result sequentially to obtain the rendering result of the object.

[0150] The third and fourth primitives can be any two of the at least two primitives. Although the rendering order of the third and fourth primitives is described in this embodiment, the principle also applies to complex semi-transparent objects containing more primitives.

[0151] In the implementation process, assume a semi-transparent object consists of 10 primitives, which may have occlusion relationships or non-occlusion relationships. For example, primitive A may be completely occluded by primitive B, or primitive C and primitive D may not have any occlusion. Based on these spatial relationships, these 10 primitives are first sorted. The sorting principle is to render the occluded primitives first, and then render the parts that occlude other primitives.

[0152] For example, in the sorting results, if primitive 3 precedes primitive 7, it means that primitive 3 is occluded by primitive 7 or they do not occlude each other. If there is no occlusion relationship between primitive 5 and primitive 8, their order can be determined by other factors, such as their distance from the viewpoint. After sorting, each primitive is rendered sequentially. Since the objects are semi-transparent, the later-rendered primitives will overlap with the previously rendered primitives, thus presenting the correct visual hierarchy. In this way, display errors caused by improper rendering order can be effectively avoided, such as incorrect transparency effects or chaotic occlusion relationships. This method not only improves rendering accuracy but also optimizes computational efficiency because each primitive only needs to be processed according to the explicit sorting rules, without repeatedly adjusting the rendering order. Ultimately, users can obtain more realistic and expected rendering results, especially in complex scenes, where this advantage is particularly evident.

[0153] In one exemplary implementation, please refer to Figure 6 The diagram illustrates a method for determining spatial positional relationships in an embodiment of this application. Determining the spatial positional relationship of at least two graphic elements based on the center positions of their respective circumcircles includes:

[0154] S610. Divide the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions.

[0155] In some implementations, before dividing the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions, the method further includes: converting the model in world space to view space. In 3D graphics rendering, world space refers to the original coordinate system of all objects in the scene, while view space is a coordinate system referenced to the camera or observer's viewpoint. The process of converting a model from world space to view space typically involves a series of mathematical transformations, such as translation, rotation, and scaling. For example, suppose a virtual scene contains a house and a camera. The house is initially defined in world space. For rendering convenience, the coordinates of the house can be recalculated to express its position and orientation relative to the camera; this step is called view space conversion.

[0156] This transformation ensures that subsequent operations (such as bounding box segmentation) are performed based on the observer's perspective. When the bounding box is segmented in view space in a direction perpendicular to the line of sight, it more accurately reflects the relative positional relationship of primitives in the line of sight. This technique is beneficial for determining occlusion relationships, thereby improving the accuracy of spatial position determination, reducing rendering errors, and preventing rendering defects in semi-transparent objects.

[0157] A bounding box is a geometric structure used to simplify the representation of complex models. It typically exists in the form of a rectangle or cube and can completely enclose all components of the model. Its main function is to optimize the rendering process by reducing computational complexity. A spatial region, on the other hand, refers to multiple independent parts formed in view space after a segmentation operation. For example, in a virtual scene, suppose there is a complex 3D character model whose bounding box is a cube. When this cube is segmented into upper and lower parts parallel to the viewpoint, the upper part might contain the character's head and upper limbs, while the lower part contains the torso and legs. This segmentation method allows for more efficient determination of which parts need to be prioritized during rendering, thereby improving overall rendering efficiency.

[0158] In one exemplary embodiment, dividing the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions includes:

[0159] S611. Determine the segmentation granularity based on the scene information corresponding to the model;

[0160] S612. Based on the segmentation granularity, the bounding box corresponding to the model is segmented in a manner perpendicular to the line of sight to obtain the at least two spatial regions.

[0161] This application does not limit the scene information. For example, the scene information corresponding to the model includes at least one of the following: the complexity of the model; the rendering quality requirements; the rendering speed requirements; and the viewpoint of the model relative to the observation camera.

[0162] For example, for a semi-transparent object with many details, the model complexity is high. Adjusting the granularity of the segmentation can divide the bounding box into more spatial regions, thereby reducing the computational burden of a single rendering and lowering the probability of rendering errors. Additionally, when high rendering quality is required, a finer granularity can be chosen to ensure the correctness of the primitive rendering order. Conversely, when rendering speed is prioritized, a coarser granularity can be used to reduce the number of segmentations and judgments, thus improving overall efficiency.

[0163] For example, in a scene where a fairy is flying, the player's perspective usually follows the fairy's movement. In this case, the segmentation method can be dynamically adjusted based on the fairy model's perspective relative to the viewing camera. If the fairy is located in the center of the screen and occupies a large proportion, the bounding box can be segmented into more spatial areas to concentrate resources on rendering the fairy's details; while when the fairy is located at the edge of the screen, since its visual importance is reduced, the segmentation granularity can be appropriately reduced to decrease the rendering investment for secondary parts.

[0164] This flexible segmentation method based on scene information brings significant benefits: on the one hand, it can dynamically balance rendering quality and speed according to actual needs, avoiding resource waste; on the other hand, by reasonably segmenting the bounding box, the rendering priority in complex scenes can be managed more efficiently, because primitives in spatial regions with a farther line of sight are drawn before primitives in spatial regions with a closer line of sight. This design further reduces the probability of rendering errors and improves the user experience.

[0165] S620. The spatial region into which the center of the circumcircle of the graphic element falls is determined as the spatial region corresponding to the graphic element.

[0166] The spatial region to which a primitive belongs is determined by the position of its circumscribed circle. For example, a semi-transparent object, divided into 10 spatial regions from near to far along the viewing direction, contains 361 primitives. The circumscribed circle of each primitive is automatically assigned to its corresponding spatial region based on its position. If the circumscribed circle of primitive A falls into spatial region 1, then primitive A is assigned to spatial region 1. This method effectively improves the accuracy of spatial region mapping during rendering, ensuring that each primitive is correctly assigned to the correct spatial region. Because the spatial affiliation of each primitive is clear, the rendering order between different primitives can also be easily determined. This method effectively avoids the ambiguity caused by primitives spanning multiple spatial regions, thereby improving overall rendering efficiency and quality.

[0167] In one exemplary embodiment, after dividing the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions, the method further includes: sequentially sorting the at least two spatial regions in ascending order along the line of sight from far to near to obtain the region identifiers corresponding to each of the at least two spatial regions.

[0168] For example, a semi-transparent object can be divided into 10 spatial regions along the viewing direction, from farthest to closest. These regions can be labeled as Region 1 to Region 10, where Region 1 represents the farthest region and Region 10 represents the closest region. This sorting method ensures that each spatial region has a unique identifier, facilitating rapid location and processing during subsequent rendering. Furthermore, sorting the spatial regions helps optimize the rendering order decision-making process, allowing the primitives of each spatial region to be processed sequentially from farthest to closest during rendering, thereby further improving rendering efficiency and reducing unnecessary computational overhead. This method is particularly suitable for rendering complex semi-transparent objects, significantly reducing system resource consumption while maintaining visual quality.

[0169] S630. Based on the spatial region corresponding to each of the at least two graphic elements, determine the spatial location code of each of the graphic elements.

[0170] In one exemplary embodiment, determining the spatial location code of each of the at least two graphic elements based on the spatial region corresponding to each of the graphic elements includes: determining the spatial location code of each graphic element based on the spatial region corresponding to each of the graphic elements and the region identifier corresponding to each of the spatial regions.

[0171] Suppose a semi-transparent object is divided into 5 spatial regions, each containing several primitives. By analyzing the spatial region identifiers of these primitives, a unique location code can be assigned to each primitive. For example, if a primitive is located in region 3 and its local coordinates are (2, 4, 6), its spatial location code can be represented as "3-2-4-6". This encoding method not only quickly distinguishes the relationships between different primitives but also provides efficient indexing support during rendering. When processing primitives, simply parsing their spatial location codes is sufficient to quickly locate the corresponding region and specific position, without requiring additional complex calculations.

[0172] This method significantly improves the efficiency of primitive rendering, enabling the location of primitives and determination of their rendering order in less time. Since spatial location codes directly reflect the spatial distribution characteristics of primitives, unnecessary repetitive calculations can be avoided when determining the rendering order, further optimizing rendering performance. Furthermore, this method has good scalability and is suitable for rendering scenarios of varying scales and complexities, achieving efficient and accurate rendering results for both simple geometry and complex semi-transparent models.

[0173] In one exemplary implementation, please refer to Figure 7 This diagram illustrates a spatial location code determination method in an embodiment of this application. The step of determining the spatial location code of each graphic element based on its corresponding spatial region and its corresponding region identifier includes performing the following operation on the fifth graphic element among the graphic elements:

[0174] S710. Determine the first region identifier, which is the region identifier of the spatial region where the fifth graphic element is located.

[0175] The fifth graphic element is any graphic element whose spatial location code needs to be determined. Taking the method for determining the spatial location code of the fifth graphic element as an example, the process of determining the spatial location code will be explained in detail. First, the region identifier of the spatial area in which the center of the circumcircle of the fifth graphic element falls can be obtained, that is, the first region identifier.

[0176] S720. If the first region identifier is not the smallest region identifier, count the total number of graphic elements whose circumcircle centers fall into the spatial region corresponding to the second region identifier, where the second region identifier is less than the first region identifier; based on the total number, determine the spatial location code of the fifth graphic element.

[0177] If the first region identifier is the smallest region identifier, since the spatial regions are encoded sequentially from farthest to nearest along the line of sight, this indicates that the circumscribed circle of the fifth element is located in the farthest spatial region. If the elements are sorted in order from farthest to nearest along the line of sight to obtain the spatial position code of the elements, then since the circumscribed circle of the fifth element is located in the farthest spatial region, there is no spatial region farther than the spatial region corresponding to the fifth element. Therefore, it is only necessary to determine the order of the fifth element among the elements in its corresponding spatial region to obtain the sorting result of the fifth element. This application embodiment does not limit the sorting method of the fifth element among the elements in its corresponding spatial region. For example, it can be sorted according to the coordinate position of the circumscribed circle of the element within the spatial region, or according to the drawing order of the elements in the model or the unique identifier information of the elements. For example, once the sorting result of the fifth element is determined, the sorting sequence number can be directly used as the spatial position code of the fifth element.

[0178] If the first region identifier is not the smallest region identifier, it means that the spatial region where the circumscribed circle of the fifth element is located is not the farthest region. In this case, it is necessary to combine the total number of elements in this spatial region and the more distant spatial regions to determine the sorting result of the fifth element. Specifically, firstly, count the total number of elements contained in all spatial regions where the region identifier is smaller than the first region identifier (i.e., regions farther than the spatial region where the fifth element is located), and use this total number as the starting base for sorting the fifth element. Then, determine the relative sorting result of the fifth element among the elements in its corresponding spatial region, and add the relative sorting result to the starting base to obtain the sorting result of the fifth element in the overall element sequence. Similarly, this application embodiment does not limit the sorting method of the fifth element in its corresponding spatial region, and can use methods such as the coordinate position of the circumscribed circle center, the model drawing order, or the unique identifier information of the element as described above. For example, after the sorting result of the fifth element is determined, the sorting sequence number can be directly used as the spatial location code of the fifth element.

[0179] For example, if there are 20 primitives in all regions farther away than the region where the fifth primitive is located, and the relative sort number of the fifth primitive within its own region is 5, then the overall sorting result of the fifth primitive is 20+5=25, and this sort number can then be used as its spatial location code.

[0180] By combining the distance between regions with their relative positions within the region, this sorting method can efficiently and accurately generate spatial location codes for each graphic element, reflecting its spatial location characteristics, thus providing a reliable basis for determining the rendering order of different graphic elements.

[0181] S640. Determine the spatial position relationship of the at least two graphic elements based on the spatial position code of each graphic element in the at least two graphic elements.

[0182] As mentioned earlier, the spatial location code of a primitive indicates its spatial position, and different primitive spatial location codes can indicate the spatial relationship between different primitives. If the spatial location code of primitive A is less than that of primitive B, it means that primitive A is farther than primitive B. Therefore, primitive A may at least partially occlude primitive B, or they may not occlude each other. By clearly representing the spatial positions of primitives and the spatial relationships between different primitives, the rendering order of primitives can be accurately determined, thus improving rendering accuracy.

[0183] In one exemplary implementation, please refer to Figure 8 This diagram illustrates a method for rendering a model corresponding to an object in an embodiment of this application. The step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes:

[0184] S810. Based on the spatial positional relationship between different graphic elements indicated by the spatial position code of each graphic element, sort the vertices of each graphic element and determine the vertex index of each vertex of each graphic element.

[0185] For example, if the spatial location code of primitive C is 3 and the spatial location code of primitive D is 5, since 3 is less than 5, it indicates that primitive C is spatially farther away than primitive D. When sorting vertices, all vertices of primitive C are processed first, followed by all vertices of primitive D. Assuming primitive C contains vertices C1, C2, and C3, and primitive D contains vertices D1, D2, and D3, the vertices of primitive C are encoded first, following the ascending order of their spatial location codes. The vertex indices of C1, C2, and D3 are determined as follows: C1 is encoded as 0, C2 as 1, and C3 as 2. Then, the vertices of primitive D are encoded, with D1 encoded as 3, D2 as 4, and D3 as 5, and so on, completing the sorting and index determination of all primitive vertices. This method ensures that vertices of primitives with farther spatial locations are assigned indices first, laying the foundation for the subsequent arrangement of primitive rendering order based on vertex indices.

[0186] For example, the step of sorting the vertices of each graphic element based on the spatial positional relationships between different graphic elements indicated by their spatial position codes, and determining the vertex index of each vertex of each graphic element, includes: sequentially encoding the vertices of related graphic elements in ascending order of spatial position codes to obtain the vertex index of each vertex of each graphic element. Specifically, the spatial position codes of each graphic element can be obtained first, and then these graphic elements can be sorted in ascending order of spatial position codes. After the graphic elements are sorted, the vertices contained in each graphic element are traversed sequentially according to the sorted graphic element order. For the first graphic element encountered, its first vertex is assigned a starting vertex index value (e.g., 0), and the subsequent vertices of the graphic element are assigned index values ​​sequentially in the order of appearance, until all vertices of all graphic elements are assigned a unique vertex index.

[0187] S820. Based on the vertex index of each vertex of each primitive, determine the rendering order of each vertex in the object model.

[0188] Determining the rendering order of vertices in the object model based on the vertex indices of each vertex of each primitive includes: determining the rendering order of vertices in the object model in ascending order of vertex indices. Specifically, after obtaining the vertex indices corresponding to each vertex of each primitive in the object model, the order of each vertex can be determined by sorting them in ascending order of indices.

[0189] S830. Based on the rendering order, render the object model to obtain the rendering result of the object.

[0190] By rendering each vertex in ascending order of its index, the object model can be rendered, and the rendering result of the object can be obtained.

[0191] This application directly sorts and assigns vertex indices to primitive vertices based on spatial location codes. This process directly maps the spatial positional relationships between primitives to the order of vertex indices. Since the spatial location codes themselves reflect the distance of primitives (e.g., smaller code values ​​indicate farther locations), by sequentially encoding vertices from farthest to nearest primitives, the vertex indices naturally carry spatial depth information. This approach avoids the problem of vertex order being disconnected from spatial position that may occur in traditional rendering, providing accurate and efficient underlying data support for determining the subsequent rendering order, eliminating the need for complex real-time calculations or comparisons of vertex spatial positions during the rendering stage. Then, the vertex rendering order is determined based on the ascending order of vertex indices, further simplifying the rendering logic. Because the vertex indices are assigned sequentially according to the ascending order of the spatial location codes (i.e., primitives from farthest to nearest), the ascending order of the indices naturally corresponds to the spatial arrangement of vertices from farthest to nearest. This means that the rendering engine only needs to process vertices in ascending order of their indices to achieve the correct depth rendering logic of "far first, near later". This effectively avoids visual defects such as image penetration and layer confusion caused by incorrect depth sorting, and ensures the accurate presentation of the model space layer corresponding to the object.

[0192] This application's embodiments move the determination of complex spatial relationships to the vertex index generation stage. Through a single sorting and encoding operation, spatial information is solidified into the vertex index. Subsequent rendering order determination and rendering execution are based on a simple index increment rule, greatly reducing the computational complexity of the rendering stage. Compared to the disadvantage of poor real-time performance of traditional methods, this application's embodiments significantly improve overall rendering efficiency, especially in rendering scenarios of complex object models containing a large number of primitives and vertices. This advantage is even more prominent, effectively improving rendering efficiency and optimizing the real-time interactive experience.

[0193] In one exemplary implementation, please refer to Figure 9 This diagram illustrates the object rendering process in an embodiment of this application. In this embodiment, the object rendering process includes the following steps:

[0194] Step S910: Divide the entire enclosing box (the cubic space surrounding the model) containing the model into 256 "slices" along the line of sight.

[0195] 256 is the preset number of slices. Of course, the number of slices can be adjusted according to factors such as the complexity of the model, the rendering scene, the rendering requirements, and the position of the model in the scene.

[0196] Step S920: Calculate the position of a single vertex.

[0197] The specific position (coordinates) of each vertex in the calculation model within the full box.

[0198] Step S930: Determine the coordinates of the circumcenter of each triangular primitive.

[0199] For each triangular primitive in the model, calculate the coordinates of its circumcircle center, and then convert these circumcircle center coordinates into coordinates in view space.

[0200] Step S940: Based on the coordinates of the circumcenter of each triangular primitive in the view space, determine the slice to which each triangular primitive belongs.

[0201] Step S950: Count the number of triangular primitives in each slice.

[0202] Step S960: Record the slice number of the slice where each triangle primitive is located and the total number of triangle primitives in slices that are farther away than the slice where the triangle primitive is located. Use the sum of the slice number and the total number of triangle primitives as the global offset of the triangle primitive.

[0203] Step S970: Calculate the vertex index of the vertices in the triangle primitive based on the global offset of each triangle primitive.

[0204] Step S980: Render each vertex according to its index.

[0205] Steps S910 to S980 efficiently resolve potential issues with the rendering order of triangle primitives and vertices in semi-transparent object models during rendering. This process avoids time-consuming computational logic, ensuring strong real-time performance and low demands on computational and storage resources, making it suitable for stable and efficient operation on mobile devices. This solution utilizes the circumcircle's center circle to address the sorting problem, ensuring that the rendering of semi-transparent object models is performed from farthest to closest, resulting in a more accurate and harmonious final semi-transparent rendering effect.

[0206] Please refer to Figure 10 It shows a schematic diagram of the rendering result of the object rendering method proposed in the embodiments of this application, and the semi-transparent object corresponding to the rendering result is... Figure 1 and Figure 2 The semi-transparent objects in the same way are the same, so combining them... Figure 1 , Figure 2 and Figure 10 The advantages of the embodiments of this application are clearly evident. Figure 10 Figure (a) in the image is a color image. Figure 10 Figure (b) is Figure 10 The grayscale image corresponding to image (a) in the image. Figure 10In Figure (a), the right side of the cube shows the correct rendering result. The purple and green of the cube's front face are correctly overlaid on the right face. This is because it avoids the rendering error caused by blue-violet light being projected onto the front face of the cube due to related technologies. Furthermore, from... Figure 10 As can be seen from the right side of Figure (a), even if the semi-transparent object is at the edge, the embodiments of this application can still obtain accurate rendering results.

[0207] Please refer to Figure 11 It illustrates a comparison of the rendering results of the object rendering method proposed in this application embodiment with those of related technologies. Figure 1 . Figure 11 Figure (a) shows the color-coded effect of the comparison diagram. Figure 11 Figure (b) shows the grayscale effect of the comparison diagram. Figure 11 The left image of Figure (a) is the rendering result using the rendering method of this application, while Figure 11 The right image of Figure (a) shows the rendering result using the rendering method of the related technology. It is obvious that the rendering result of the embodiment of this application is correct, while the related technology has cases where the head and arms are rendered incorrectly.

[0208] Please refer to Figure 12 It illustrates a comparison of the rendering results of the object rendering method proposed in this application embodiment with those of related technologies. Figure 2 . Figure 12 The left image in (a) is the rendering result using the rendering method of this application, where the front veil correctly covers the back veil; while Figure 12 The right image of (a) in the image is the rendering result using the relevant rendering method, where the veil is visible from the back of the head to the front. Figure 12 The left image in (b) is the rendering result using the rendering method of this application; the bow on the arm is displayed correctly. Figure 12 The right image of (b) in the image is the rendering result using the relevant rendering method, and the bow on the arm is displayed incorrectly. Figure 12 The left image in (c) shows the rendering result using the rendering method of this application, demonstrating the correct effect when the object is at the edge of the viewpoint; while Figure 12 The right image of (c) in the image is the rendering result using the relevant rendering method, and the object is not displayed correctly when it is at the edge of the view.

[0209] Figures 10 to 12This fully demonstrates that the object rendering method proposed in this application can effectively solve the problems of color anomalies, incorrect coverage relationships, and edge display that occur when rendering semi-transparent objects in related technologies, significantly improving the rendering accuracy and visual effect of semi-transparent objects. Comparative experimental results clearly show that, whether it's eliminating the abnormal blue-purple projection on the surface of a cube or correctly displaying the layers of complex semi-transparent structures such as a person's head, arms, and veil, the embodiments of this application exhibit rendering quality superior to related technologies, verifying the effectiveness and superiority of this method in practical applications.

[0210] Furthermore, the embodiments of this application do not involve steps that require significant computational and storage resources, so the operating load is small. In scenarios where the computing power / video memory resources of mobile devices are limited, it cannot support pixel-level high-overhead schemes (such as the use of linked list storage for semi-transparent rendering in related technologies). The object rendering scheme of the embodiments of this application can balance the "precision" of the outer circle center and the "performance" of the outer circle center, achieving high-accuracy real-time rendering.

[0211] In one exemplary implementation, obtaining the model corresponding to the object includes: receiving first scene description data, the first scene description data including the identifier of the object and first state data of the object in the scene; and obtaining the model corresponding to the object based on the first scene description data. Rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes: obtaining the first video frame corresponding to the first scene description data based on the rendering result of the object.

[0212] The first scene description data is the core data carrier for digitally defining a 3D scene containing objects. It includes not only identifiers for uniquely identifying the objects (such as model IDs and names), but also the object's first state data within the current scene. Specifically, the first state data may include the object's spatial coordinates, orientation information, scaling factor, and dynamic attribute parameters that may affect the object's appearance and behavior (such as the transparency value of semi-transparent objects, material reflectivity, and keyframe data of skeletal animation). The object model is then rendered, and the final rendering result is integrated into the first video frame corresponding to the first scene description data, i.e., the visualized image frame of the scene at the current moment.

[0213] In this embodiment, the method further includes: receiving second scene description data, the second scene description data including the identifier of the object and second state data of the object in the scene; generating a second video frame corresponding to the second scene description data, the second video frame being the next video frame after the first video frame.

[0214] In this exemplary embodiment, the generation of subsequent video frames is driven by receiving second scene description data. The second scene description data has a similar meaning to the first scene description data, also containing the object's identifier to ensure that the same object is processed. The second scene description data includes the object's updated second state data within the scene. Compared to the first state data, at least one of the following may change in the second state data: spatial coordinates, orientation information, scaling factor, or dynamic attribute parameters. These changes reflect the object's movement, deformation, or state transition over time. After obtaining the second scene description data, a second video frame corresponding to the second scene description data is generated according to a rendering logic similar to that used to generate the first video frame. Since the second scene description data represents the state definition of the scene at the next point in time after the first scene description data, the generated second video frame naturally becomes the next consecutive video frame after the first video frame. In this way, a series of consecutive video frames can be continuously generated based on continuous scene description data (from the first scene description data to the second scene description data, and so on), thus forming a dynamic video sequence and achieving smooth visualization of the movement and changes of objects in a 3D scene. In complex and dynamic scenes (such as multiplayer online games and virtual simulation training scenarios), the scene often contains a large number of objects of different types, and the state (position, posture, attributes, etc.) of each object changes dynamically in real time. The object rendering scheme of this application has the significant advantage of high real-time performance and can be applied even in complex and dynamic scenes, thereby generating real-time first and second video frames.

[0215] In an exemplary embodiment, the method further includes: sending a video stream, the video stream comprising the first video frame and the second video frame. In a cloud gaming scenario, after the game server generates a video stream containing the first and second video frames using the object rendering method described above, it sends the video stream to the user's terminal device (such as a mobile phone, computer, or television) in real time. For example, when a player operates a game character on a cloud gaming platform to perform actions such as moving or releasing skills, the game server updates the object state in the game scene in real time according to the player's operation instructions, generating consecutive first video frames (corresponding to the game screen state before the operation) and second video frames (corresponding to the screen state after the game character moves or releases a skill), and encapsulates these consecutive video frames into a video stream. Since the cloud gaming's operating logic and rendering process are both completed on the server side, the user terminal does not need high-performance hardware configuration; it only needs to receive the video stream sent by the server and decode and play it to experience the game smoothly. This method of sending video streams effectively reduces the hardware requirements of the user terminal, while leveraging the server's powerful computing and rendering capabilities to ensure high frame rates and high definition of the game screen, allowing players to obtain a low-latency, immersive gaming experience even in complex multiplayer online cloud gaming scenarios.

[0216] The object rendering method provided in this application can meet the visual presentation requirements for semi-transparent objects (such as gauze / veils on character clothing, glass / water surfaces in scenes, bows in props, etc.). Semi-transparent objects are key elements to enhance the realism of game graphics and the immersion of players. For example, the "layered transparency" of veils and the "reflective quality" of glass need to be accurately rendered to convey material characteristics, which directly affects the visual quality of the game and the user experience.

[0217] Furthermore, since related technologies that achieve similar precise rendering of semi-transparent objects as the embodiments of this application require recording the display order of the pixels of the semi-transparent object in a linked list, resulting in high computational overhead and making them unsuitable for real-time rendering scenarios, the embodiments of this application exhibit a significant advantage in performance overhead. This advantage allows the embodiments of this application to be applied to real-time rendering scenarios, especially real-time rendering scenarios for mobile games and cloud gaming. The following design in the embodiments of this application enables the embodiments of this application to achieve a significant advantage in performance overhead:

[0218] (1) Controllable computational overhead: The calculation of the coordinates of the circumcircle center only involves lightweight operations such as "cross product and dot product". Compared with the solution that requires the calculation of the centroid in related technologies, the performance overhead is significantly reduced, which is fully compatible with the computing power limitations of mobile devices.

[0219] (2) No increase in video memory usage: No need to store linked lists, textures, or other data; only vertex index sorting results are recorded.

[0220] (3) Rendering pipeline compatibility: This application embodiment does not require adding a new rendering channel, has low integration cost, and can be quickly connected to mainstream game engines such as Unreal Engine.

[0221] The following are embodiments of the apparatus of this application, which can be used to execute embodiments of the method of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method of this application.

[0222] Please refer to Figure 13 The diagram illustrates a block diagram of an object rendering apparatus according to an embodiment of this application, the apparatus comprising:

[0223] The model acquisition module 1310 is used to acquire the model corresponding to the object. The model is used to represent the shape of the primitives in the object and the spatial position of the primitives. The object has the visual characteristic of allowing some light to pass through.

[0224] The circumcircle center determination module 1320 is used to determine the position of the circumcircle center of the graphic element based on the vertex set corresponding to the graphic element in the model;

[0225] The positional relationship determination module 1330 is used to determine the spatial positional relationship of the at least two graphic elements based on the center positions of their respective circumcircles.

[0226] The rendering module 1340 is used to render the object model according to the rendering order of the at least two primitives determined based on the spatial position relationship, and obtain the rendering result of the object.

[0227] In an exemplary embodiment, the spatial positional relationship of the at least two primitives includes an occlusion relationship characterizing the first primitive being occluded by the second primitive, wherein the first primitive and the second primitive belong to the at least two primitives; the rendering module 1340 is configured to:

[0228] Render the first primitive to obtain the rendering result of the first primitive;

[0229] After rendering the first primitive, the second primitive is rendered to obtain the rendering result of the second primitive;

[0230] The rendering result of the object includes the rendering result of the first primitive and the rendering result of the second primitive.

[0231] In one exemplary embodiment, the rendering module 1340 is configured to:

[0232] Based on the spatial relationship between the at least two graphic elements, the at least two graphic elements are sorted to obtain a graphic element sorting result; in the graphic element sorting result, if the third graphic element is located before the fourth graphic element, the spatial relationship between the third graphic element and the fourth graphic element includes: the third graphic element is occluded by the fourth graphic element, or the third graphic element and the fourth graphic element do not occlude each other, and the third graphic element and the fourth graphic element are any two graphic elements in the graphic element sequence;

[0233] Each element in the element sorting result is rendered sequentially to obtain the rendering result of the object.

[0234] In one exemplary embodiment, the positional relationship determination module 1330 is configured to:

[0235] The bounding box corresponding to the model is divided in a manner perpendicular to the line of sight to obtain at least two spatial regions;

[0236] The spatial region into which the circumcircle center of a graphic element falls is defined as the spatial region corresponding to the graphic element.

[0237] Based on the spatial region corresponding to each of the at least two graphic elements, determine the spatial location code of each graphic element.

[0238] The spatial positional relationship between the at least two graphic elements is determined based on the spatial position code of each graphic element in the at least two graphic elements.

[0239] In one exemplary embodiment, the positional relationship determination module 1330 is configured to:

[0240] The at least two spatial regions are sequentially sorted in ascending order along the line of sight from far to near to obtain the region identifiers corresponding to each of the at least two spatial regions.

[0241] Based on the spatial region corresponding to each graphic element and the region identifier corresponding to each spatial region, the spatial location code of each graphic element is determined.

[0242] In one exemplary embodiment, the positional relationship determination module 1330 is configured to perform the following operation for the fifth graphic element among the graphic elements:

[0243] Determine a first region identifier, which is the region identifier of the spatial region where the fifth graphic element is located;

[0244] If the first region identifier is not the smallest region identifier, count the total number of graphic elements whose circumcircle centers fall into the spatial region corresponding to the second region identifier, where the second region identifier is less than the first region identifier.

[0245] Based on the total quantity, the spatial location code of the fifth graphic element is determined.

[0246] In one exemplary embodiment, the rendering module 1340 is configured to:

[0247] Based on the spatial position codes of each of the graphic elements indicating the spatial positional relationships between different graphic elements, the vertices of each of the graphic elements are sorted to determine the vertex index of each vertex of each graphic element.

[0248] Based on the vertex index of each vertex of each primitive, the rendering order of each vertex in the object model is determined;

[0249] Based on the rendering order, the object model is rendered to obtain the rendering result of the object.

[0250] In one exemplary embodiment, the rendering module 1340 is configured to:

[0251] The vertices of the relevant primitives are encoded sequentially in ascending order of spatial location codes to obtain the vertex index of each vertex of each primitive.

[0252] The rendering order of each vertex in the object model is determined according to the ascending order of the vertex index.

[0253] In one exemplary embodiment, the graphic element is a triangular graphic element, and the circumcircle center determination module 1320 is used for:

[0254] Obtain a first vector and a second vector, wherein the first vector and the second vector respectively represent the first side and the second side of the primitive;

[0255] Based on the first vector and the second vector, determine the normal vector perpendicular to the primitive;

[0256] The position of the circumcenter of the primitive is determined by squaring the first vector and the second vector, and using the normal vector.

[0257] In one exemplary embodiment, the positional relationship determination module 1330 is configured to:

[0258] Transform the model from world space to view space.

[0259] In one exemplary embodiment, the positional relationship determination module 1330 is configured to:

[0260] Based on the scene information corresponding to the model, the segmentation granularity is determined;

[0261] Based on the segmentation granularity, the bounding box corresponding to the model is segmented in a manner perpendicular to the line of sight to obtain the at least two spatial regions.

[0262] In one exemplary implementation, the scene information corresponding to the model includes at least one of the following:

[0263] The complexity of the model;

[0264] Rendering quality requirements;

[0265] Rendering speed requirements;

[0266] The model is viewed from the perspective of the observation camera.

[0267] In one exemplary embodiment, the model acquisition module 1310 is configured to:

[0268] Receive first scene description data, the first scene description data including the identifier of the object and the first state data of the object in the scene;

[0269] Based on the first scene description data, obtain the model corresponding to the object;

[0270] The rendering module 1340 is used for:

[0271] Based on the rendering result of the object, the first video frame corresponding to the first scene description data is obtained.

[0272] In one exemplary embodiment, the rendering module 1340 is configured to:

[0273] Receive second scene description data, the second scene description data including the identifier of the object and the second state data of the object in the scene;

[0274] A second video frame corresponding to the second scene description data is generated, and the second video frame is the next video frame after the first video frame.

[0275] In one exemplary embodiment, the rendering module 1340 is configured to:

[0276] Send a video stream, the video stream including the first video frame and the second video frame.

[0277] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0278] Please refer to Figure 14 This diagram illustrates a structural block diagram of a computer device provided in one embodiment of this application, used to perform the above-described object rendering method. The computer device may be a server. Specifically:

[0279] Computer device 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including random access memory (RAM) 1402 and read-only memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the CPU 1401. Computer device 1400 also includes a basic input / output system (I / O system) 1406 that facilitates information transfer between various devices within the computer, and a mass storage device 1407 for storing the operating system 1413, application programs 1414, and other program modules 1415.

[0280] The basic input / output system 1406 includes a display 1408 for displaying information and an input device 1409 for user input, such as a mouse or keyboard. Both the display 1408 and the input device 1409 are connected to the central processing unit 1401 via an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include the input / output controller 1410 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, printer, or other types of output devices.

[0281] Mass storage device 1407 is connected to central processing unit 1401 via a mass storage controller (not shown) connected to system bus 1405. Mass storage device 1407 and its associated computer-readable media provide non-volatile storage for computer device 1400. That is, mass storage device 1407 may include computer-readable media (not shown) such as hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.

[0282] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1404 and mass storage device 1407 described above can be collectively referred to as memory.

[0283] According to various embodiments of this application, the computer device 1400 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1400 can be connected to the network 1412 via the network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).

[0284] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The electronic device may be a terminal for executing the object rendering method described above, and its internal structure diagram may be as follows: Figure 15As shown, the device may include an RF (Radio Frequency) circuit 1510, a memory 1520 including one or more computer-readable storage media, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a WiFi (Wireless Fidelity) module 1570, a processor 1580 including one or more processing cores, and a power supply 1590, among other components. Those skilled in the art will understand that... Figure 15 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0285] RF circuit 1510 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1580 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 1510 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, RF circuit 1510 can also communicate wirelessly with networks and other terminals. Wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0286] The memory 1520 can be used to store software programs and modules. The processor 1580 executes various functional applications and data processing by running the software programs and modules stored in the memory 1520. The memory 1520 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 1520 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1520 may also include a memory controller to provide access to the memory 1520 for the processor 1580 and the input unit 1530.

[0287] Input unit 1530 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, input unit 1530 may include touch-sensitive surface 1531 and other input devices 1532. Touch-sensitive surface 1531, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as user operations using fingers, styluses, or any suitable object or accessory on or near touch-sensitive surface 1531), and drive corresponding connection devices according to a pre-set program. Optionally, touch-sensitive surface 1531 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 1580, and can receive and execute commands from processor 1580. In addition, the touch-sensitive surface 1531 can be implemented using various methods such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0288] The display unit 1540 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit 1540 may include a display panel 1541, which may optionally be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar display panel 1541. Further, a touch-sensitive surface 1531 may cover the display panel 1541. When the touch-sensitive surface 1531 detects a touch operation on or near it, it transmits the information to the processor 1580 to determine the type of touch event. Subsequently, the processor 1580 provides corresponding visual output on the display panel 1541 according to the type of touch event. The touch-sensitive surface 1531 and the display panel 1541 can be two independent components to implement input and output functions. However, in some embodiments, the touch-sensitive surface 1531 and the display panel 1541 can be integrated to achieve both input and output functions.

[0289] The terminal may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1541 according to the ambient light level, and the proximity sensor can turn off the display panel 1541 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured on the terminal, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0290] Audio circuitry 1560, speaker 1561, and microphone 1562 provide an audio interface between the user and the terminal. Audio circuitry 1560 converts received audio data into electrical signals, which are then transmitted to speaker 1561, where they are converted into sound signals for output. Conversely, microphone 1562 converts collected sound signals into electrical signals, which are received by audio circuitry 1560, converted back into audio data, and then processed by processor 1580 before being transmitted via RF circuitry 1510 to, for example, another terminal, or output to memory 1520 for further processing. Audio circuitry 1560 may also include an earphone jack to facilitate communication between a peripheral headset and the terminal.

[0291] WiFi is a short-range wireless transmission technology. This terminal, through the WiFi module 1570, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 15 WiFi module 1570 is shown, but it is understood that it is not an essential component of the terminal and can be omitted as needed without changing the nature of the invention.

[0292] The processor 1580 is the control center of the terminal, connecting various parts of the terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 1520, and calls data stored in the memory 1520 to perform various functions and process data, thereby enabling overall monitoring of the terminal. Optionally, the processor 1580 may include one or more processing cores; preferably, the processor 1580 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interaction area, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1580.

[0293] The terminal also includes a power supply 1590 (such as a battery) to power various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1590 may also include one or more DC or AC power supplies, a recharging system, a power fault detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0294] Although not shown, the terminal may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the display unit of the terminal is a touch screen display, and the terminal also includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors of the instructions in the method embodiment of the present invention.

[0295] The aforementioned memory also includes a computer program stored in the memory and configured to be executed by one or more processors to implement the aforementioned object rendering method.

[0296] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction, the at least one program segment, the code set, or the instruction set is executed by a processor to implement the object rendering method.

[0297] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0298] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the object rendering method described above.

[0299] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0300] In addition, in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0301] The above are merely exemplary embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application shall be included within the protection scope of this application.

Claims

1. An object rendering method, characterized in that, The method includes: Obtain the model corresponding to the object, the model being used to characterize the shape of the primitives in the object and the spatial position of the primitives, the object having the visual characteristic of allowing some light to pass through; Based on the set of vertices corresponding to the primitives in the model, determine the position of the circumcircle center of the primitive; The bounding box corresponding to the model is divided perpendicular to the line of sight to obtain at least two spatial regions; the at least two spatial regions are sequentially sorted in ascending order along the line of sight from far to near to obtain the region identifiers corresponding to each of the at least two spatial regions. The spatial region into which the circumcircle center of a graphic element falls is defined as the spatial region corresponding to the graphic element. Based on the spatial region corresponding to each graphic element and the region identifier corresponding to each spatial region, the spatial location code of each graphic element is determined. Based on the spatial location code of each of the at least two graphic elements, the spatial position relationship of the at least two graphic elements is determined; The object model is rendered according to the rendering order of the at least two primitives determined based on the spatial relationship, and the rendering result of the object is obtained.

2. The method according to claim 1, characterized in that, The spatial positional relationship of the at least two graphic elements includes an occlusion relationship used to characterize the first graphic element being occluded by the second graphic element, wherein the first graphic element and the second graphic element belong to the at least two graphic elements; The step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes: Render the first primitive to obtain the rendering result of the first primitive; After rendering the first primitive, the second primitive is rendered to obtain the rendering result of the second primitive; The rendering result of the object includes the rendering result of the first primitive and the rendering result of the second primitive.

3. The method according to claim 1, characterized in that, The step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes: Based on the spatial relationship between the at least two graphic elements, the at least two graphic elements are sorted to obtain a graphic element sorting result; in the graphic element sorting result, if the third graphic element is located before the fourth graphic element, the spatial relationship between the third graphic element and the fourth graphic element includes: the third graphic element is occluded by the fourth graphic element, or the third graphic element and the fourth graphic element do not occlude each other, and the third graphic element and the fourth graphic element are any two graphic elements in the graphic element sequence; Each element in the element sorting result is rendered sequentially to obtain the rendering result of the object.

4. The method according to claim 1, characterized in that, Determining the spatial location code of each graphic element based on its corresponding spatial region and its corresponding region identifier includes performing the following operation on the fifth graphic element in each graphic element: Determine a first region identifier, which is the region identifier of the spatial region where the fifth graphic element is located; If the first region identifier is not the smallest region identifier, count the total number of graphic elements whose circumcircle centers fall into the spatial region corresponding to the second region identifier, where the second region identifier is less than the first region identifier. Based on the total quantity, the spatial location code of the fifth graphic element is determined.

5. The method according to claim 1 or 4, characterized in that, The step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes: Based on the spatial position codes of each of the graphic elements indicating the spatial positional relationships between different graphic elements, the vertices of each of the graphic elements are sorted to determine the vertex index of each vertex of each graphic element. Based on the vertex index of each vertex of each primitive, the rendering order of each vertex in the object model is determined; Based on the rendering order, the object model is rendered to obtain the rendering result of the object.

6. The method according to claim 5, characterized in that, The step of sorting the vertices of each of the graphic elements based on the spatial position codes indicating the spatial position relationships between different graphic elements and determining the vertex index of each vertex of each graphic element includes: sequentially encoding the vertices of related graphic elements in ascending order of spatial position codes to obtain the vertex index of each vertex of each graphic element.

7. The method according to claim 1, characterized in that, The primitive is a triangular primitive. Determining the position of the circumcenter of the primitive based on the vertex set corresponding to the primitive in the model includes: Obtain a first vector and a second vector, wherein the first vector and the second vector respectively represent the first side and the second side of the primitive; Based on the first vector and the second vector, determine the normal vector perpendicular to the primitive; The position of the circumcenter of the primitive is determined by squaring the first vector and the second vector, and using the normal vector.

8. The method according to claim 1, characterized in that, Before dividing the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions, the method further includes: converting the model in world space to view space.

9. The method according to claim 1, characterized in that, The process of dividing the bounding box corresponding to the model perpendicular to the line of sight to obtain at least two spatial regions includes: Based on the scene information corresponding to the model, the segmentation granularity is determined; Based on the segmentation granularity, the bounding box corresponding to the model is segmented in a manner perpendicular to the line of sight to obtain the at least two spatial regions.

10. The method according to claim 9, characterized in that, The scene information corresponding to the model includes at least one of the following: The complexity of the model; Rendering quality requirements; Rendering speed requirements; The model is viewed from the perspective of the observation camera.

11. The method according to claim 1, characterized in that, The model corresponding to the obtained object includes: Receive first scene description data, the first scene description data including the identifier of the object and the first state data of the object in the scene; Based on the first scene description data, obtain the model corresponding to the object; The step of rendering the object model according to the rendering order of the at least two primitives determined based on the spatial positional relationship, to obtain the rendering result of the object, includes: Based on the rendering result of the object, the first video frame corresponding to the first scene description data is obtained.

12. The method according to claim 11, characterized in that, The method further includes: Receive second scene description data, the second scene description data including the identifier of the object and the second state data of the object in the scene; A second video frame corresponding to the second scene description data is generated, and the second video frame is the next video frame after the first video frame.

13. The method according to claim 12, characterized in that, The method further includes: Send a video stream, the video stream including the first video frame and the second video frame.

14. An object rendering apparatus, characterized in that, The device includes: The model acquisition module is used to acquire the model corresponding to the object. The model is used to represent the shape of the primitives in the object and the spatial position of the primitives. The object has the visual characteristic of allowing some light to pass through. The circumcircle center determination module is used to determine the position of the circumcircle center of the primitive based on the vertex set corresponding to the primitive in the model; The positional relationship determination module is used to divide the bounding box corresponding to the model in a manner perpendicular to the line of sight to obtain at least two spatial regions; to sequentially sort the at least two spatial regions in ascending order along the line of sight from far to near to obtain the region identifiers corresponding to each of the at least two spatial regions; to determine the spatial region corresponding to the graphic element as the spatial region of the graphic element; to determine the spatial position code of each graphic element based on the spatial region corresponding to each graphic element and the region identifier corresponding to each spatial region; and to determine the spatial positional relationship of the at least two graphic elements based on the spatial position codes of each graphic element in the at least two graphic elements. The rendering module is used to render the object model according to the rendering order of the at least two primitives determined based on the spatial position relationship, and obtain the rendering result of the object.

15. The apparatus according to claim 14, characterized in that, The spatial positional relationship of the at least two graphic elements includes an occlusion relationship used to characterize the first graphic element being occluded by the second graphic element, wherein the first graphic element and the second graphic element belong to the at least two graphic elements; The rendering module is used for: Render the first primitive to obtain the rendering result of the first primitive; After rendering the first primitive, the second primitive is rendered to obtain the rendering result of the second primitive; The rendering result of the object includes the rendering result of the first primitive and the rendering result of the second primitive.

16. The apparatus according to claim 14, characterized in that, The rendering module is used for: Based on the spatial relationship between the at least two graphic elements, the at least two graphic elements are sorted to obtain a graphic element sorting result; In the primitive sorting result, if the third primitive is located before the fourth primitive, the spatial relationship between the third primitive and the fourth primitive includes: the third primitive is occluded by the fourth primitive, or the third primitive and the fourth primitive do not occlude each other, and the third primitive and the fourth primitive are any two primitives in the primitive sequence; Each element in the element sorting result is rendered sequentially to obtain the rendering result of the object.

17. The apparatus according to claim 14, characterized in that, The positional relationship determination module is used to perform the following operation on the fifth graphic element among the graphic elements: Determine a first region identifier, which is the region identifier of the spatial region where the fifth graphic element is located; If the first region identifier is not the smallest region identifier, count the total number of graphic elements whose circumcircle centers fall into the spatial region corresponding to the second region identifier, where the second region identifier is less than the first region identifier. Based on the total quantity, the spatial location code of the fifth graphic element is determined.

18. The apparatus according to claim 14 or 17, characterized in that, The rendering module is used for: Based on the spatial position codes of each of the graphic elements indicating the spatial positional relationships between different graphic elements, the vertices of each of the graphic elements are sorted to determine the vertex index of each vertex of each graphic element. Based on the vertex index of each vertex of each primitive, the rendering order of each vertex in the object model is determined; Based on the rendering order, the object model is rendered to obtain the rendering result of the object.

19. The apparatus according to claim 18, characterized in that, The rendering module is used for: The vertices of the relevant primitives are encoded sequentially in ascending order of spatial location codes to obtain the vertex index of each vertex of each primitive. The rendering order of each vertex in the object model is determined according to the ascending order of the vertex index.

20. The apparatus according to claim 14, characterized in that, The graphic element is a triangular graphic element, and the module for determining the center of the circumcircle is used for: Obtain a first vector and a second vector, wherein the first vector and the second vector respectively represent the first side and the second side of the primitive; Based on the first vector and the second vector, determine the normal vector perpendicular to the primitive; The position of the circumcenter of the primitive is determined by squaring the first vector and the second vector, and using the normal vector.

21. The apparatus according to claim 14, characterized in that, The positional relationship determination module is used for: Transform the model from world space to view space.

22. The apparatus according to claim 21, characterized in that, The positional relationship determination module is used for: Based on the scene information corresponding to the model, the segmentation granularity is determined; Based on the segmentation granularity, the bounding box corresponding to the model is segmented in a manner perpendicular to the line of sight to obtain the at least two spatial regions.

23. The apparatus according to claim 14, characterized in that, The scene information corresponding to the model includes at least one of the following: The complexity of the model; Rendering quality requirements; Rendering speed requirements; The model is viewed from the perspective of the observation camera.

24. The apparatus according to claim 14, characterized in that, The model acquisition module is used for: Receive first scene description data, the first scene description data including the identifier of the object and the first state data of the object in the scene; Based on the first scene description data, obtain the model corresponding to the object; The rendering module is used for: Based on the rendering result of the object, the first video frame corresponding to the first scene description data is obtained.

25. The apparatus according to claim 24, characterized in that, The rendering module is used for: Receive second scene description data, the second scene description data including the identifier of the object and the second state data of the object in the scene; A second video frame corresponding to the second scene description data is generated, and the second video frame is the next video frame after the first video frame.

26. The apparatus according to claim 25, characterized in that, The rendering module is used for: Send a video stream, the video stream including the first video frame and the second video frame.

27. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the object rendering method as described in any one of claims 1 to 13.

28. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the object rendering method as described in any one of claims 1 to 13.

29. A computer program product, characterized in that, The computer program product includes computer instructions, the processor of the computer device reads the computer instructions, and the processor of the computer device executes the computer instructions to implement the object rendering method as described in any one of claims 1 to 13.