Rendering method, computing device and computer-readable storage medium

By determining the transparency and light source information of the model and combining the model acceleration structure, the problems of high consumption of translucent object rendering resources and poor shadowing effects are solved, and a unified rendering and efficient rendering process of translucent and opaque models are realized.

WO2025138023A1PCT designated stage expired Publication Date: 2025-07-03ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD

Patent Information

Application Number
PCT/CN2023/142884
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the prior art, rendering of translucent objects requires separate rendering steps, resulting in high resource consumption and flickering problems, making it difficult to render uniformly with opaque objects, and the translucent shadowing effect is not good.

Method used

By determining the transparency information of the model to be rendered, using the light source information and model to accelerate the structure, calculate the shadow information, realize unified rendering of semi-transparent and opaque models, simplify the rendering process, and generate semi-transparent shadows that conform to physical laws.

Benefits of technology

It realizes unified rendering of semi-transparent models and opaque models, reduces resource consumption, improves rendering efficiency and the authenticity of shadow effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023142884_03072025_PF_FP_ABST
    Figure CN2023142884_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a rendering method, a computing device and a computer-readable storage medium. The rendering method comprises: receiving a rendering instruction for a target virtual scene, wherein the target virtual scene comprises at least one model to be rendered; determining transparency information of each model to be rendered, and on the basis of the transparency information of each model to be rendered, determining a region to be rendered of each model to be rendered; on the basis of light source information in the target virtual scene, determining vertex rendering information of each vertex to be rendered in each region to be rendered; and on the basis of each piece of the vertex rendering information, rendering each model to be rendered in the target virtual scene, and generating each rendered object of the target virtual scene. By means of the method provided in the present application, the richness and accuracy of model rendering are improved, and the calculation amount of model rendering is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Rendering method, computing device, and computer-readable storage medium Technical Field

[0001] The present application relates to the field of model rendering technology, and in particular to a rendering method, a rendering apparatus, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of computer technology, the virtual world is increasingly involved in people's lives, such as console games, virtual movies, VR experience, AR experience, etc. When users experience the virtual world, they need to render and generate corresponding virtual scenes to make users have a better experience.

[0003] In the process of rendering virtual scenes, the technical application of ray tracing pipelines is becoming more and more advanced. Currently, opaque objects are usually drawn. Rendering reflections, translucent objects, etc. has always been a time-consuming and labor-intensive problem. The rendering of translucent objects usually requires a separate rendering step, which will bring more resource consumption and there will be flickering problems. Therefore, how to render translucent objects and opaque objects together and save resource consumption has become an urgent problem that technicians need to solve.

[0004] Summary of the Invention

[0005] In view of this, an embodiment of the present application provides a rendering method. The present application also relates to a rendering apparatus, a computing device, and a computer-readable storage medium to solve the above-mentioned problems existing in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a rendering method is provided, including:

[0007] Receiving a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered;

[0008] Determining transparency information of each to-be-rendered model, and determining a to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model;

[0009] Determining vertex rendering information of each vertex to be rendered in each area to be rendered according to light source information in the target virtual scene;

[0010] Render each to-be-rendered model in the target virtual scene according to each vertex rendering information, and generate each rendering object of the target virtual scene.

[0011] According to a second aspect of an embodiment of the present application, a rendering device is provided, including:

[0012] A receiving module is configured to receive a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered;

[0013] A first determining module is configured to determine transparency information of each to-be-rendered model, and determine a to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model;

[0014] A second determining module is configured to determine vertex rendering information of each to-be-rendered vertex in each to-be-rendered area according to light source information in the target virtual scene;

[0015] The rendering module is configured to render each to-be-rendered model in the target virtual scene according to each vertex rendering information, and generate each rendering object of the target virtual scene.

[0016] According to a third aspect of an embodiment of the present application, there is provided an extended reality (XR) device, including a memory, a processor, and a display;

[0017] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the following steps are implemented:

[0018] Receiving a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered;

[0019] Determining transparency information of each to-be-rendered model, and determining a to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model;

[0020] Determining vertex rendering information of each vertex to be rendered in each area to be rendered according to light source information in the target virtual scene;

[0021] Rendering each to-be-rendered model in the target virtual scene according to each vertex rendering information to generate each rendering object of the target virtual scene;

[0022] Each rendered object is displayed through the display of the extended reality XR device.

[0023] According to a fourth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the rendering method when executing the computer instructions.

[0024] According to a fifth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the computer instructions are executed by a processor, the steps of the rendering method are implemented.

[0025] The rendering method provided in the present application receives a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered; determines the transparency information of each model to be rendered, and determines the rendering area of ​​each model to be rendered based on the transparency information of each model to be rendered; determines the vertex rendering information of each vertex to be rendered in each rendering area based on the light source information in the target virtual scene; renders each model to be rendered in the target virtual scene based on the vertex rendering information, and generates each rendering object of the target virtual scene.

[0026] An embodiment of the present application realizes that, in ray tracing technology, translucent models and opaque models can be rendered uniformly without changing the model material, thereby simplifying the rendering process; in addition, shadow information can be further calculated based on the model's opaque sub-model depth information, translucent sub-model depth information and translucent sub-model color information through light source information, so that colorful translucent shadows that are more in line with physical laws can be projected, thereby improving the richness of model rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG1 is a flowchart of a rendering method provided by an embodiment of the present application;

[0028] FIG2 is a schematic diagram of a model to be rendered area according to an embodiment of the present application;

[0029] FIG3 is a schematic diagram of a shadow-to-be-rendered area of ​​a generation model provided by an embodiment of the present application;

[0030] FIG4 is a schematic structural diagram of a point light source spatial acceleration structure provided in one embodiment of the present application;

[0031] FIG5 is a schematic diagram of pixel positioning provided by an embodiment of the present application;

[0032] FIG6 is a schematic structural diagram of a rendering device provided by an embodiment of the present application;

[0033] FIG7 is a structural block diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.

[0035] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0036] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0037] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0038] First, the terms involved in one or more embodiments of the present application are explained.

[0039] Ray tracing, also known as ray tracing, is a method for presenting three-dimensional images on a two-dimensional screen. Ray tracing is a general technique derived from geometric optics that models the paths taken by light rays by tracing them as they interact with optical surfaces.

[0040] In the present application, a rendering method is provided. The present application also relates to a rendering apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0041] FIG1 shows a flowchart of a rendering method according to an embodiment of the present application, which specifically includes the following steps:

[0042] Step 102: Receive a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered.

[0043] The target virtual scene specifically refers to the virtual scene that needs to be rendered within the virtual scene. In practical applications, the target virtual scene can be a scene in a game, a scene in a film or television work, and so on. The virtual scene typically also includes at least one model to be rendered. A model to be rendered specifically refers to a model that needs to be rendered within the target virtual scene. For example, the target virtual scene may include architectural models, character models, animal models, plant models, and so on. In practical applications, the target virtual scene often includes more than just one model to be rendered.

[0044] In a specific embodiment provided in the present application, the target virtual scene is usually composed of multiple models to be rendered. When a technician needs to build a target virtual scene, the technician sends a scene rendering instruction to the terminal, and the terminal can receive the rendering instruction for the target virtual scene. The target virtual scene usually also includes multiple models to be rendered. At the same time, the rendering instruction usually also includes some rendering information corresponding to each model to be rendered, such as material information, texture information, etc.

[0045] Step 104: Determine the transparency information of each model to be rendered, and determine the to-be-rendered area of ​​each model to be rendered according to the transparency information of each model to be rendered.

[0046] The transparency information specifically refers to the type of transparency of the model to be rendered. For example, the model to be rendered is a translucent object, such as glass, a translucent lampshade, tulle, etc. The model to be rendered can also be an opaque object, such as a wall, a mirror, etc. In practical applications, the model to be rendered can also include both translucent objects and transparent objects. For example, the object to be rendered is a character model, and the character model's clothing has translucent parts and opaque parts.

[0047] The area to be rendered specifically refers to the part that needs to be rendered in the target virtual scene. For example, when the model to be rendered is a house, the house is surrounded by walls. The part inside the house that is blocked by the opaque walls does not need to be rendered because it cannot be seen visually. The glass of the house is a translucent object, and the interior layout can be seen through the glass. The interior part that can be seen through the glass is the area to be rendered.

[0048] In practical applications, the extent to which each model to be rendered in the target virtual scene needs to be rendered and which parts need to be rendered need to be determined based on the transparency information of each model to be rendered. By determining the rendering area of ​​each model to be rendered based on the transparency information of each model to be rendered, the rendered model can not only meet the visual experience of the target virtual scene, but also avoid the waste of resources caused by rendering invisible parts.

[0049] In a specific embodiment provided in the present application, determining the to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model includes S1042-S1048:

[0050] S1042: Determine virtual lens information and light source information corresponding to the target virtual scene.

[0051] Virtual lens information refers to the virtual lens used to generate the target virtual scene, meaning that the target virtual scene can be seen from the virtual lens information. Light source information refers to the objects that emit light within the target virtual scene. Virtual lens information affects the rendering area of ​​the model to be rendered, determining which areas are rendered and which are not. Light source information also affects the brightness and shadow information of the rendered object.

[0052] Furthermore, the virtual lens information sends a ray to the target virtual scene's object to be rendered. If it encounters an opaque object, it does not need to render the portion after the opaque object. If it encounters a semi-transparent object, it can continue the ray. Using a method similar to light source area division (TileBaseRendering), all light sources in the current area that can affect the current pixel are obtained, and these lights are used to render the object, simplifying the process.

[0053] The virtual lens information includes virtual lens parameter information such as position information, viewing angle information, and focus information of the virtual lens; the light source information includes light source parameter information such as type information, position information, quantity information, and brightness information of the light source.

[0054] S1044: Determine scene depth information according to the virtual lens information and transparency information of each to-be-rendered model.

[0055] After obtaining the virtual lens information, the scene depth information of the target virtual scene can be further determined based on the transparency information of the virtual lens and the model to be rendered. The scene depth information specifically refers to the clear range before and after the focus. The greater the scene depth, the clearer the entire image will be from the distant view to the near view.

[0056] Typically, the source of scene depth information is a pre-calculated depth map. The color information of each pixel in the depth map is represented by black and white, and the value threshold is usually 0-1. The closer to the virtual lens, the smaller the value, the closer to 0, and the farther away from the virtual lens, the larger the value, the closer to 1.

[0057] S1046 : Determine a model to-be-rendered area corresponding to each to-be-rendered model according to the scene depth information and the transparency information of each to-be-rendered model.

[0058] After the scene depth information is determined, the model to-be-rendered area corresponding to each to-be-rendered model is further determined based on the ray tracing technology and the transparency information of each to-be-rendered model.

[0059] In a specific embodiment provided in the present application, determining the model to-be-rendered area corresponding to each to-be-rendered model according to the scene depth information and the transparency information of each to-be-rendered model includes:

[0060] Construct a model acceleration structure corresponding to each model to be rendered;

[0061] emitting a target incident light ray to a target pixel point on a screen corresponding to the target virtual scene based on the virtual lens information, wherein the screen includes a plurality of pixel points;

[0062] When the target incident light intersects the target model acceleration structure, determining intersection depth information corresponding to the target model acceleration structure;

[0063] Determining a traveling direction of the target incident light according to the intersection depth information, the scene depth information, and transparency information of the target model to be rendered, until a stopping condition of the incident light is reached;

[0064] Determining the rendering order of the target model to be rendered according to the hitting order of the target incident light rays;

[0065] A model to-be-rendered area corresponding to each target model to be rendered and model rendering information corresponding to each model to-be-rendered area are generated according to the target incident light, the rendering order, and the model material information of each target model to be rendered.

[0066] In practical applications, a model acceleration structure must be constructed for each model to be rendered in the target virtual scene. Ray tracing improves the quality of the virtual scene, but it also results in slower rendering speeds. Because the intersection of a ray with the scene requires intersecting all triangles with the ray, and this is only for a single pixel, some method is needed to accelerate the ray tracing process, namely, to construct a model acceleration structure.

[0067] The model acceleration structure includes axis-aligned bounding box, uniform space division, KD-Tree space division, hierarchical bounding volume structure (Bounding Volume Hierarchy, BVH), etc. The model acceleration structure specifically refers to using a bounding box to enclose the model to be rendered. Before calculating the intersection with the triangular surface of the model to be rendered, it is first determined whether the light intersects with the bounding box. If the bounding box has no intersection with the light, the model to be rendered will not have any intersection with the light.

[0068] After the model acceleration structure is determined, based on the position of the virtual lens in the virtual lens information as the starting point, incident light is emitted to each pixel point of the screen corresponding to the target virtual scene. The light emitted to the target pixel point is the target incident light, and it is judged whether the incident light intersects with the triangular surface in the model acceleration structure. The process of judging whether the incident light intersects with the triangular surface in the model acceleration structure is not repeated here. The screen corresponding to the target virtual scene specifically refers to the two-dimensional display screen corresponding to the three-dimensional virtual scene. In actual applications, the target virtual scene is rendered in the three-dimensional scene, and finally the virtual scene in the three-dimensional scene is displayed on the two-dimensional display screen. Based on this, incident light is emitted to each pixel point on the screen based on the virtual lens information, thereby entering the three-dimensional target virtual scene, so as to judge which models to be rendered are hit.

[0069] Once the target incident ray intersects the target model acceleration structure, the intersection depth information corresponding to the target model acceleration structure can be determined. This intersection depth information can be understood as the distance from the virtual camera position to the point where the incident ray intersects the triangle face of the model to be rendered. The direction of the incident ray is determined until the stopping condition of the incident ray is met.

[0070] After the target incident light stops, the rendering order of the target models to be rendered is further determined according to the order in which the target incident light hits the models to be rendered. The hitting order refers to the order in which the incident light hits the models to be rendered, and the rendering order refers to the order in which the models to be rendered are rendered.

[0071] Finally, the model to-be-rendered area and model rendering information corresponding to the target to-be-rendered model are generated according to the incident light, the rendering order, the model material information of each target to-be-rendered model, etc.

[0072] Furthermore, the direction of the incident light of the target can be determined based on the intersection depth information, the scene depth information, and the transparency information of the target model to be rendered. In the method provided in this application, the direction of the incident light specifically includes continuing to move forward or stopping. Specifically, the direction of the incident light of the target is determined based on the intersection depth information, the scene depth information, and the transparency information of the target model to be rendered until the stopping condition of the incident light is met, including:

[0073] When the intersection depth information is less than the scene depth information and the transparency information of the target model to be rendered is semi-transparent, maintaining the traveling direction of the target incident light;

[0074] When the intersection depth information is greater than or equal to the scene depth information, or the transparency information of the target model to be rendered is opaque, the incident light stopping condition is met;

[0075] Accordingly, the rendering order of the target model to be rendered is determined according to the hitting order of the target incident light, including:

[0076] Determining a model hitting order according to a hitting order in which the target incident light hits the target to-be-rendered model;

[0077] The rendering order of the target to-be-rendered models is determined according to the reverse order of the model hit order.

[0078] In actual applications, if the intersection depth information is less than the scene depth information and the transparency information of the target model to be rendered is semi-transparent, the direction of the target incident light is maintained. If the intersection depth information is greater than or equal to the scene depth information, or the transparency information of the target model to be rendered is opaque, the target incident light is stopped.

[0079] See Figure 2, which shows a schematic diagram of determining the model's rendering area according to one embodiment of the present application. As shown in Figure 2, the near plane is the plane closest to the virtual camera. The intersection of the virtual camera and the near plane represents the display screen corresponding to the target virtual scene. The distance between the near plane and the far plane represents the scene depth. A, B, C, and D represent the model to be rendered.

[0080] The virtual camera emits a ray toward a pixel on the display screen corresponding to the three-dimensional target virtual scene. The ray enters the target virtual scene and first hits the translucent model A. The intersection depth information 1 of the translucent model A is calculated. If the intersection depth information 1 is less than the scene depth information, the direction of the incident light is maintained. In the same way, the incident light passes through the translucent model B and the translucent model C until it reaches the opaque model D. In actual applications, if there is no opaque model D, it stops after hitting the far plane. If the order in which the target incident light hits the models to be rendered is (A, B, C, D), the reverse order (D, C, B, A) is determined as the rendering order of the target models to be rendered.

[0081] In a specific embodiment provided in the present application, determining the rendering order of the target to-be-rendered models according to the reverse order of the model hit order includes:

[0082] Counting the number of target models to be rendered in the model hit sequence;

[0083] When the number of models is greater than a threshold, updating the model hit order according to the threshold;

[0084] The rendering order of the target to-be-rendered models is determined according to the reverse order of the updated model hit order.

[0085] In actual applications, there may be multiple models to be rendered in the target virtual scene. The closer the translucent model is to the plane, the smaller the impact on the final presentation on the near-plane display screen. In order to improve rendering efficiency, the number of models to be rendered in the model hit order can be counted. If the number of models is greater than a preset threshold, only a preset number of translucent models can be retained. For example, the model hit order is (1, 2, 3, 4, 5, 6, 7, 8, 9), where 1-8 are translucent models and 9 is an opaque model. The threshold is 4, that is, only the first 4 translucent models are retained. After updating the model hit order according to the threshold, the obtained model hit order is (1, 2, 3, 4, 9). Then, according to the reverse order of the model hit order, the rendering order of the target model to be rendered is determined to be (9, 4, 3, 2, 1).

[0086] In a specific embodiment provided in the present application, generating a model to-be-rendered area corresponding to each target model to be rendered and model rendering information corresponding to each model to be rendered area according to the target incident light, the rendering order, and the model material information of each target model to be rendered includes:

[0087] Determine the target model to be rendered according to the rendering order;

[0088] When the transparency information of the target model to be rendered is opaque, determining the model to be rendered area and model rendering information corresponding to the target model to be rendered according to the target incident light, the target model to be rendered, and the model material information corresponding to the target model to be rendered;

[0089] When the transparency information of the target model to be rendered is semi-transparent, the model area to be rendered and the model rendering information corresponding to the target model to be rendered are determined based on the target incident light, the target model to be rendered, the model material information corresponding to the target model to be rendered and the model rendering information of the previous target model to be rendered.

[0090] In actual applications, after the rendering order is determined, rendering can be performed according to the rendering order. Specifically, the target rendering model to be processed is first determined according to the rendering order. If the transparency information of the target rendering model to be processed is opaque, the model rendering area and model rendering information corresponding to the target rendering model to be processed can be determined based on the target incident light, the target rendering model to be processed and the model material information corresponding to the target rendering model to be processed, the color of the part to be rendered, etc.

[0091] If the transparency information of the target rendering model to be processed is semi-transparent, it is necessary to combine the model rendering information of the previous target rendering model to be processed to calculate the model rendering area and model rendering information corresponding to the current target rendering model to be processed.

[0092] For example, take the rendering order of (D, C, B, A) as an example for explanation, where model D is an opaque model. First, a mixing calculation is performed based on the target incident light and the model information of the opaque model D to determine the color 1 of the intersection point; then the color 1 is mixed with the model information of the translucent model C to determine the color 2 of the intersection point; then the color 2 is mixed with the model information of the translucent model B to determine the color 3 of the intersection point; then the color 3 is mixed with the model information of the translucent model A to determine the color information of the final target pixel point.

[0093] The points where the target incident light intersects each semi-transparent target rendering model are all points on the model to-be-rendered area of ​​each target rendering model, and the rendering information of the point is obtained by calculation through the above steps.

[0094] The method provided by this application determines the model to be rendered area corresponding to each model to be rendered based on scene depth information and transparency information of each model to be rendered. In the process of rendering a semi-transparent model based on real-time ray tracing, there is no need to change the material of the semi-transparent model, and rendering can be based on the material information of the opaque model. At the same time, if the number of intersecting semi-transparent models exceeds a preset threshold, the number of corresponding semi-transparent models can be reduced, thereby reducing rendering resources and improving rendering efficiency.

[0095] S1048. Determine the model shadow to-be-rendered area corresponding to each to-be-rendered model according to the light source information and the transparency information of each to-be-rendered model.

[0096] Based on the light source information and the transparency information of each model to be rendered, the model shadow rendering area corresponding to each model to be rendered can be further determined. Specifically, in the target virtual scene, if there is a light source, the closer the model is to the light source, the stronger the lighting information will be. If it is a translucent model, the light source will be transmitted to the model behind it. If the light source shines on an opaque model, the shadow information of the light will also be left behind the opaque model.

[0097] In the current virtual scene development, after solving the translucent rendering order, translucent shadows are still a missing function in most virtual scenes. In the UE engine, the translucent effect is achieved through dithering. Since opaque objects are used to simulate translucent objects, a certain translucent shadow effect can be achieved, but only black and white shadow effects can be achieved, and the flickering problem has not been properly solved.

[0098] In a specific embodiment provided in the present application, determining the model shadow to-be-rendered area corresponding to each to-be-rendered model according to the light source information and the transparency information of each to-be-rendered model includes:

[0099] Determining model clipping information of a target model to be rendered according to the light source information;

[0100] Splitting the target model to be rendered into an opaque submodule and a semi-transparent submodule according to transparency information of the target model to be rendered;

[0101] Determine the light source depth information corresponding to the target model to be rendered according to the light source information and the opaque sub-module;

[0102] Performing light source depth detection on the translucent submodule according to the light source depth information, and determining translucent submodule color information and translucent submodule depth information corresponding to the translucent submodule;

[0103] The model shadow to-be-rendered area is determined according to the light source depth information, the semi-transparent submodule color information, and the semi-transparent submodule depth information.

[0104] In actual applications, the lighting range information is determined based on the light source information. When there are translucent objects within the lighting range, the rendering state of the GPU hardware is used to set acceleration, and three temporary data (opaque object depth, translucent object depth, and translucent object color) are rendered at the same time. When the light source information needs to be applied for lighting effects, opaque shadow effects and translucent shadow effects can be generated based on these three temporary data.

[0105] Specifically, the model clipping information of the target model to be rendered is first determined according to the light source information, wherein the model clipping information specifically refers to the shadow clipping range of the target model to be rendered determined based on the light source information in the target virtual scene.

[0106] Furthermore, the target model to be rendered usually includes an opaque sub-module and a translucent sub-module. In the method provided in the embodiment of the present application, the opaque sub-module is rendered first, and the light source depth information of the target model to be rendered is recorded based on the opaque sub-module after rendering. The light source depth information is specifically the lighting distance from the light source to the opaque sub-module.

[0107] After recording the light source depth information corresponding to the opaque sub-module in the target model to be rendered, the light source depth detection can be performed on the translucent sub-module based on the light source depth information. The light source depth detection specifically refers to determining whether the distance from the light source to the translucent sub-module is less than the distance from the light source to the opaque sub-module.

[0108] During the process of light source depth detection, the light source information is recorded to the translucent sub-module depth information of each translucent sub-module, and only the translucent sub-modules whose translucent sub-module depth information is less than the light source depth information are retained. At the same time, the translucent sub-module color information of the retained translucent sub-module is recorded (it should be noted that the translucent sub-module color information also includes the translucent sub-module transparency information), and the translucent sub-module color information and the translucent sub-module depth information are saved. Furthermore, the translucent sub-module color information is saved in the translucent sub-module color map, and the translucent sub-module depth information is saved in the translucent sub-module depth map for use in subsequent rendering.

[0109] After the light source depth detection, the light source depth information, translucent submodule color information, and translucent submodule depth information can be obtained. Based on these three pieces of information, a color mask map corresponding to the screen range of the target virtual scene can be generated. The color mask map is the shadow part of the target module to be rendered. When the light source information is applied, the color mask map can be sampled to simulate the generated model shadow area to be rendered. Further depth detection is performed based on the translucent submodule depth information and the light source depth information. Specifically, it is determined whether the current scene depth passes the depth detection of the translucent submodule depth information. If the current depth information is greater than the translucent submodule depth information, the shadow effect is generated by the following formula 1: C f =mix(vec3(1,1,1),C t *(1-α),fα) Formula 1

[0110] Among them, C f is the shadow information, vec3(1, 1, 1) is the light source color information when there is no shadow, C t is the color information of the semi-transparent submodule, α is the transparency information of the semi-transparent submodule, and f α It is a mixing factor related to the model material, which is used to adjust the ratio of light source color information and translucent object color information, thereby generating shadow information that better meets realistic needs.

[0111] Refer to Figure 3, which shows a schematic diagram of the generated model shadow to be rendered area provided by an embodiment of the present application. As shown in Figure 3, the object clipping result of the target model to be rendered within the illumination range of the light source is first determined according to the light source information, and then the target model to be rendered is split into a translucent sub-module and an opaque sub-module according to the model type of the target model to be rendered.

[0112] First, render the opaque submodule and record the light source depth information from the light source to the opaque submodule. Based on this light source depth information, perform light source depth detection on each opaque submodule. When rendering the translucent submodule, save the translucent submodule depth information obtained through light source depth detection to the translucent submodule depth map, and save the translucent submodule color information to the translucent submodule color map.

[0113] Based on the light source depth information, translucent submodule color information, and translucent submodule depth information obtained in the above steps, a color mask corresponding to the model shadow rendering area within the screen range is generated and saved. When there is light, the color mask is sampled to simulate the lighting and shadow effects corresponding to the target model to be rendered under the generated light conditions.

[0114] Through this method, realistic translucent shadow effects can be achieved while ensuring rendering efficiency. Translucent objects of different colors can also cast colored translucent shadows that conform to physical laws, making the shadow effects generated by rendering more in line with user needs.

[0115] Step 106: Determine vertex rendering information of each vertex to be rendered in each area to be rendered according to the light source information in the target virtual scene.

[0116] Each area to be rendered includes multiple vertices to be rendered, and multiple vertices to be rendered can form a model to be rendered. In actual applications, as the light source information in the target virtual scene is different, the vertex rendering information corresponding to each vertex to be rendered is also different. In ray tracing technology, it is also necessary to further determine the vertex rendering information of each vertex to be rendered based on the light source information in the target virtual scene.

[0117] With the development of real-time rendering technology and computer hardware, real-time ray tracing technology has been applied to real-time games, film and television rendering, 3D reconstruction and other fields. However, compared with traditional rasterization rendering methods, real-time ray tracing still consumes more computing resources. Real-time ray tracing requires iterative execution of the following steps multiple times: emitting light, intersecting the light with the surface of the geometric body, and calculating the lighting of the light and the surface of the geometric body at the intersection. This is especially true when the target virtual scene includes multiple point light sources, such as multiple lights, candles, etc. In this case, each point light source will be traversed and the above iterative processing operations will be performed on each point light source in turn, resulting in the consumption of more computing resources.

[0118] When calculating the illumination between a light ray and the surface of the model to be rendered at an intersection, it is necessary to obtain and traverse every point light source and environment probe in the scene to be rendered to determine whether they affect the illumination of the surface of the model to be rendered. However, this traversal and judgment operation is inefficient. In actual applications, the number of point light sources and environment probes that can affect the surface of the model to be rendered at the intersection is limited. Most traversal operations have no effect on the final calculation, but they do consume a large amount of computing resources.

[0119] Based on this, in a specific embodiment provided in this application, the light source information includes information of multiple point light sources;

[0120] Determining vertex rendering information of each vertex to be rendered in each area to be rendered according to light source information in the target virtual scene, including:

[0121] Determine a plurality of point light source clusters according to the plurality of point light source information;

[0122] A target point light source cluster corresponding to a target vertex to be rendered is determined, and vertex light source rendering information corresponding to the target vertex to be rendered is calculated based on target point light source information in the target point light source cluster.

[0123] Specifically, in the method provided in this application, in the case of multiple point light sources in the target virtual scene, a list of point light sources is first obtained, and the multiple point light sources are pre-divided into multiple point light source clusters. When rendering the target model to be rendered, a ray tracing step is performed to emit light. When the emitted light intersects the target model to be rendered, the intersection point of the light and the target model to be rendered is determined, that is, the target vertex to be rendered is determined. The target point light source cluster corresponding to the target vertex to be rendered is further determined, and the vertex light source rendering information corresponding to the target vertex to be rendered is calculated based on the target point light source information in the target point light source cluster.

[0124] The information of each point light source includes the starting offset of the point light source and the number of acceleration objects of the point light source;

[0125] The method further comprises: constructing a point light source space acceleration structure;

[0126] Accordingly, determining a target point light source cluster corresponding to a target vertex to be rendered, and calculating vertex light source rendering information corresponding to the target vertex to be rendered based on target point light source information in the target point light source cluster, includes:

[0127] When the target vertex to be rendered is located in the point light source spatial acceleration structure, determining a target point light source cluster corresponding to the target vertex to be rendered;

[0128] The vertex rendering information corresponding to the target vertex to be rendered is calculated according to the starting offset of each point light source and the number of point light source acceleration objects corresponding to the target point light source cluster.

[0129] In a specific embodiment provided in the present application, a list of point light source information in the target virtual scene is first obtained, wherein the point light source information includes the radius of the point light source, the center coordinates, and the parameters used to calculate the surface shading of the geometric body (light source color, point light source attenuation coefficient, etc.).

[0130] Before ray tracing, a point light source space acceleration structure is constructed through a compute shader. Specifically: the center coordinate o of the acceleration structure is set to the coordinate of the main camera of the scene. The point light source space acceleration structure consists of n layers (n is an adjustable parameter. If the scene is large, n can be adaptively increased) of 80 angular balls from the inside to the outside. Among them, each layer of angular balls is obtained by keeping the center coordinate o unchanged and rotating the angles of the previous layer of angular balls proportionally. The distance h between each adjacent layer is kept equal (h is an adjustable parameter. If the density of point light sources in the scene is large, h can be less adaptable). The center coordinate o and the vertex coordinates of the innermost angular ball are extended to obtain 42 rays. The three-dimensional space is divided into 80 regions. Each region is divided into n clusters by n layers of angular balls. The entire point light source space acceleration structure includes 80*n clusters. The point light source falling in the point light source cluster is determined to be the point light source corresponding to the point light source cluster.

[0131] Refer to Figure 4, which shows a structural schematic diagram of a point light source spatial acceleration structure provided by an embodiment of the present application. For example, in the point light source spatial acceleration structure shown in Figure 4, p0, p1, p2, p3, p4, p5, and p6 are all in the same area, and each area is divided into n clusters by n layers of angular balls. Each cluster has a unique cluster ID starting from 0. For example, the triangular pyramid surrounded by p0, p1, p2, and p3 is a point light source cluster, and the triangular prism surrounded by p1, p2, p3, p4, p5, and p6 is a cluster. When the spatial acceleration structure is composed of n layers of angular balls, the internal space is divided into 80*n clusters.

[0132] Then, ray tracing is performed to generate rays. When the ray hits the surface of the target model to be rendered, the intersection point is the target vertex to be rendered. It is further determined whether the target vertex to be rendered is located in the point light space acceleration structure. If not, the subsequent calculation steps are stopped. If yes, the ID of the point light cluster in the point light space acceleration structure where the target vertex to be rendered is located is calculated. According to the point light cluster ID, the point light starting offset and the number of point light acceleration objects corresponding to each point light in the target point light cluster are obtained from the point light cluster storage structure. The point light cluster storage structure is shown in Table 1 below:

[0133] Table 1

[0134] Among them, Cluster i Indicates the i-th point light cluster, Offset iIndicates the starting offset of the point light source recorded in the i-th point light source cluster in the point light source cluster storage structure. i Indicates the number of point light sources in the i-th point light source cluster. In the point light source cluster storage structure, the interval [Offset i ,Offset i +Count i ) stores the point light index set that is all the point light sources that affect the point light cluster i.

[0135] According to the point light cluster ID determined in the above steps, the point light starting offset and the number of point light acceleration objects corresponding to each point light in the target point light cluster can be determined through the point light cluster storage structure. Then, the index information corresponding to each point light is determined according to the preset light index storage structure. The light index storage structure is shown in Table 2 below:

[0136] Table 2

[0137] Table 2 is a schematic storage form of the light source index storage structure, where index i Indicates the index information of the point light source with array index i in the point light source list.

[0138] After obtaining the index information corresponding to each point light source according to Table 2 above, the parameters corresponding to each point light source are traversed to accumulate and calculate the vertex rendering information corresponding to the target vertex to be rendered.

[0139] In another specific embodiment provided in the present application, in addition to multiple point light sources, there may also be multiple environment probes in the target virtual scene, and the target virtual scene also includes multiple environment probes; the environment probe is a sphere in the target virtual scene, and the light incoming in the spherical space is approximated by using a third-order polynomial. The environment probe is placed at various positions in the target virtual scene, and the rendering tool will perform interpolation calculations on it to obtain the final lighting approximation value of the position of the model to be rendered.

[0140] Correspondingly, determining vertex rendering information of each vertex to be rendered in each area to be rendered according to the light source information in the target virtual scene includes:

[0141] determining a plurality of environmental probe clusters according to the plurality of environmental probes;

[0142] A target environment probe cluster corresponding to a target vertex to be rendered is determined, and vertex probe rendering information corresponding to the target vertex to be rendered is calculated according to the target environment probes in the target environment probe cluster.

[0143] In practical applications, a target virtual scene may include multiple environmental probes. The target virtual scene may be divided into multiple environmental probe clusters in advance, and then each environmental probe may be divided into a corresponding environmental probe cluster according to its spatial position.

[0144] Perform ray tracing to generate a ray. Determine whether the ray intersects the target model surface. If so, determine the intersection point as the target vertex. Determine the target environment probe cluster corresponding to the target vertex, and use the target environment probe in the target environment probe cluster to calculate the vertex probe rendering information corresponding to the target vertex.

[0145] Among them, each environment probe includes the environment probe starting offset and the number of environment probe acceleration objects;

[0146] The method further comprises: constructing an environmental probe space acceleration structure;

[0147] Accordingly, determining a target environment probe cluster corresponding to a target vertex to be rendered, and calculating vertex probe rendering information corresponding to the target vertex to be rendered based on the target environment probe in the target environment probe cluster, includes:

[0148] When the target vertex to be rendered is located in the environment probe space acceleration structure, determining a target environment probe cluster corresponding to the target vertex to be rendered;

[0149] The vertex probe rendering information corresponding to the target vertex to be rendered is calculated according to the starting offset of each environment probe corresponding to the target environment probe cluster and the number of environment probe acceleration objects.

[0150] Similar to the above-mentioned light source space acceleration structure, for the environment probe, a corresponding environment probe space acceleration structure can also be pre-built. For the specific method of constructing the environment probe space acceleration structure, please refer to the above-mentioned method of constructing the light source space acceleration structure, which will not be repeated here.

[0151] When the light generated by ray tracing hits the surface of the target model to be rendered, the intersection point is the target vertex to be rendered. It is further determined whether the target vertex to be rendered is located in the environment probe space acceleration structure. If not, the subsequent calculation steps are stopped; if yes, the environment probe cluster ID corresponding to the target vertex to be rendered in the environment probe space acceleration structure is calculated, and the probe starting offset and the number of environment probe acceleration objects corresponding to each target environment probe in the target environment probe cluster are obtained in the environment probe cluster storage structure according to the environment probe cluster ID. The environment probe cluster storage structure refers to the point light source cluster storage structure shown in Table 1 above, which will not be repeated here.

[0152] After determining the probe starting offset and the number of environmental probe acceleration objects corresponding to each target environmental probe, the index information corresponding to each environmental probe is determined according to the preset environmental probe index storage structure. The structure of the environmental probe index storage structure refers to the light source index storage structure in Table 2 above, which will not be repeated here.

[0153] After obtaining the index information corresponding to each target environment probe, the parameters corresponding to each target environment probe are traversed to accumulate and calculate the vertex probe rendering information corresponding to the target rendering vertex.

[0154] In a specific implementation provided in the present application, an example is taken in which there are 20 point light sources and 23 environment probes in a ray tracing scene for explanation.

[0155] Create a light source space acceleration structure for the point light source and get 4 point light source clusters, namely Cluster a0 (3 point light sources), Cluster a1 (5 point lights), Cluster a2 (7 point lights), Cluster a3 (5 point lights).

[0156] Create an environmental probe space acceleration structure for the environmental probe and get 4 environmental probe clusters, namely Cluster b0 (6 environmental probes), Cluster b1 (5 environmental probes), Cluster b2 (8 environmental probes), Cluster b3 (4 environmental probes).

[0157] Start the ray tracing step. When the ray intersects the surface of the target model to be rendered, the intersection point P (the target vertex to be rendered) is obtained. In the hit shader, the cluster ID of the intersection point P in the light source space acceleration structure is determined to be Cluster a1 , the cluster ID in the environment probe space acceleration structure is Cluster b3 .

[0158] According to the cluster IDCluster a1 After searching the point light source cluster storage structure and the light source index storage structure, the index subscripts of the target point light sources are obtained as 0, 4, 6, 10, and 12 respectively.

[0159] According to the cluster IDCluster b3 After searching in the environmental probe cluster storage structure and the environmental probe index storage structure, the index subscripts of the target environmental probes are obtained as 1, 3, 6, and 20 respectively.

[0160] Get the point light parameters with subscripts 0, 4, 6, 10, and 12 from the point light list, and get the environment probe parameters with subscripts 1, 3, 6, and 20 from the environment probe list. Traverse the above 5 point light parameters and 4 environment probe parameters, calculate the shading results, and generate the vertex rendering information corresponding to the target vertex P to be rendered.

[0161] Through the method provided in this application, multiple point light sources and multiple environment probes are divided into regions, and the target point light source cluster and target environment probe cluster corresponding to the target point to be rendered are determined. The target point light source information in the target point light source cluster and the target environment probe information in the target environment probe cluster are used to calculate the vertex rendering information corresponding to the target point to be rendered. The point light source space acceleration structure and the environment probe space acceleration structure are used to remove the point light sources and environment probes that have no effect on the target point to be rendered, thereby avoiding traversing all point light sources and environment probes, greatly reducing the complexity of the calculation, saving computing resources, and improving rendering efficiency.

[0162] In another specific embodiment provided in the present application, a solution for physical particle fluid simulation in a three-dimensional model is also provided. In practical applications, with the development of physical simulation technology, the requirements for real-time scene physical simulation in three-dimensional scenes are relatively high. The current fluid simulation method is relatively complex to calculate and has a large performance overhead. It is difficult to handle 3D scenes with high complexity, especially for 3D scenes that require real-time rendering. It is impossible to take into account both performance and performance overhead.

[0163] The method provided in this application also adopts HDR (High Dynamic Range) technology. HDR, High Dynamic Range, is relative to LDR.

[0164] In the LDR algorithm, color calculations are limited to a range between 0 and 1, making it easier to display the results on a physical screen. However, the LDR algorithm has significant limitations. In the real world, light intensity is difficult to confine to a range between 0 and 1. For example, the brightness of a light bulb or the sun is far greater than 1, making it nearly impossible to reproduce real-world effects using the LDR algorithm.

[0165] In order to achieve a rendering effect that simulates the real world, this solution adopts the HDR algorithm. All values, including original data, intermediate calculation results, and final calculation results, are recorded in linear space using floating-point format.

[0166] This will cause a problem, that is, the calculated result cannot be guaranteed to be between 0 and 1, but the physical display can only display colors between 0 and 1. Therefore, before the result calculated by the HDR algorithm is displayed on the screen, a tone mapping operation is required.

[0167] The method provided in this application uses the ACES (Academy Color Encoding System) tone mapping algorithm. ACES is a color space specification designed by the Academy of Motion Picture Arts and Sciences. It is currently the most outstanding (with the best expressiveness and good performance) tone mapping algorithm in the field of game development and is the most mainstream tone mapping algorithm used in modern game engines.

[0168] Based on this, the method provided in this application also provides a physical fluid simulation method based on smoothed fluid particle dynamics and position-based physical methods. Specifically, different types of fluid models are created according to needs, and fluid information such as the color and transparency of fluid particles are set for each type of fluid model. The created fluid model resources are then stored.

[0169] Based on actual business needs, corresponding fluid data is generated based on the fluid model resources and initialized. Based on the actual needs of the target virtual scene to be rendered, a fluid physics scene is created based on the fluid data and loaded into memory. The created fluid physics scene is then passed to the GPU for iterative calculations to generate model rendering information for the fluid model, and the fluid model is rendered based on the model rendering information.

[0170] In the subsequent processing process, the fluid model can be further updated according to the attribute information of the fluid particles. Furthermore, the fluid model can be updated according to the information after the fluid object collides with the environment information, character information, etc. Whether in the process of calculating the fluid model rendering information or in updating the fluid model rendering information, Guo Hengzhong uses smooth particle fluid dynamics and position-based physical particle solving methods to simulate fluids. This has higher simulation efficiency and more stable calculations in complex 3D scenes. At the same time, it introduces high-precision collisions between fluids and the environment or characters, which greatly improves the scene interaction experience and enhances the sense of realism and immersion. In addition, GPU is introduced for calculation, which increases the calculation speed and meets the needs of real-time rendering.

[0171] Step 108: Rendering each to-be-rendered model in the target virtual scene according to each vertex rendering information, to generate each rendering object of the target virtual scene.

[0172] After determining the rendering information of each vertex in each model to be rendered, each model to be rendered can be rendered in the target virtual scene according to the rendering information of each vertex, thereby generating each rendering object in the target virtual scene.

[0173] After generating each rendered object, the process of presenting it on the display screen corresponding to the target virtual scene typically involves calculating motion vectors in the vertex shader and then passing the difference to the fragment shader, thereby reducing the amount of computation. However, in real-world applications, there are often many long triangles generated by programs or caused by model reductions. For these long triangles, calculation errors may occur, resulting in the velocity field information not meeting the requirements of the performance multiplier, resulting in obvious errors in the picture. DLSS (Deep Learning Super Sampling) is an AI-powered performance multiplier that allows players to run games at higher resolutions and higher frame rates without incurring additional costs. It works by reducing the in-game rendering resolution and then using artificial intelligence algorithm models and AI acceleration hardware units (Tensor Cores) to stretch the output image to increase the display resolution. For example, using a 1080P rendering resolution and then outputting a 4K (2160P) display resolution through AI algorithms and Tensor Core calculations to achieve the purpose of improving frame rates.

[0174] Based on this, in another specific embodiment provided in this application, the method further includes:

[0175] Calculate the pixel position information of the corresponding pixel point of each rendered object on the display screen based on the fragment shader;

[0176] Each rendered object is displayed on the display screen according to the position information of each pixel.

[0177] In this embodiment, the calculation of the motion vector difference is transferred from the vertex shader to the fragment shader. Based on the fragment shader receiving the position information of the target vertex in the previous frame, after rasterization, the precise world coordinates of the target vertex in the current frame within the viewing cone can be obtained, thereby further determining the pixel position information of the corresponding pixel point of the target vertex on the display screen, and then rendering each rendering object according to the pixel position information and displaying it on the display screen.

[0178] Specifically, the pixel position information of the corresponding pixel point of each rendered object on the display screen is calculated based on the fragment shader, including:

[0179] The fragment shader receives the position information of each vertex sent by the vertex shader;

[0180] Calculate the vertex information corresponding to each rendering object according to the position information of each vertex;

[0181] According to the virtual lens information and each vertex information corresponding to the target virtual scene, pixel position information corresponding to a pixel point of each vertex information on the display screen is determined.

[0182] In practice, the vertex shader calculates the world coordinates of each vertex using only the previous frame's information. This information is then sent to the fragment shader, which interpolates the world coordinates of each vertex to calculate the vertex information corresponding to each rendered object in the current frame. Finally, the fragment shader projects the interpolated vertex information onto the display screen based on the virtual lens information corresponding to the target virtual scene, thereby determining the pixel position information corresponding to each pixel.

[0183] Referring to FIG5 , FIG5 is a schematic diagram showing pixel positioning according to an embodiment of the present application. As shown in FIG5 , the area where the virtual camera intersects with the near plane is the display screen, the area between the near plane and the far plane is the valid area, and all other areas are invalid areas. As shown in FIG5 , if the current calculation method is used, vertices A, B, and C will first be projected onto the near plane to obtain vertices A', B', and C'. At this time, only vertex A' is within the display screen range in the projection information, while vertex B' is already outside the display screen. The projection direction of vertex C' is wrong. Therefore, using vertices A', B', and C' for interpolation calculation will lead to calculation errors.

[0184] Based on this, in the method provided in the present application, the fragment shader receives the actual position information of vertex A, vertex B and vertex C, performs interpolation based on the actual position information of vertex A, vertex B and vertex C, obtains the actual position information of vertex P, and then projects vertex P onto the display screen of the near plane to determine the pixel position information corresponding to the pixel point of the vertex on the display screen.

[0185] In this implementation, velocity field calculation is moved from the vertex shader to the fragment shader. After receiving the vertex positions from the previous frame, the fragment shader calculates the current frame's vertex positions based on the previous frame's vertex positions. These positions are then projected onto the near plane display screen. This solves the problem of calculation errors caused by overly long triangles and improves rendering accuracy.

[0186] Through the method provided in the present application, in ray tracing technology, it is possible to achieve unified rendering between translucent models and opaque models without changing the model material, thereby simplifying the rendering process; in addition, the shadow information can be further calculated based on the opaque sub-model depth information, translucent sub-model depth information and translucent sub-model color information of the model through the light source information, so that a colorful translucent shadow that is more in line with physical laws can be projected, thereby improving the richness of the model rendering.

[0187] When calculating the vertex rendering information of each vertex in the model, multiple point light sources and multiple environment probes are divided into regions, and the target point light source cluster and target environment probe cluster corresponding to the target point to be rendered are determined. The target point light source information in the target point light source cluster and the target environment probe information in the target environment probe cluster are used to calculate the vertex rendering information corresponding to the target point to be rendered. The point light source space acceleration structure and the environment probe space acceleration structure are used to remove the point light sources and environment probes that have no effect on the target point to be rendered, thereby avoiding traversing all point light sources and environment probes, greatly reducing the complexity of the calculation, saving computing resources, and improving rendering efficiency.

[0188] Finally, when projecting the rendered model onto the display screen, the velocity field calculation is moved from the vertex shader to the fragment shader. After receiving the vertex positions of the previous frame from the vertex shader, the fragment shader further calculates the vertex positions of the current frame based on the vertex positions of the previous frame, and then projects the current vertex positions onto the near plane of the display screen. This solves the problem of calculation errors caused by overly long triangles and improves rendering accuracy.

[0189] Corresponding to the above method embodiment, the present application also provides a rendering device embodiment. FIG6 shows a schematic diagram of the structure of a rendering device provided by an embodiment of the present application. As shown in FIG6, the device includes:

[0190] The receiving module 602 is configured to receive a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered;

[0191] The first determining module 604 is configured to determine transparency information of each to-be-rendered model, and determine a to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model;

[0192] A second determining module 606 is configured to determine vertex rendering information of each to-be-rendered vertex in each to-be-rendered area according to light source information in the target virtual scene;

[0193] The rendering module 608 is configured to render each to-be-rendered model in the target virtual scene according to each vertex rendering information, and generate each rendering object of the target virtual scene.

[0194] Optionally, the first determining module 604 is further configured to:

[0195] Determining virtual lens information and light source information corresponding to the target virtual scene;

[0196] Determining scene depth information according to the virtual lens information and transparency information of each model to be rendered;

[0197] Determine the model to be rendered area corresponding to each to-be-rendered model according to the scene depth information and the transparency information of each to-be-rendered model;

[0198] The model shadow to-be-rendered area corresponding to each to-be-rendered model is determined according to the light source information and the transparency information of each to-be-rendered model.

[0199] Optionally, the first determining module 604 is further configured to:

[0200] Construct a model acceleration structure corresponding to each model to be rendered;

[0201] emitting a target incident light ray to a target pixel point on a screen corresponding to the target virtual scene based on the virtual lens information, wherein the screen includes a plurality of pixel points;

[0202] When the target incident light intersects the target model acceleration structure, determining intersection depth information corresponding to the target model acceleration structure;

[0203] Determining a traveling direction of the target incident light according to the intersection depth information, the scene depth information, and transparency information of the target model to be rendered, until a stopping condition of the incident light is reached;

[0204] Determining the rendering order of the target model to be rendered according to the hitting order of the target incident light rays;

[0205] A model to-be-rendered area corresponding to each target model to be rendered and model rendering information corresponding to each model to-be-rendered area are generated according to the target incident light, the rendering order, and the model material information of each target model to be rendered.

[0206] Optionally, the first determining module 604 is further configured to:

[0207] When the intersection depth information is less than the scene depth information and the transparency information of the target model to be rendered is semi-transparent, maintaining the traveling direction of the target incident light;

[0208] When the intersection depth information is greater than or equal to the scene depth information, or the transparency information of the target model to be rendered is opaque, the incident light stopping condition is met;

[0209] Determining a model hitting order according to a hitting order in which the target incident light hits the target to-be-rendered model;

[0210] The rendering order of the target to-be-rendered models is determined according to the reverse order of the model hit order.

[0211] Optionally, the first determining module 604 is further configured to:

[0212] Counting the number of target models to be rendered in the model hit sequence;

[0213] When the number of models is greater than a threshold, updating the model hit order according to the threshold;

[0214] The rendering order of the target to-be-rendered models is determined according to the reverse order of the updated model hit order.

[0215] Optionally, the first determining module 604 is further configured to:

[0216] Determine the target model to be rendered according to the rendering order;

[0217] When the transparency information of the target model to be rendered is opaque, determining the model to be rendered area and model rendering information corresponding to the target model to be rendered according to the target incident light, the target model to be rendered, and the model material information corresponding to the target model to be rendered;

[0218] When the transparency information of the target model to be rendered is semi-transparent, the model area to be rendered and the model rendering information corresponding to the target model to be rendered are determined based on the target incident light, the target model to be rendered, the model material information corresponding to the target model to be rendered and the model rendering information of the previous target model to be rendered.

[0219] Optionally, the first determining module 604 is further configured to:

[0220] Determining model clipping information of a target model to be rendered according to the light source information;

[0221] Splitting the target model to be rendered into an opaque submodule and a semi-transparent submodule according to transparency information of the target model to be rendered;

[0222] Determine the light source depth information corresponding to the target model to be rendered according to the light source information and the opaque sub-module;

[0223] Performing light source depth detection on the translucent submodule according to the light source depth information, and determining translucent submodule color information and translucent submodule depth information corresponding to the translucent submodule;

[0224] The model shadow to-be-rendered area is determined according to the light source depth information, the semi-transparent submodule color information, and the semi-transparent submodule depth information.

[0225] Optionally, the light source information includes information of multiple point light sources;

[0226] The second determining module 606 is further configured to:

[0227] Determine a plurality of point light source clusters according to the plurality of point light source information;

[0228] A target point light source cluster corresponding to a target vertex to be rendered is determined, and vertex light source rendering information corresponding to the target vertex to be rendered is calculated based on target point light source information in the target point light source cluster.

[0229] Optionally, the information of each point light source includes a starting offset of the point light source and a number of acceleration objects of the point light source;

[0230] The apparatus further includes: a first construction module configured to construct a point light source space acceleration structure;

[0231] Accordingly, the second determining module 606 is further configured to:

[0232] When the target vertex to be rendered is located in the point light source spatial acceleration structure, determining a target point light source cluster corresponding to the target vertex to be rendered;

[0233] The vertex rendering information corresponding to the target vertex to be rendered is calculated according to the starting offset of each point light source and the number of point light source acceleration objects corresponding to the target point light source cluster.

[0234] Optionally, the target virtual scene further includes a plurality of environmental probes;

[0235] The second determining module 606 is further configured to:

[0236] determining a plurality of environmental probe clusters according to the plurality of environmental probes;

[0237] A target environment probe cluster corresponding to a target vertex to be rendered is determined, and vertex probe rendering information corresponding to the target vertex to be rendered is calculated according to the target environment probes in the target environment probe cluster.

[0238] Optionally, each environment probe includes an environment probe starting offset and a number of environment probe acceleration objects;

[0239] The apparatus further comprises: a second construction module configured to construct an environmental probe space acceleration structure;

[0240] Accordingly, the second determining module 606 is further configured to:

[0241] When the target vertex to be rendered is located in the environment probe space acceleration structure, determining a target environment probe cluster corresponding to the target vertex to be rendered;

[0242] The vertex probe rendering information corresponding to the target vertex to be rendered is calculated according to the starting offset of each environment probe corresponding to the target environment probe cluster and the number of environment probe acceleration objects.

[0243] Optionally, the device further includes a display module configured to:

[0244] Calculate the pixel position information of the corresponding pixel point of each rendered object on the display screen based on the fragment shader;

[0245] Each rendered object is displayed on the display screen according to the position information of each pixel.

[0246] Optionally, the display module is further configured to:

[0247] The fragment shader receives the position information of each vertex sent by the vertex shader;

[0248] Calculate the vertex information corresponding to each rendering object according to the position information of each vertex;

[0249] According to the virtual lens information and each vertex information corresponding to the target virtual scene, pixel position information corresponding to a pixel point of each vertex information on the display screen is determined.

[0250] Through the device provided in the present application, in ray tracing technology, it is possible to achieve unified rendering between translucent models and opaque models without changing the model material, thereby simplifying the rendering process; in addition, the shadow information can be further calculated based on the opaque sub-model depth information, translucent sub-model depth information and translucent sub-model color information of the model through the light source information, so that a colorful translucent shadow that is more in line with physical laws can be projected, thereby improving the richness of the model rendering.

[0251] When calculating the vertex rendering information of each vertex in the model, multiple point light sources and multiple environment probes are divided into regions, and the target point light source cluster and target environment probe cluster corresponding to the target point to be rendered are determined. The target point light source information in the target point light source cluster and the target environment probe information in the target environment probe cluster are used to calculate the vertex rendering information corresponding to the target point to be rendered. The point light source space acceleration structure and the environment probe space acceleration structure are used to remove the point light sources and environment probes that have no effect on the target point to be rendered, thereby avoiding traversing all point light sources and environment probes, greatly reducing the complexity of the calculation, saving computing resources, and improving rendering efficiency.

[0252] Finally, when projecting the rendered model onto the display screen, the velocity field calculation is moved from the vertex shader to the fragment shader. After receiving the vertex positions of the previous frame from the vertex shader, the fragment shader further calculates the vertex positions of the current frame based on the vertex positions of the previous frame, and then projects the current vertex positions onto the near plane of the display screen. This solves the problem of calculation errors caused by overly long triangles and improves rendering accuracy.

[0253] The above is a schematic scheme of a rendering device of this embodiment. It should be noted that the technical scheme of the rendering device and the technical scheme of the rendering method described above are of the same concept. For details not described in detail in the technical scheme of the rendering device, please refer to the description of the technical scheme of the rendering method described above.

[0254] Figure 7 shows a block diagram of a computing device 700 according to an embodiment of the present application. Components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.

[0255] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface controller (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0256] In one embodiment of the present application, the aforementioned components of the computing device 700 and other components not shown in FIG7 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG7 is for illustrative purposes only and does not limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0257] Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 700 may also be a mobile or stationary server.

[0258] The processor 720 implements the steps of the rendering method when executing the computer instructions.

[0259] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the rendering method described above are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the rendering method described above.

[0260] An embodiment of this specification further provides an extended reality (XR) device, including:

[0261] memory, processor, and display;

[0262] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the following steps are implemented:

[0263] Receiving a rendering instruction for a target virtual scene, wherein the target virtual scene includes at least one model to be rendered;

[0264] Determining transparency information of each to-be-rendered model, and determining a to-be-rendered area of ​​each to-be-rendered model according to the transparency information of each to-be-rendered model;

[0265] Determining vertex rendering information of each vertex to be rendered in each area to be rendered according to light source information in the target virtual scene;

[0266] Rendering each to-be-rendered model in the target virtual scene according to each vertex rendering information to generate each rendering object of the target virtual scene;

[0267] Each rendered object is displayed through the display of the extended reality XR device.

[0268] The above is a schematic scheme of an extended reality XR device of this embodiment. Extended Reality (XR for short) refers to the combination of reality and virtuality through computers to create a virtual environment for human-computer interaction. This is also a general term for various technologies such as AR, VR, and MR. By integrating the visual interaction technologies of the three, the experiencer can be brought an "immersive feeling" of seamless transition between the virtual world and the real world. It should be noted that the technical solution of the extended reality XR device and the technical solution of the above-mentioned method for rendering virtual objects belong to the same concept. For details not described in detail in the technical solution of the extended reality XR device, please refer to the description of the technical solution of the above-mentioned method for rendering virtual objects.

[0269] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the rendering method described above.

[0270] The above is a schematic solution of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the rendering method described above are of the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the rendering method described above.

[0271] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0272] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.

[0273] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0274] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0275] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A rendering method, characterized in that, Including: Receiving a rendering instruction for a target virtual scene, where the target virtual scene includes at least one model to be rendered; Determining the transparency information of each model to be rendered, and determining the rendering area of each model to be rendered according to the transparency information of each model to be rendered; Determining the vertex rendering information of each vertex to be rendered in each rendering area according to the light source information in the target virtual scene; Rendering each model to be rendered in the target virtual scene according to each vertex rendering information to generate each rendering object of the target virtual scene.

2. The method according to claim 1, characterized in that, Determining the rendering area of each model to be rendered according to the transparency information of each model to be rendered, including: Determining the virtual camera information and light source information corresponding to the target virtual scene; Determining the scene depth information according to the virtual camera information and the transparency information of each model to be rendered; Determining the model rendering area corresponding to each model to be rendered according to the scene depth information and the transparency information of each model to be rendered; Determining the model shadow rendering area corresponding to each model to be rendered according to the light source information and the transparency information of each model to be rendered.

3. The method according to claim 2, wherein Determining the model rendering area corresponding to each model to be rendered according to the scene depth information and the transparency information of each model to be rendered, including: Constructing a model acceleration structure corresponding to each model to be rendered; Emitting a target incident ray to a target pixel point on the screen corresponding to the target virtual scene based on the virtual camera information, where the screen includes a plurality of pixel points; Determining the intersection depth information corresponding to the target model acceleration structure when the target incident ray intersects the target model acceleration structure; Determining the traveling direction of the target incident ray according to the intersection depth information, the scene depth information, and the transparency information of the target model to be rendered until an incident ray stop condition is reached; Determining the rendering order of the target model to be rendered according to the hit order of the target incident ray; Generating the model rendering area corresponding to each target model to be rendered and the model rendering information corresponding to each model rendering area according to the target incident ray, the rendering order, and the model material information of each target model to be rendered.

4. The method according to claim 3, characterized in that, Determining the traveling direction of the target incident ray according to the intersection depth information, the scene depth information, and the transparency information of the target model to be rendered until an incident ray stop condition is reached, including: When the intersection depth information is less than the scene depth information and the transparency information of the target model to be rendered is semi-transparent, maintaining the traveling direction of the target incident ray; When the intersection depth information is greater than or equal to the scene depth information, or the transparency information of the target model to be rendered is opaque, reaching the incident ray stop condition; Correspondingly, determining the rendering order of the target model to be rendered according to the hit order of the target incident ray, including: Determining the model hit order according to the hit order of the target incident ray hitting the target model to be rendered; Determining the rendering order of the target model to be rendered according to the reverse order of the model hit order.

5. The method according to claim 4, characterized in that Determining the rendering order of the target model to be rendered according to the reverse order of the model hit order, including: Count the number of target models to be rendered in the model hit order; When the number of models is greater than the threshold, update the model hit order according to the threshold; Determine the rendering order of the target models to be rendered according to the reverse order of the updated model hit order.

6. The method according to claim 3, wherein Generate the model areas to be rendered corresponding to each target model to be rendered and the model rendering information corresponding to each model area to be rendered according to the target incident light, the rendering order, and the model material information of each target model to be rendered, including: Determine the target model to be processed according to the rendering order; When the transparency information of the target model to be processed is opaque, determine the model area to be rendered and the model rendering information corresponding to the target model to be processed according to the target incident light, the target model to be processed, and the model material information corresponding to the target model to be processed; When the transparency information of the target model to be processed is semi-transparent, determine the model area to be rendered and the model rendering information corresponding to the target model to be processed according to the target incident light, the target model to be processed, the model material information corresponding to the target model to be processed, and the model rendering information of the previous target model to be processed.

7. The method according to claim 2, wherein Determine the model shadow areas to be rendered corresponding to each model to be rendered according to the light source information and the transparency information of each model to be rendered, including: Determine the model clipping information of the target model to be rendered according to the light source information; Split the target model to be rendered into an opaque sub-module and a semi-transparent sub-module according to the transparency information of the target model to be rendered; Determine the light source depth information corresponding to the target model to be rendered according to the light source information and the opaque sub-module; Perform light source depth detection on the semi-transparent sub-module according to the light source depth information to determine the semi-transparent sub-module color information and the semi-transparent sub-module depth information corresponding to the semi-transparent sub-module; Determine the model shadow area to be rendered according to the light source depth information, the semi-transparent sub-module color information, and the semi-transparent sub-module depth information.

8. The method according to claim 1, wherein The light source information includes multiple point light source information; Determine the vertex rendering information of each vertex to be rendered in each rendering area according to the light source information in the target virtual scene, including: Determine multiple point light source clusters according to the multiple point light source information; Determine the target point light source cluster corresponding to the target vertex to be rendered, and calculate the vertex light source rendering information corresponding to the target vertex to be rendered according to the target point light source information in the target point light source cluster.

9. The method according to claim 8, characterized in that, Each point light source information includes a point light source starting offset and the number of point light source acceleration objects; The method further includes: constructing a point light source space acceleration structure; Correspondingly, determine the target point light source cluster corresponding to the target vertex to be rendered, and calculate the vertex light source rendering information corresponding to the target vertex to be rendered according to the target point light source information in the target point light source cluster, including: When the target vertex to be rendered is located in the point light source space acceleration structure, determine the target point light source cluster corresponding to the target vertex to be rendered; Calculate the vertex rendering information corresponding to the target vertex to be rendered according to the starting offset of each point light source corresponding to the target point light source cluster and the number of point light source acceleration objects.

10. The method according to claim 1, characterized in that, The target virtual scene further includes a plurality of environment probes; Determine the vertex rendering information of each vertex to be rendered in each area to be rendered according to the light source information in the target virtual scene, including: Determine a plurality of environment probe clusters according to the plurality of environment probes; Determine the target environment probe cluster corresponding to the target vertex to be rendered, and calculate the vertex probe rendering information corresponding to the target vertex to be rendered according to the target environment probe in the target environment probe cluster. Each environment probe includes an environment probe starting offset and the number of environment probe acceleration objects; 11. The method according to claim 10, characterized in that The method further includes: constructing an environment probe space acceleration structure; Correspondingly, determining the target environment probe cluster corresponding to the target vertex to be rendered, and calculating the vertex probe rendering information corresponding to the target vertex to be rendered according to the target environment probe in the target environment probe cluster, including: When the target vertex to be rendered is located in the environment probe space acceleration structure, determine the target environment probe cluster corresponding to the target vertex to be rendered; Calculate the vertex probe rendering information corresponding to the target vertex to be rendered according to the starting offset of each environment probe corresponding to the target environment probe cluster and the number of environment probe acceleration objects. The method further includes:

12. The method according to claim 1, characterized in that, The fragment shader receives the vertex position information sent by the vertex shader; Calculate the vertex information corresponding to each rendering object according to the vertex position information; Determine the pixel position information corresponding to the pixel points on the display screen of each vertex information according to the virtual camera information corresponding to the target virtual scene and each vertex information; Display each rendering object on the display screen according to the pixel position information. Including:

13. An extended reality XR device, characterized in that, A memory, a processor, and a display; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the following steps are implemented: Receive a rendering instruction for a target virtual scene, where the target virtual scene includes at least one model to be rendered; Determine the transparency information of each model to be rendered, and determine the area to be rendered of each model to be rendered according to the transparency information of each model to be rendered; Determine the vertex rendering information of each vertex to be rendered in each area to be rendered according to the light source information in the target virtual scene; Render each model to be rendered in the target virtual scene according to each vertex rendering information to generate each rendering object of the target virtual scene; Display each rendering object through the display of the extended reality (XR) device. The processor implements the steps of the method according to any one of claims 1-12 when executing the computer instructions.

14. A computing device, comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, characterized in that, When the computer instructions are executed by the processor, the steps of the method according to any one of claims 1-12 are implemented.

15. A computer-readable storage medium storing computer instructions, characterized in that, ​

Citation Information

Patent Citations

  • Object rendering processing method and device, computer device and storage medium

    CN113052951A

  • Model rendering method and device and electronic equipment

    CN114494549A

  • Systems and methods for ray-traced shadows of transparent objects

    US20200273239A1

  • Method and apparatus for rendering shadow effect, and device, program and readable medium

    WO2023273115A1

  • Image picture rendering method and electronic device

    WO2023280241A1

Cited By

  • Illumination data processing method

    CN121330157A