Picture rendering method and apparatus, device, and storage medium

By filtering virtual objects affected by reflection capture objects and updating their rendering instructions, the problem of calculating pressure surges when the reflection effect of reflection capture objects changes is solved, achieving more efficient rendering performance and smoother picture updates.

WO2025039667A1PCT designated stage expired Publication Date: 2025-02-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096966
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-18
Filing Date
2024-06-03
Publication Date
2025-02-27

AI Technical Summary

Technical Problem

In the prior art, when the reflection effect of the reflective capture object changes, a large number of rendering instructions need to be updated, resulting in sudden increase in calculation pressure and lag in the picture.

Method used

By filtering virtual objects affected by reflection capture objects, only the rendering instructions for these virtual objects are updated, reducing the number of rendering instructions that need to be updated.

Benefits of technology

It effectively reduces calculation pressure, reduces power consumption, improves rendering performance, reduces the chance of screen lag, and maintains the frame rate of the display screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096966_27022025_PF_FP_ABST
    Figure CN2024096966_27022025_PF_FP_ABST
Patent Text Reader

Abstract

A picture rendering method and apparatus, a device, and a storage medium, relating to the field of computer and Internet technologies. The method comprises: acquiring geometric information of at least one reflection capture object in a virtual scene (610); when there is a target reflection capture object having the reflection effect changed, on the basis of the geometric information of the target reflection capture object, determining a target virtual object from among virtual objects comprised in the field of view, wherein the target virtual object is a virtual object having the surface display effect changed when the reflection effect of the target reflection capture object is changed (620); re-rendering the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object is changed (630); and on the basis of the re-rendered target virtual object and the virtual objects other than the target virtual object, generating a display picture of the field of view (640). The present application is beneficial to improving the rendering performance.
Need to check novelty before this filing date? Find Prior Art

Description

Screen rendering method, device, equipment and storage medium

[0001] This application claims priority to Chinese patent application number 202311047351.3, filed on August 18, 2023, entitled “Image rendering method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer and Internet technology, and in particular to a picture rendering method, apparatus, device and storage medium. Background Art

[0003] After setting up a reflection capture object in a virtual scene, virtual objects in the virtual scene will display a reflection effect on their surfaces due to the influence of the reflection capture object, making the virtual objects' materials more realistic. The reflection capture object refers to the object determined by the reflection capture (RC) technology.

[0004] In related technologies, when the reflection state of the reflection capture object changes, the terminal device needs to update the rendering instructions (Drawcall) corresponding to each virtual object according to the attribute information of the virtual object in the virtual scene, so that in the process of generating the next display screen, the graphics processor is controlled according to the updated rendering instructions to render each virtual object and generate the next display screen.

[0005] However, this approach consumes a lot of computing resources, and the rendering performance of terminal devices needs to be further improved.

[0006] Summary of the Invention

[0007] This application provides a method, apparatus, device, and storage medium for rendering images. The technical solution is as follows:

[0008] According to one aspect of an embodiment of the present application, a screen rendering method is provided, the method being executed by a terminal device, the method comprising:

[0009] Obtaining reflection capture information of a virtual scene, the reflection capture information including geometric information of at least one reflection capture object, the reflection capture object being used to project a cubemap representing a reflection effect onto a material surface of a virtual object;

[0010] In a case where there is a target reflection capture object whose reflection effect changes among the at least one reflection capture object, determining at least one target virtual object from at least one virtual object included in a field of view according to geometric information of the target reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect changes accordingly after the reflection effect of the target reflection capture object changes;

[0011] Re-rendering the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes;

[0012] A display screen of the field of view is generated according to the re-rendered target virtual object and other virtual objects among the at least one virtual object except the target virtual object.

[0013] According to one aspect of an embodiment of the present application, a picture rendering device is provided, the device comprising:

[0014] An information acquisition module is configured to acquire reflection capture information of a virtual scene, wherein the reflection capture information includes geometric information of at least one reflection capture object, and the reflection capture object is used to project a cube map representing a reflection effect onto a material surface of a virtual object;

[0015] an object determination module, configured to, if a target reflection capture object with a changed reflection effect exists among the at least one reflection capture object, determine at least one target virtual object from at least one virtual object included in a field of view based on geometric information of the target reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect changes accordingly after the reflection effect of the target reflection capture object changes;

[0016] An object rendering module, configured to re-render the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes;

[0017] A picture generation module is used to generate a display picture of the field of view according to the re-rendered target virtual object and other virtual objects in the at least one virtual object except the target virtual object.

[0018] According to one aspect of an embodiment of the present application, a terminal device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the screen rendering method as described above.

[0019] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned screen rendering method.

[0020] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program stored in a computer-readable storage medium. A processor reads and executes the computer program from the computer-readable storage medium to implement the screen rendering method as described above.

[0021] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0022] When the reflection effect of the reflection capture object changes, the virtual objects affected by the reflection capture object are filtered out from the virtual objects included in the field of view, and only the rendering instructions of these filtered out virtual objects are updated, which can effectively reduce the number of updates of the rendering instructions. This method helps to alleviate the problem of a sudden increase in computing pressure caused by updating the rendering instructions when the reflection effect of the reflection capture object changes, thereby helping to reduce the power consumption of the terminal device.

[0023] In addition, by reducing the number of virtual objects that need to be updated and rendered, the computing pressure on the terminal device to generate the display image when the reflection effect of the reflection capture object changes is reduced, thereby reducing the chance of screen freeze problems. This helps to maintain a stable frame rate for display image updates, thereby helping to improve the rendering performance of the terminal device and maintain the smoothness of the display image during use of the target application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] FIG1 is a schematic diagram of an implementation environment of a solution provided by an exemplary embodiment of the present application;

[0025] FIG2 is a schematic diagram of a process of transforming a three-dimensional space into a two-dimensional image provided by an exemplary embodiment of the present application;

[0026] FIG3 is a schematic diagram of a screen rendering method provided by the related art;

[0027] FIG4 is a schematic diagram of a change in computing overhead provided by an exemplary embodiment of the present application;

[0028] FIG5 is a schematic diagram of a screen rendering method provided by an exemplary embodiment of the present application;

[0029] FIG6 is a flowchart of a screen rendering method provided by an exemplary embodiment of the present application;

[0030] FIG7 is a schematic diagram of a reflection effect provided by an exemplary embodiment of the present application;

[0031] FIG8 is a schematic diagram of a reflection capture information format provided by an exemplary embodiment of the present application;

[0032] FIG9 is a schematic diagram of a screen rendering method provided by an exemplary embodiment of the present application;

[0033] FIG10 is a block diagram of a picture rendering device provided by an exemplary embodiment of the present application;

[0034] FIG11 is a structural block diagram of a terminal device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0036] Before introducing this application, the background technology involved in this application is first explained.

[0037] Reflection Capture (RC) is a technique used to capture environmental reflections and diffuse reflections during the rendering process. It simulates reflections and indirect lighting from materials and scenes, significantly enhancing the realism and detail of a scene.

[0038] A drawcall triggers the data transfer and command call between the central processing unit (CPU) and the graphics processing unit (GPU). In computer graphics, this is the process of submitting a drawcall to the GPU. Each rendering information generated is generated through a drawcall. A drawcall encompasses all the steps required to render a virtual object, such as model transformations, texture sampling, and shader calculations. Optimizing the number of drawcalls is crucial for improving application performance.

[0039] A bounding box (BB) is a rectangular bounding box that represents the position and size of a virtual object in a virtual scene. It is typically defined by four values: the x and y coordinates of the upper left corner, and the width and height of the rectangle.

[0040] An Axis Aligned Bounding Box (AABB) is a bounding box or box formed by two perpendicular parallel rectangles, where the diagonal vertex coordinates of the first rectangle are (A, A) and the diagonal vertex coordinates of the second rectangle are (B, B).

[0041] A virtual scene refers to a three-dimensional space designed to implement the functions of a target application. Virtual objects in the virtual scene belong to three-dimensional models. A world coordinate system is set in the virtual scene, and the position of virtual objects in the virtual scene can be determined by the world coordinate system. Taking a game application as an example, the virtual environment is the environment displayed (or provided) when the client of the game application is running on a terminal device. The virtual environment refers to an environment created for virtual characters to carry out activities (such as game competitions), such as a virtual house, a virtual island, a virtual map, etc. The virtual environment can be a simulation of the real world, a semi-simulated and semi-fictional environment, or a purely fictional environment. The virtual environment can be a 3D virtual environment or a 2.5D virtual environment, which is not limited in the embodiments of the present application. A virtual object can be any object in a virtual scene, such as a virtual building, a virtual road, a virtual character, a virtual animal, etc., which is not limited in the embodiments of the present application.

[0042] A virtual camera (VC) is an object placed in a virtual scene that has the ability to observe virtual objects within the virtual scene. The virtual camera can follow the movement of a virtual character within the virtual scene. Optionally, the placement of the virtual camera within the virtual scene is independent of the virtual character; that is, as the virtual character moves within the virtual scene, the placement of the virtual camera does not follow the movement of the virtual character. Optionally, the virtual camera can be placed within the virtual scene, such as on the surface of a virtual object that the virtual character cannot reach. For example, the virtual camera can be placed on the surface of a virtual building within the virtual scene.

[0043] Frustum culling is used in computer graphics to cull virtual objects (including geometry or other rendered objects) that are not within the field of view according to the frustum of the virtual camera.

[0044] Occlusion Query (OC) is used to determine which virtual objects in a virtual scene are visible and which virtual objects are occluded.

[0045] FIG1 is a schematic diagram of an implementation environment of a solution provided by an exemplary embodiment of the present application. The implementation environment of the solution can be implemented as a computer system, such as a game application system. The implementation environment of the solution can include: a terminal device 10 and a server 20.

[0046] The terminal device 10 may be an electronic device such as a mobile phone, a tablet computer, a PC (Personal Computer), a game console, a multimedia player, a wearable device, an intelligent voice interaction device, a smart home appliance, an in-vehicle terminal, a virtual reality (VR), an augmented reality (AR), an extended reality (Extended Reality), or a mixed reality (MR). In one example, a target application is running on the terminal device 10. The target application may be a game application or other application capable of providing a display screen related to a virtual scene, such as a virtual reality application, an augmented reality application, a three-dimensional map application, a social application, an interactive entertainment application, etc., but this embodiment of the present application is not limited thereto.

[0047] In some embodiments, the gaming application includes at least one of the following: open world games, first person shooters (FPS) games, adventure games (ATG), action games (ACT), multiplayer online battle arena (MOBA), and simulation games (SLG). Open world games are interactive games that allow players to freely explore, also known as free roam games. In these games, players can freely roam in a virtual world and freely choose the time and method to complete game tasks. For open world games, because the "world" brings a highly complex virtual scene and its "open" nature brings a huge degree of freedom, players are very likely to frequently trigger reflection capture updates when exploring, thereby causing screen lag.

[0048] For example, if the target application is a game application, the game of the target application is completed in a virtual scene, and virtual objects are set in the virtual scene. The virtual objects can be game props, landscape objects in the virtual scene (such as buildings, lakes), etc. The terminal device 10 renders the virtual objects in the field of view of the game object (such as the game character controlled by the user account) to obtain a display image of the field of view.

[0049] In order to achieve an immersive effect, the surface texture of the virtual object needs to be rendered by reflection and other processing to make the material of the virtual object more realistic.

[0050] Server 20 can provide background services for the target application running on terminal device 10. For example, server 20 can be the background server of the target application, and server 20 can provide services to the terminal device. Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communications, domain name services, and artificial intelligence platforms. Server 20 has at least data transmission and reception, storage, and computing functions.

[0051] In some embodiments, the server 20 provides the terminal device 10 with data such as game installation packages and game patch packages. The terminal device 10 downloads data related to the target application from the server 20. After installing the target application, the terminal device 10 runs the target application to begin a game. During the game, the terminal device 10 renders virtual objects in the virtual scene, generating and displaying a display image within the field of view.

[0052] The following describes the imaging principle of virtual objects in the field of view (i.e., the principle of obtaining the display image corresponding to the virtual scene in the embodiment of the present application).

[0053] A camera model refers to a computational model used in computer vision to convert three-dimensional virtual objects into two-dimensional images. The imaging plane to which the display image belongs can be a plane perpendicular to the shooting direction of the camera model. For example, when the camera model uses a third-person perspective to shoot from above, the imaging plane is the horizontal plane in the virtual scene; when the camera model uses a first-person perspective to shoot from above, the imaging plane is parallel to the vertical direction. The horizontal plane is a plane perpendicular to the simulated gravity direction in the virtual scene, and the vertical direction is parallel to the simulated gravity direction in the virtual scene. The imaging plane is usually a rectangle, also known as an imaging rectangle, and the virtual photosensitive elements on the imaging plane correspond one-to-one to the pixels on the terminal screen.

[0054] Exemplarily, the world space coordinate system can be obtained by transforming the three-dimensional model in the model space coordinate system through the model transformation matrix. The model space coordinate system is used to indicate the position information of the three-dimensional model; the coordinate information of each three-dimensional model in the model space coordinate system is unified into the world space coordinate system through the model transformation matrix in the three-dimensional space. The three-dimensional model in the world space coordinate system is transformed into the camera space coordinate system through the view matrix. The camera space coordinate system is used to describe the coordinates of the three-dimensional model observed by the camera model, such as using the position of the camera model as the coordinate origin; the three-dimensional model in the camera space coordinate system is transformed into the clipping space coordinate system through the projection matrix to obtain a two-dimensional image. The clipping space coordinate system is used to describe the projection of the three-dimensional model in the viewing cone of the camera model. The commonly used perspective projection matrix (a projection matrix) is used to project the three-dimensional model into a model that conforms to the human eye observation rule of "near is big and far is small". Exemplarily, the above-mentioned model transformation matrix, view matrix and projection matrix are generally collectively referred to as the Model View Projection (MVP) matrix.

[0055] FIG2 is a schematic diagram of a transformation process from a three-dimensional space to a two-dimensional image provided by an exemplary embodiment of the present application.

[0056] Figure 2 shows the process of mapping a feature point P in the three-dimensional space 201 to a feature point p' in the imaging plane 204 (image coordinate system, or pixel coordinate system). The coordinates of the feature point p in the three-dimensional space 201 are in three-dimensional form, and the coordinates of the feature point p' in the imaging plane 204 are in two-dimensional form. The three-dimensional space 201 is the three-dimensional space corresponding to the virtual scene. The camera plane 202 is determined by the posture of the camera model. The camera plane 202 is a plane perpendicular to the shooting direction of the camera model, and the imaging plane 204 and the camera plane 202 are parallel to each other. The imaging plane 204 corresponds to the area within the field of view when observing the virtual scene. Optionally, the above-mentioned virtual camera can be implemented as a camera model.

[0057] FIG3 is a schematic diagram of a screen rendering method provided by related art.

[0058] In related technologies, 1. When the reflection effect of a reflection capture object in a virtual scene changes, the terminal device marks the reflection capture object with the changed reflection effect. 2. The terminal device generates rendering instructions corresponding to all virtual objects in the virtual scene. This ensures that the texture of each virtual object's surface changes synchronously with the changes in the reflection capture object, thereby improving the realism of the display within the generated field of view and achieving accurate rendering of the virtual scene.

[0059] However, this method requires updating a large number of rendering instructions to ensure the correct rendering of the virtual scene. In complex scenes, if the reflection capture object changes, a large number of rendering instructions need to be updated, causing the display to freeze. This is especially true in open-world games, where the "world" brings more complex virtual scenes and "openness" brings a higher degree of freedom. When players control virtual characters to explore such complex virtual scenes, they will frequently trigger changes in the reflection effects of the reflection capture object, resulting in a significant increase in the computing overhead of the terminal device.

[0060] Figure 4 is a schematic diagram illustrating the change in computational overhead provided by an exemplary embodiment of the present application. As shown in Figure 4, histogram 401 illustrates how the computational overhead of a terminal device changes over time. It can be seen that after a change in the reflection capture object, the terminal device needs to update the rendering instructions for a large number of virtual objects, causing a sudden increase in computational overhead. This can easily lead to unstable frame rates, or even excessively choppy or lag-prone display.

[0061] FIG5 is a schematic diagram of a screen rendering method provided by an exemplary embodiment of the present application.

[0062] 1. When the reflection effect of the reflection capture object in the virtual scene changes, the terminal device marks the target reflection capture object whose reflection effect has changed. 2. The terminal device determines the virtual objects within the influence range of the reflection capture object. 3. The rendering instructions of the virtual objects within the influence range of the target reflection capture object are updated. For example, if a virtual object is not within the influence range of the reflection capture object, the surface texture of the virtual object is not affected by the reflection capture object, and there is no need to regenerate rendering instructions for the virtual object. If a virtual object is within the influence range of the reflection capture object, the surface texture of the virtual object will change with the change of the reflection capture object, and it is necessary to regenerate rendering instructions for the virtual object.

[0063] Before a changed reflection capture object triggers the rendering process, the rendering instructions for some virtual objects in the field of view are selectively updated based on whether they are affected by the reflection capture object, without having to update the rendering instructions for all virtual objects in the virtual scene. This method effectively reduces the number of rendering instructions that need to be updated, thereby reducing the computer overhead of updating rendering instructions. This helps reduce the computational overhead of rendering and generating display images, thereby reducing the time it takes to generate the display images and improving the smoothness of the display playback.

[0064] FIG6 is a flowchart of a screen rendering method provided by an exemplary embodiment of the present application. For example, the execution subject of the method may be a terminal device 10 in the implementation environment of the solution described in FIG1 , for example, the execution subject may be a client of a target application running on the terminal device 10. As shown in FIG6 , the method may include the following steps ( 610 - 640 ):

[0065] Step 610: Acquire reflection capture information of the virtual scene. The reflection capture information includes geometric information of at least one reflection capture object. The reflection capture object is used to project a cube map representing a reflection effect onto a material surface of a virtual object.

[0066] A virtual scene refers to a digital scene outlined by a computer through digital communication technology. The virtual scene can be understood as a digital three-dimensional space. The display screen of the target application comes from the virtual scene. For example, by observing the virtual scene provided by the target application through a virtual camera, the display screen of the target application can be obtained.

[0067] In some embodiments, a virtual scene includes virtual objects and functional objects; virtual objects refer to visible objects in the virtual scene, and functional objects refer to objects configured in the virtual scene to implement independent functions, such as light, energy, and heat. In some cases, functional objects are not visible in the virtual scene; that is, they are not displayed on the display. Functional objects may have a pre-set range of influence in the virtual environment.

[0068] Optionally, virtual objects include: game objects such as virtual characters, virtual props, and virtual vehicles that can be controlled and moved by the terminal device, as well as virtual props, virtual buildings, virtual mountains and rivers, and other environmental objects that cannot be controlled by the terminal device. Virtual objects can be fixed at a certain location in the virtual scene or can move within the virtual scene. In other words, a virtual object can be understood as any entity in the virtual scene that can appear on the display screen, and this embodiment of the application is not limited to this.

[0069] To differentiate the display effects of different virtual objects, virtual objects have material properties, and the material of the virtual objects is used to simulate the real objects corresponding to the virtual objects. Optionally, the material properties of the virtual objects are reflected through a cube map on the material surface. The terminal device integrates the cube map into the material surface of the virtual object, so that the surface texture of the virtual object approximates the visual effect of the real object. Exemplarily, a cube map refers to a texture map organized in a cubic structure and mapped by combining multiple textures. Optionally, the cube map includes six two-dimensional maps, which are used to represent the surface texture of the top, bottom, left, right, front, and back surfaces of the virtual object. Exemplarily, the cube map of the material surface of the virtual object can be pre-set or determined in real time based on the position of the virtual object in the virtual scene.

[0070] A reflection capture object refers to an object determined based on reflection capture technology. For example, a reflection capture object can refer to an object used to simulate reflection and indirect lighting of materials and scenes. It can be virtual and does not exist in the virtual scene. In some embodiments, the reflection capture object is used to provide a cube map for a virtual object with reflective properties. Optionally, the cube map provided by the reflection capture object comes from a first area in the virtual scene, and the cube map provided by the reflection capture object is a static image obtained by observing the first area in the virtual scene from a first observation angle. A virtual object with reflective properties refers to an object that can achieve reflected lighting and indirect lighting, such as a mirror, water surface, glass surface, etc. The cube map provided by the reflection capture object can make the virtual object with reflective properties have a reflective effect. The first area is related to the virtual object with reflective properties. For example, the first area can refer to the area reached by the target light, and the target light can refer to the light reflected from the virtual object with reflective properties from the first observation angle.

[0071] That is, the reflection capture object is used to project a cubemap captured from the virtual scene onto a surface having a reflective material, thereby achieving the effect that the surface of the virtual object reflects the scenery in the first area of ​​the virtual scene, such as the sky reflected on the surface of a river, where the river surface is a surface having a reflective material and the sky is the scenery in the first area. Exemplarily, the reflection capture object includes a probe, which is used to observe the first area in the virtual scene at a first observation angle to obtain the cubemap provided by the reflection capture object. It should be noted that the coordinate information of the probe and the first observation angle are preset and are not limited in this application.

[0072] Optionally, the reflection capture object has a range of influence. The range of influence of the reflection capture object refers to the effective range of the reflection capture, that is, the range of the cube map representing the reflection effect to be projected. The range of influence of the reflection capture object is a portion of the three-dimensional space in the virtual scene. The geometric shape of the reflection capture object's range of influence includes at least one of the following: a bounding box (Box), a sphere (Sphere), and a mirror (Planar). The ranges of influence of different reflection capture objects are not exactly the same, and the ranges of influence of reflection capture objects with different geometric shapes are not exactly the same.

[0073] Surfaces of virtual objects within the reflection capture object's range of influence are mapped to the cubemap provided by the reflection capture object. Surfaces of virtual objects outside the reflection capture object's range of influence do not need to be mapped to the cubemap provided by the reflection capture object. A material surface is a surface that indicates a material. A material is a representation of a virtual object's surface properties, such as texture, gloss, and transparency, and directly affects the visual quality and feel of the virtual object.

[0074] Figure 7 is a schematic diagram of a reflection effect provided by an exemplary embodiment of the present application. As shown in Figure 7, the reflection capture object causes the surface texture of a virtual object to have a reflective effect. The surface texture of a virtual object 710 (river) in the virtual scene includes the surface texture of a first region 720 in the virtual scene. That is, the scenery (static image) in first region 720 is reflected on virtual object 710, resulting in a reflective surface texture of virtual object 710.

[0075] In some embodiments, the reflection effect of the reflection capture object includes at least one of the following: reflection is effective and reflection is ineffective; wherein, reflection is effective means that the terminal device loads the reflection capture object so that the reflection capture object can provide a cube map; reflection is ineffective means that the terminal device unloads the reflection capture object, making the reflection capture object ineffective.

[0076] Optionally, the change in reflection effect refers to a change in the reflection effect of the reflection capture object, where the change in effect includes: switching from reflection disabled to reflection enabled, or switching from reflection enabled to reflection disabled. For example, if reflection is enabled, the static image corresponding to the first area may be determined as a cubemap and projected onto the material surface of the virtual object. If reflection is disabled, the cubemap is not obtained and is not projected onto the material surface of the virtual object.

[0077] Exemplarily, the timing at which the reflection effect of the reflection capture object changes is related to the behavior of the virtual character controlled by the terminal device in the virtual scene. For example, after the virtual character moves into the influence range of a certain reflection capture object, the terminal device loads the reflection capture object. After the virtual character moves out of the influence range of a certain reflection capture object, the terminal device unloads the reflection capture object. For example, if the minimum distance between the current field of view and the influence range of a certain reflection capture object is less than or equal to a threshold, the terminal device loads the reflection capture object. If the minimum distance between the current field of view and the influence range of a certain reflection capture object is greater than a threshold, the terminal device unloads the reflection capture object. The threshold can be any positive real number.

[0078] Exemplarily, the timing at which the reflection effect of a reflection capture object changes is preset. For example, if the target application is preset to unload a certain reflection capture object at a first moment, the terminal device will unload the reflection capture object at the first moment. For another example, if the target application is preset to load a certain reflection capture object at a second moment, the terminal device will load the reflection capture object at the first moment. The first moment and the second moment are any moments during the execution of the target application.

[0079] In some embodiments, the reflection capture information is used to represent information related to all reflection capture objects corresponding to the virtual scene, such as the reflection capture information includes geometric information of all reflection capture objects corresponding to the virtual scene. In some embodiments, the reflection capture information is used to represent information related to reflection capture objects whose reflection effects have changed, such as the reflection capture information includes geometric information of at least one reflection capture object whose reflection effects have changed. Optionally, the reflection capture information includes at least one of the following: an object identifier of the reflection capture object and geometric information of the reflection capture object, wherein the object identifier of the reflection capture object is used to uniquely identify the reflection capture object, and the geometric information of the reflection capture object is used to indicate the influence range of the reflection capture object in the virtual scene.

[0080] For example, in the case where the reflection capture information includes the geometric information of all reflection capture objects corresponding to the virtual scene, in the target application, the logic thread responsible for managing the execution logic of the relevant virtual scene updates the reflection capture information when detecting the loading or unloading of the reflection capture information. If at a certain moment, the reflection effects of multiple reflection capture objects change, the logic thread updates the geometric information of the above-mentioned multiple reflection capture objects to the reflection capture information to obtain the updated reflection capture information. For another example, in the case where the reflection capture information includes the geometric information of at least one reflection capture object whose reflection effect changes, in the target application, the logic thread responsible for managing the execution logic of the relevant virtual scene records the reflection capture information when detecting the loading or unloading of the reflection capture information. If at a certain moment, the reflection effects of multiple reflection capture objects change, the logic thread records the geometric information of the above-mentioned multiple reflection capture objects to obtain the reflection capture information. This embodiment of the present application does not limit this.

[0081] Optionally, the logical thread records the reflection capture information in a first array, and each array cell of the first array includes the geometric information of a reflection capture object and the object identifier of the reflection capture object; or, each array cell of the first array includes the geometric information of a reflection capture object with a changed reflection effect and the object identifier of the reflection capture object.

[0082] Step 620, when there is a target reflection capture object whose reflection effect changes in at least one reflection capture object, determine at least one target virtual object from at least one virtual object included in the field of view based on the geometric information of the target reflection capture object. The target virtual object refers to a virtual object whose surface display effect changes after the reflection effect of the target reflection capture object changes.

[0083] Optionally, if the reflection capture object switches from reflection disabled to reflection enabled or from reflection enabled to reflection disabled, the reflection capture object can be determined as the target reflection capture object. The geometric information of the target reflection capture object can be obtained by obtaining the reflection capture information in step 610.

[0084] In some embodiments, when the reflection capture information includes geometric information of at least one reflection capture object whose reflection effect changes, the at least one reflection capture object is a target reflection capture object. That is, any reflection capture object corresponding to the reflection capture information is a reflection object whose reflection effect changes in the virtual scene. The geometric information of any reflection capture object is obtained by obtaining the reflection capture information in step 610. Optionally, the reflection capture information includes the geometric information of the reflection capture object.

[0085] In some embodiments, the field of view is used to represent the range of observation of the virtual scene. Virtual objects in the virtual scene that are within the field of view can be observed; virtual objects that are not within the field of view cannot be observed. In other words, virtual objects within the field of view can appear in the display screen of the field of view, while virtual objects that are not within the field of view will not appear in the display screen of the field of view. The field of view can be understood as the observation range of the virtual camera in the virtual scene, that is, the field of view refers to the geometric area included in the viewing cone with the imaging center of the virtual camera as the vertex.

[0086] Optionally, the field of view changes as the virtual camera moves. Therefore, the field of view can be different at different times, and the virtual objects included in the field of view also change at different times. For example, at the kth time, the field of view includes virtual objects 1, 2, and 3. At the k+1th time, the field of view includes virtual objects 3 and 4, where k is a positive integer.

[0087] Exemplarily, the types of field of view include at least one of the following: the field of view under the first-person perspective, the field of view under the third-person perspective, the field of view under the God's perspective, and the field of view under the 45-degree perspective. Among them, the field of view under the first-person perspective refers to the observation range of the virtual scene observed by a controllable virtual character as an observer. In this case, the display screen of the field of view is used to show the picture observed by the virtual character. Exemplarily, if a virtual camera is set at the head position of the virtual character in the virtual scene, the virtual camera and the head of the virtual character are relatively stationary, and the shooting direction of the virtual camera is the same as the line of sight direction of the virtual character, then the shooting range of the virtual camera is the field of view.

[0088] The display screen obtained by observing the virtual scene from the field of view of the first-person perspective does not include the virtual character, or only includes a portion of the virtual character (for example, only the virtual character's hands appear in the display screen, and the virtual character's face is not shown). Using the first-person perspective to observe the virtual scene to obtain the display screen can enhance the user's immersion in the target application.

[0089] The third-person perspective refers to a perspective from which a virtual character can observe a virtual scene. In some embodiments, the virtual character can be observed from the third-person perspective. The third-person perspective can be understood as setting a virtual camera at a first distance from the virtual character, with the virtual camera and the first virtual character remaining relatively stationary. The first distance can be set and adjusted based on actual usage requirements. It should be noted that the method for setting the field of view range is set according to actual needs and is not limited in this application.

[0090] In some embodiments, the target virtual object refers to: a virtual object within the field of view that is within the influence range of the target reflection capture object, and the surface material of the target virtual object has a reflective property, for example, the surface material of the target virtual object is a water surface material, a glass material, a metal plane material, etc.

[0091] In one example, the terminal device determines the influence range corresponding to each reflection capture object based on the geometric information of each reflection capture object in the reflection capture information; when there are one or more target reflection capture objects, for any target reflection capture object, the terminal device determines the target virtual object within the influence range of the target reflection capture object from at least one virtual object included in the field of view; the terminal device records the target virtual objects corresponding to each target reflection capture object.

[0092] Optionally, after the reflection effect of a reflection capture object changes, the surface texture of the target virtual object's material needs to change synchronously. For example, after a terminal device loads a reflection capture object, the surface texture of the target virtual object corresponding to the reflection capture object needs to display the cubemap provided by the reflection capture object. For another example, after a terminal device uninstalls a reflection capture object, the surface texture of the target virtual object corresponding to the reflection capture object should not display the cubemap provided by the reflection capture object.

[0093] Therefore, in the case of target reflection capture objects with changed reflection effects, these target virtual objects need to be re-rendered in order to update the surface texture of this part of the target virtual objects in the display screen.

[0094] In some embodiments, step 620 is performed by a rendering thread in the target application. Optionally, the rendering thread accesses the logic thread at a first time interval to obtain reflection capture information from the logic thread. Based on the reflection capture information, the rendering thread determines at least one target reflection capture object whose reflection effect has changed, and then determines the target virtual object corresponding to each target reflection capture object. The first time interval can be set and adjusted based on actual usage requirements. For details on the method for determining the target virtual object, please refer to the following embodiments.

[0095] Step 630 : re-render the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes.

[0096] Re-rendering refers to the process of re-rendering a virtual object, and the re-rendered target virtual object refers to the target virtual object obtained after re-rendering. Optionally, the re-rendering in the embodiment of the present application can be the process of re-rendering the material surface of the virtual object. In some embodiments, the terminal device re-renders the target virtual object to generate a target virtual object with a changed material surface texture, that is, a re-rendered target virtual object. For virtual objects other than the target virtual object in the field of view, the terminal device will also render these virtual objects, but the material surface texture of these virtual objects will not change due to the influence of the target reflection capture object, that is, there is no need to re-render the material surface of these objects, which is conducive to reducing the workload of re-rendering and thus improving the efficiency of re-rendering.

[0097] Optionally, in this step, the terminal device updates the rendering instructions of the target virtual object, and there is no need to update the rendering instructions of other virtual objects except the target virtual object, which helps to reduce the workload of updating the rendering instructions; the terminal device performs the rendering process according to the rendering instructions of the target virtual object and the rendering instructions of other virtual objects that have not been updated.

[0098] For example, in the process of generating a certain display screen, the rendering instructions of each virtual object included in the field of view are required. After generating a certain display screen, the terminal device temporarily stores the rendering instructions of each virtual object; when it is necessary to render and generate the next display screen, the terminal device executes steps 610 and 620 to determine the target virtual object in the next display screen; the terminal device updates the rendering instructions of the target virtual object in the next display screen (which can also be understood as replacing the old rendering instructions of the target virtual object with the updated rendering instructions of the target virtual object); then, the terminal device instructs the graphics processor to render each virtual object included in the field of view according to the updated rendering instructions of the target virtual object and the unupdated rendering instructions of other virtual objects. After rendering and generating the next display screen, the terminal device stores the updated rendering instructions of the target virtual object and the unupdated rendering instructions of other virtual objects.

[0099] Step 640 : Generate a display image of the field of view based on the re-rendered target virtual object and other virtual objects in the at least one virtual object except the target virtual object.

[0100] The display screen of the field of view may refer to a screen observed from an area of ​​the virtual scene within the field of view. The display screen includes a re-rendered target virtual object and other virtual objects within the field of view. In some embodiments, the display screen may be a 2D (2Dimensional, 2D) plane image, or a 3D (3Dimensional, 3D) screen with a 3D structure and perspective relationship. This application does not limit the type of display screen. For example, the display screen may consist of a re-rendered 2D plane image of the target virtual object and 2D plane images of other virtual objects.

[0101] In one example, taking the target application as a game application, the virtual scene is used to provide a game screen, and the terminal device controls the virtual character to move in the virtual scene in response to the movement operation of the virtual character. At a certain moment, the field of view of the virtual character coincides with the influence range of the reflection capture object A, and the terminal device loads the reflection capture object A; the terminal device obtains the geometric information of the reflection capture object A, and based on the geometric information of the reflection capture object A, determines at least one target virtual object affected by the reflection capture object A from at least one virtual object included in the field of view; the terminal device re-renders the at least one target virtual object so that the material surface of the re-rendered target virtual object displays the cube map provided by the reflection capture object A; the terminal device generates the next display screen based on the target virtual object and other virtual objects in the field of view.

[0102] To sum up, when the reflection effect of the reflection capture object changes, the virtual objects affected by the reflection capture object are filtered out from the virtual objects included in the field of view, and only the rendering instructions of these filtered out virtual objects are updated. This can effectively reduce the number of updates of the rendering instructions. This method helps to alleviate the problem of a sudden increase in computing pressure caused by updating the rendering instructions when the reflection effect of the reflection capture object changes, thereby helping to reduce the power consumption of the terminal device.

[0103] In addition, by reducing the number of virtual objects that need to be updated and rendered, the computing pressure on the terminal device to generate the display image when the reflection effect of the reflection capture object changes is reduced, thereby reducing the chance of screen freeze problems. This helps to maintain a stable frame rate for display image updates, thereby helping to improve the rendering performance of the terminal device and maintain the smoothness of the display image during use of the target application.

[0104] The following describes a method for obtaining reflection capture information through several embodiments.

[0105] In some embodiments, step 610, obtaining reflection capture information of a virtual scene, may include the following sub-steps:

[0106] In sub-step 613 , the terminal device generates reflection capture information through a logic thread, where the logic thread is used to manage logic operations related to the virtual scene.

[0107] Optionally, the end device generates reflection capture information through a logical thread, and updates the reflection capture information when the reflection effect of the reflection capture object changes.

[0108] In some embodiments, when the reflection effect of the reflection capture object changes, the terminal device generates reflection capture information through a logical thread, that is, if the reflection effect of the reflection capture object changes at different moments, different reflection capture information is generated.

[0109] Exemplarily, the reflection effect of a reflection capture object can be changed by calling an effect change function. After receiving the call to the effect change function, the logic thread can determine that the reflection effect of the reflection capture object has changed. The logic thread records the geometric information of the reflection capture object and generates or updates the reflection capture information based on the geometric information of the reflection capture object. The reflection capture information includes the geometric information of all reflection capture objects whose reflection effects have changed in the next frame of the display. Optionally, when the target application is a game application, the logic thread is also referred to as a game thread.

[0110] Figure 8 is a schematic diagram of reflection capture information provided by an exemplary embodiment of the present application. Reflection capture information 801 includes the type of the reflection capture object's influence range, such as a bounding box, sphere, or mirror, as well as geometric information about the reflection capture object, such as its position and size in the virtual scene.

[0111] In sub-step 616 , the terminal device obtains the reflection capture information from the logic thread according to the access cycle through the rendering thread, and the rendering thread is used to render and generate a display screen within the field of view.

[0112] In some embodiments, the access period is related to the frame rate of the displayed image, wherein the frame rate refers to the number of displayed images per unit time. Exemplarily, the access period is equal to the inverse of the frame rate of the displayed image.

[0113] Optionally, the rendering thread determines whether the reflection effect of each reflection capture object included in the virtual scene has changed every access cycle; if there is at least one target reflection capture object whose reflection effect has changed in the virtual scene, the rendering thread obtains reflection capture information from the logic thread to obtain geometric information of the at least one target reflection capture object, thereby determining the target virtual object in the field of view; if there is no target reflection capture object whose reflection effect has changed in the virtual scene, there is no need to execute the step of determining the target virtual object in the field of view.

[0114] Exemplarily, the rendering thread determines whether there is a target reflection capture object whose reflection effect has changed by accessing the storage address used by the logical thread to store reflection capture information. If the storage address is empty, the rendering thread determines that the reflection effect of the reflection capture object has not changed; if the storage address is not empty, the rendering thread determines that the reflection effect of the reflection capture object has changed. In this case, the rendering thread reads the reflection capture information from the storage address. Alternatively, the rendering thread determines whether there is a target reflection capture object whose reflection effect has changed based on the effect change function. If there is no effect change function, the rendering thread determines that the reflection effect of the reflection capture object has not changed; if there is an effect change function, the rendering thread determines that the reflection effect of the reflection capture object has changed. In this case, the rendering thread reads the geometric information of the target reflection capture object from the reflection capture information.

[0115] In some embodiments, since the terminal device needs to generate display images at different times according to the frame rate, the rendering thread is required to determine the rendering instructions of each virtual object in the field of view scene during the operation of the target information program. At the moment when the reflection effect of the reflection capture object changes, before the rendering thread obtains the reflection capture information from the logic thread according to the access cycle, the rendering thread will perform cone clipping and occlusion query on the virtual objects included in the virtual scene, so as to determine the virtual objects in the field of view from the virtual objects included in the virtual scene. Subsequently, the rendering thread obtains the geometric information of the target reflection capture object from the logic thread, and determines at least one target virtual object based on the geometric information of the target reflection capture object.

[0116] By performing optimization steps such as frustum clipping before determining the target object, this method helps reduce the number of virtual objects that need to be verified for influence by the target reflection capture object. This helps reduce the computational overhead of the rendering thread in determining the target virtual object, thereby improving the rendering performance of the terminal device. Furthermore, by obtaining only the geometric information of the target reflection capture object, rather than the geometric information of all reflection capture objects, the workload of obtaining geometric information is reduced, further reducing the power consumption of the terminal device.

[0117] The following describes a method for determining a target virtual object through several embodiments.

[0118] As can be seen from the foregoing, the terminal device determines at least one target virtual object from at least one virtual object within the field of view based on the influence range of the target reflection capture object. Optionally, a virtual object within the influence range of the target reflection capture object is determined as a target virtual object, and a virtual object outside the influence range of the target reflection capture object is not determined as a target virtual object. The process of determining the positional relationship between the virtual object and the influence range of the target reflection capture object includes the following.

[0119] In some embodiments, step 620, determining at least one target virtual object from at least one virtual object within the field of view based on the geometric information of the target reflection capture object, may also include the following sub-steps (not shown in the accompanying drawings):

[0120] Sub-step 623a, calculating the first bounding volume of the target reflection capture object according to the geometric information of the target reflection capture object, where the first bounding volume refers to the geometric space in which the target reflection capture object is effective in the virtual scene.

[0121] In some embodiments, the first bounding volume is used to represent the range of influence of the reflection capture object in the virtual scene. In some cases, the range of influence of the reflection capture object in the virtual scene is a closed geometric object. Optionally, the first bounding volume includes at least one of the following types: a cuboid bounding box and a sphere.

[0122] Exemplarily, if the influence range of the reflection capture object is a bounding box of a cuboid, the geometric information of the reflection capture object is used to characterize the vertex information of the influence range of the reflection capture object. If the geometric information of the target reflection capture object is used to characterize the position information of the eight vertices of the bounding box, then the range corresponding to the cuboid constructed based on the eight vertices is the influence range of the target reflection capture object. If the influence range of the reflection capture object is a sphere, the geometric information of the reflection capture object is used to characterize the coordinate information and radius of the points of the influence range of the reflection capture object. If the geometric information of the target reflection capture object is used to characterize the coordinate information and radius of the points of the sphere, then the range corresponding to the sphere is the influence range of the target reflection capture object. Based on the geometric information of the reflection capture object, the terminal device can calculate the influence range of the reflection capture object, that is, the first bounding volume of the reflection capture object.

[0123] Sub-step 626a: determining at least one target virtual object based on the first bounding volume and the second bounding volume corresponding to the at least one virtual object, where the second bounding volume refers to the geometric space occupied by the virtual object in the virtual scene.

[0124] In some embodiments, the second bounding volume is used to represent the position of the virtual object in the virtual scene. Optionally, the type of the second bounding volume includes at least one of the following: a cuboid bounding box, a sphere.

[0125] Optionally, if the virtual object is immovable, the second bounding volume of the virtual object is pre-set, and the terminal device directly reads the coordinate information of the second bounding volume of the virtual object from the storage space. If the virtual object is movable, the position of the second bounding volume of the virtual object in the virtual scene will change. The terminal device calculates the coordinate information of the second bounding volume in the virtual scene based on the initial coordinate information of the second bounding volume and the movement information of the virtual object; the initial coordinate information is used to indicate the initial position of the virtual object in the virtual scene, and the movement information is used to represent the movement of the virtual object in the virtual scene.

[0126] Optionally, for any virtual object, the terminal device determines whether to use the virtual object as a target virtual object based on the positional relationship between the first enclosing body and the second enclosing body of the virtual object. If the positional relationship between the second enclosing body of the virtual object and the first enclosing body satisfies the intersection condition, it can be determined that the virtual object is affected by the target reflection capture object, and the virtual object is determined to be the target virtual object; if the positional relationship between the second enclosing body of the virtual object and the first enclosing body does not satisfy the intersection condition, it can be determined that the virtual object is not affected by the target reflection capture object, and the virtual object will not be determined to be the target virtual object. The intersection condition is used to verify the intersection of the first enclosing body and the second enclosing body in the virtual scene, and the intersection condition is used to indicate whether the first enclosing body and the second enclosing body intersect.

[0127] By searching for the target virtual object from at least one virtual object included in the influence range, it is convenient to subsequently update only the rendering instructions of the target virtual object. With this method, when the reflection effect of the reflection capture object changes, the target virtual object with the changed surface texture can be displayed in the display screen, and the number of rendering instructions that need to be updated can be effectively controlled, which helps to improve the rendering efficiency of the terminal device and reduce the waste of computing resources.

[0128] The following describes a method for determining whether bounding volumes intersect (ie, whether the intersection condition is satisfied) through several embodiments.

[0129] In some embodiments, in sub-step 626a, the terminal device determines at least one target virtual object based on the first enclosing volume and the second enclosing volume corresponding to the at least one virtual object, including: for any enclosing volume to be detected in the second enclosing volume corresponding to the at least one virtual object, if the enclosing volume to be detected intersects with the first enclosing volume, then the virtual object corresponding to the enclosing volume to be detected is determined as the target virtual object.

[0130] Optionally, the rendering thread sequentially determines whether a second bounding volume corresponding to at least one virtual object intersects with the first bounding volume, where the bounding volume to be detected is a second bounding volume that has not been determined to overlap with the first bounding volume. Exemplarily, the terminal device determines whether each bounding volume to be detected intersects with the first bounding volume. If a bounding volume to be detected intersects with the first bounding volume, the terminal device determines the virtual object corresponding to the bounding volume to be detected as the target virtual object. If the bounding volume to be detected does not intersect with the first bounding volume, the terminal device determines that the virtual object corresponding to the bounding volume to be detected is not the target virtual object.

[0131] In some embodiments, the method for determining whether the bounding volume to be detected intersects the first bounding volume is related to the shape of the first bounding volume (i.e., the shape of the reflection capture object's range of influence). As mentioned above, if the reflection capture object's range of influence is a closed space, the first bounding volume can be a rectangular bounding box or a sphere. The following two examples illustrate the method for determining whether the first and second bounding volumes intersect when the first bounding volume is a rectangular bounding box and when the first bounding volume is a first bounding volume sphere.

[0132] Example 1: The first bounding volume is the bounding box of a rectangular parallelepiped.

[0133] In some embodiments, the screen rendering method also includes: when the first bounding volume is a rectangular parallelepiped and the bounding volume to be detected is a rectangular parallelepiped, the terminal device calculates a first normal vector group of the first bounding volume based on the vertex information of the first bounding volume, and the first normal vector group includes a first normal vector perpendicular to the plane of the first bounding volume; the terminal device determines a second normal vector group of the bounding volume to be detected based on the vertex information of the bounding volume to be detected, and the second normal vector group includes a second normal vector perpendicular to the plane of the bounding volume to be detected; the terminal device calculates a cross product vector between two normal vectors from the first normal vector group and the second normal vector group, respectively, and the cross product vector refers to a result vector obtained by vector cross multiplication; the terminal device uses the first normal vector, the second normal vector and the cross product vector as k separating axes between the first bounding volume and the bounding volume to be detected, where k is a positive integer; the terminal device determines the intersection between the first bounding volume and the bounding volume to be detected based on the projections of the first bounding volume and the bounding volume to be detected on the k separating axes, and the intersection is used to indicate whether the first bounding volume intersects with the bounding volume to be detected.

[0134] In some embodiments, vertex information of the first bounding volume is determined based on geometric information of the target reflection capture object. Optionally, the geometric information of the target reflection capture object includes coordinate information of the center point of the first bounding volume and the side lengths of each point of the first bounding volume. The terminal device calculates the coordinate information of the eight vertices of the first bounding volume based on the coordinate information of the center point of the first bounding volume and the side lengths of each point of the first bounding volume. Exemplarily, the eight vertices are A1, A2, A3, A4, A5, A6, A7, and A8.

[0135] In some embodiments, the terminal device calculates a first normal vector group of the first enclosing volume based on vertex information of the first enclosing volume, including: the terminal device determines three basis vectors of the first enclosing volume, and the basis vectors are used to characterize the side length direction of the first enclosing volume; the terminal device selects any two basis vectors from the three basis vectors; the terminal device calculates the cross product of the two selected basis vectors to obtain a first normal vector perpendicular to the plane of the first enclosing volume.

[0136] Alternatively, based on basic geometric relationships, a cuboid consists of six surfaces, three of which are parallel to each other, and the normal vectors of these parallel surfaces are the same. That is, the cuboid has three non-parallel normal vectors, denoted as NA1, NA2, and NA3. The cuboid has sides in three directions, meaning it has three basis vectors. For any of the three basis vectors, the basis vector can be calculated based on the difference in coordinates of the two vertices on the side corresponding to the basis vector. The basis vectors in the three directions can be denoted as U1, V1, and W1, respectively.

[0137] The first normal vector group refers to a set or group consisting of first normal vectors. For example, the first normal vector group includes three first normal vectors in different directions: NA1, NA2, and NA3, which can be calculated using the following formulas: NA1 = U1 × V1, NA2 = W1 × V1, and NA3 = W1 × U1.

[0138] The second normal vector group refers to a set or group consisting of second normal vectors. The calculation method for the second normal vector group is the same as that for the first normal vector group. For example, the eight vertices of the second bounding volume are B1, B2, B3, B4, B5, B6, B7, and B8. The three basis vectors U2, V2, and W2 of the second bounding volume can be calculated using these eight vertices. The terminal device performs a cross product of any two of the three basis vectors to obtain the three second normal vectors for the second bounding volume: NB1, NB2, and NB3. Here, NB1 = U2 × V2, NB2 = W2 × V2, and NB3 = W2 × U2. This means that the second normal vector group includes three second normal vectors in different directions: NB1, NB2, and NB3.

[0139] After calculating the first and second normal vector groups, the terminal device calculates a separating axis based on each normal vector in the first and second normal vector groups. Optionally, there are two types of separating axes. The first type of separating axis is the normal vector of the first bounding volume or the normal vector of the second bounding volume. That is, NA1, NA2, NA3, NB1, NB2, and NB3 all belong to the first type of separating axis. The second type of separating axis is calculated using a normal vector in the first and second normal vector groups.

[0140] For example, the second type of separation axes can be expressed as: N11, N12, N13, N21, N22, N23, N31, N32, N33, where N11 = NA1 × NB1, N12 = NA1 × NB2, N13 = NA1 × NB3, N21 = NA2 × NB1, N22 = NA2 × NB2, N23 = NA2 × NB3, N31 = NA3 × NB1, N32 = NA3 × NB2, and N33 = NA3 × NB3. That is, the terminal device can calculate 15 separation axes, namely: NA1, NA2, NA3, NB1, NB2, NB3, N11, N12, N13, N12, N22, N23, N31, N32, and N33.

[0141] In some embodiments, the terminal device determines the intersection between the first enclosing volume and the enclosing volume to be detected based on the projections of the first enclosing volume and the enclosing volume to be detected on k separation axes, including: for any one of the k separation axes, the terminal device calculates a first projection line of the first enclosing volume on the separation axis, and a second projection line of the second enclosing volume on the separation axis; the terminal device determines whether the first enclosing volume and the enclosing volume to be detected overlap based on the degree of overlap between the first projection line and the second projection line.

[0142] Optionally, if there is a first separating axis and the first projection line and the second projection line on the first separating axis do not overlap, the terminal device determines that the bounding volume to be detected does not intersect with the first bounding volume; if on k separating axes, the first projection line and the second projection line overlap, the terminal device determines that the bounding volume to be detected intersects with the first bounding volume.

[0143] That is, in the process of determining the intersection between the first enclosing volume and the enclosing volume to be detected based on their projections on k separating axes, the terminal device determines whether there is a first separating axis among the k separating axes, where the first separating axis refers to a separating axis on which the first projection line and the second projection line do not overlap. If a separating axis belongs to the first separating axis, the terminal device stops verifying the other separating axes and determines that the first enclosing volume and the enclosing volume to be verified do not intersect. If the first separating axis does not exist, the terminal device continues to verify whether the other separating axes are the first separating axes until the verification process of the k separating axes is completed. If the first separating axis is not included in the k separating axes, the terminal device determines that the first enclosing volume and the enclosing volume to be detected intersect.

[0144] The embodiment of the present application adopts the "separating axis" method to quickly determine whether the first enclosing volume and the enclosing volume to be detected intersect, thereby effectively improving the efficiency of determining the intersection situation, and further improving the efficiency of determining the target virtual object.

[0145] Example 2: The first bounding volume belongs to a sphere.

[0146] In some embodiments, the screen rendering method also includes: when the first enclosing volume is a sphere and the enclosing volume to be detected is a rectangular parallelepiped, determining a basis vector group of the enclosing volume to be detected based on the vertex information of the enclosing volume to be detected, the basis vector group including basis vectors for characterizing the side length direction of the enclosing volume to be detected; projecting the center point on the basis vector based on the coordinate information of the center point of the first enclosing volume, and calculating the coordinate information of the target position point in the second enclosing volume with the smallest distance from the center point; determining the intersection between the first enclosing volume and the enclosing volume to be detected based on the coordinate information of the center point, the coordinate information of the target position point and the radius of the first enclosing volume, and the intersection situation is used to indicate whether the first enclosing volume and the enclosing volume to be detected intersect.

[0147] Optionally, the basis vector group of the bounding volume to be detected includes three basis vectors. For the method of determining each basis vector in the basis vector group of the bounding volume to be detected, please refer to the above embodiment.

[0148] In some embodiments, the terminal device projects the center point on the basis vector based on the coordinate information of the center point of the first enclosing volume, and calculates the coordinate information of the target position point in the second enclosing volume with the smallest distance from the center point, including: the terminal device calculates the straight-line distance between the center point of the first enclosing volume and each basis vector, and determines the minimum distance from the straight-line distances with each basis vector; wherein, the target position point is the projection point on the basis vector with the smallest distance from the center point, and the line connecting the basis vector and the target position point is perpendicular to the basis vector.

[0149] Subsequently, the terminal device calculates the distance between the target position point and the center point based on the coordinate information of the target position point and the coordinate information of the center point, and the terminal device determines whether the first enclosing volume and the second enclosing volume intersect based on the radius of the first enclosing volume and the distance between the target position point and the center point and the radius of the first enclosing volume.

[0150] Optionally, if the radius of the first enclosing body and the distance between the target position point and the center point are greater than the radius of the first enclosing body, the terminal device determines that the first enclosing body and the second enclosing body do not intersect; if the radius of the first enclosing body and the distance between the target position point and the center point are less than or equal to the radius of the first enclosing body, the terminal device determines that the first enclosing body and the second enclosing body intersect.

[0151] In the case where the first bounding volume is a sphere, the embodiment of the present application can determine whether the first bounding volume and the bounding volume to be detected intersect based on the center point and radius of the first bounding volume and the basis vector group of the bounding volume to be detected, thereby reducing the amount of calculation required to determine the intersection situation, and thus helping to reduce the amount of calculation required to determine the target virtual object.

[0152] When a virtual scene's field of view includes a large number of virtual objects, it takes a considerable amount of time for a terminal device to determine the target virtual object. To improve the efficiency of the terminal device in determining the target virtual object and shorten the time taken to determine the target virtual object, the following describes several embodiments of the steps for concurrently determining the target virtual object.

[0153] In some embodiments, the step of determining at least one target virtual object by the terminal device is performed by a rendering thread, which includes multiple sub-threads. Step 620, determining at least one target virtual object based on the first bounding volume and the second bounding volume corresponding to the at least one virtual object, includes the following sub-steps:

[0154] Sub-step 623b: For any one of the multiple sub-threads, the sub-thread calculates the second bounding volume corresponding to each virtual object in the virtual object subset, where the virtual object subset includes m virtual objects in at least one virtual object, where m is a positive integer.

[0155] In some embodiments, a sub-thread refers to a thread for executing rendering logic. A rendering thread including multiple sub-threads can be understood as a terminal device being provided with multiple Render threads for executing rendering logic. Each sub-thread has independent computing resources and storage resources, that is, the execution logic of each sub-thread does not interfere with each other.

[0156] Optionally, the number of sub-threads created by the terminal device depends on the configuration of the terminal device. For example, if the terminal device has a multi-core processor including n CPUs, the terminal device creates m sub-threads, where n is a positive integer and m is a positive integer less than or equal to n. The terminal device uses the m sub-threads to screen virtual objects in the field of view in parallel and determine at least one target virtual object.

[0157] Optionally, each sub-thread corresponds to a virtual object subset. In other words, virtual objects can be divided according to the number of sub-threads. For example, if the field of view includes multiple virtual objects, the terminal device groups the multiple virtual objects to obtain m virtual object subsets, each of which includes at least one virtual object. In other words, the value of m is less than or equal to the number of virtual objects included in the field of view.

[0158] Optionally, different virtual object subsets include different virtual objects. That is, for any virtual object among multiple virtual objects in the field of view, the virtual object can only be included in one virtual object subset. This method ensures that each virtual object only needs to be checked once, which helps to save computing resources of the terminal device.

[0159] In some embodiments, the terminal device statically partitions multiple virtual objects within its field of view into m virtual object subsets. Optionally, the maximum difference in the number of virtual objects included in each of the m virtual object subsets is no more than t, where t is a natural number that can be set and adjusted based on actual usage requirements. Static partitioning means that the virtual objects processed by each sub-thread are fixed.

[0160] For example, if the field of view at a certain moment includes p virtual objects, the terminal device evenly divides the p virtual objects into m virtual object subsets, and then assigns each of the m virtual object subsets to m sub-threads, so that each sub-thread simultaneously detects whether its assigned virtual object subset contains the target object. Alternatively, each sub-thread detects whether its assigned virtual object subset contains the target object in batches.

[0161] If p is divisible by m, then any virtual object subset within each virtual object subset contains p / m virtual objects. If p is not divisible by m, then the m virtual object subsets contain (m-1) virtual object subsets, each of which contains p / m virtual objects. Virtual object subsets other than the (m-1) virtual object subsets contain p%m virtual objects, where % represents the remainder operation. This division method makes it relatively easy to divide the multiple virtual objects within the field of view into virtual object subsets corresponding to each subthread.

[0162] In some embodiments, the terminal device dynamically divides multiple virtual objects in the field of view to obtain m virtual object subsets. Dynamic division means that the virtual objects processed by each sub-thread are changeable.

[0163] Optionally, the terminal device divides the multiple virtual objects into multiple static subsets and one dynamic subset; wherein, any two static subsets do not contain the same virtual object, and any static subset and dynamic subset do not contain the same virtual object. Optionally, the number of static subsets is equal to the number of subthreads created by the terminal device, and each static subset contains the same number of virtual objects. Optionally, each static subset contains at least one virtual object.

[0164] Exemplarily, at a certain moment, the field of view includes p virtual objects. The terminal device selects q virtual objects from the p virtual objects, and the dynamic subset includes the q virtual objects. The terminal device then divides the remaining (pq) virtual objects into m static subsets and assigns the m static subsets to m subthreads, where m is a positive integer less than or equal to n, and n is the number of CPUs included in the multi-core processor. The terminal device assigns the m static subsets to the m subthreads, respectively. If a first subthread among the m subthreads completes a verification process for each virtual object in the first static subset at time t1, and at least a second subthread among the m subthreads has not completed a verification process for each virtual object in the second static subset, the first subthread obtains at least one first virtual object from the dynamic subset and deletes the obtained first virtual object from the dynamic subset. The first subthread then performs a verification process on the at least one first virtual object obtained from the dynamic subset.

[0165] Among them, the first sub-thread and the second sub-thread are both sub-threads in the m sub-threads, the first static subset refers to the static subset assigned to the first sub-thread, and the second subset refers to the static subset assigned to the second sub-thread; if the first virtual object belongs to the target object, the first sub-thread adds the first virtual object to the object queue of the first sub-thread. For the specific content of the object queue, please refer to the embodiment below. When the m sub-threads have completed the verification process of each virtual object in the corresponding static subset, and the dynamic subset does not include virtual objects, the above m sub-threads complete the inspection process of the virtual objects included in the field of view.

[0166] As can be seen from the above, the algorithm for verifying whether the first bounding volume and the bounding volume to be verified intersect differs depending on the shape of the first bounding volume of the target reflection capture object. That is, the computational time required to determine whether the second bounding volume and the first bounding volume intersect differs for different virtual objects. By dynamically partitioning the multiple virtual objects included in the field of view, the time difference between multiple sub-threads completing the verification process for their respective virtual objects can be reduced. This avoids the situation where the majority of sub-threads need to wait for a minority of sub-threads to complete the virtual object verification process while the majority of sub-threads complete the virtual object verification process. This helps further accelerate the determination of the target virtual object and reduces the rendering time associated with this method.

[0167] Sub-step 626b: for the bounding volume to be detected corresponding to the virtual object to be detected in the virtual object subset, if the bounding volume to be detected intersects with the first bounding volume, the sub-thread adds the virtual object corresponding to the bounding volume to be detected to the object queue, and the object queue includes the target virtual object in the virtual object subset.

[0168] The method by which each sub-thread determines whether the first bounding volume and the second bounding volume intersect is related to the shape of the first bounding volume. In some embodiments, the screen rendering method further includes: when the first bounding volume is a cuboid and the bounding volume to be detected is a cuboid, the sub-thread calculates a first normal vector group for the first bounding volume based on the vertex information of the first bounding volume, wherein the first normal vector group includes a first normal vector perpendicular to the plane of the first bounding volume; the sub-thread determines a second normal vector group for the bounding volume to be detected based on the vertex information of the bounding volume to be detected, wherein the second normal vector group includes a second normal vector perpendicular to the plane of the bounding volume to be detected; the sub-thread calculates a cross product vector between two normal vectors from the first normal vector group and the second normal vector group, respectively, wherein the cross product vector refers to a result vector obtained by vector cross multiplication; the sub-thread uses the first normal vector, the second normal vector, and the cross product vector as k separating axes between the first bounding volume and the bounding volume to be detected, where k is a positive integer; and determines the intersection between the first bounding volume and the bounding volume to be detected based on the projections of the first bounding volume and the bounding volume to be detected on the k separating axes.

[0169] In some implementations, the screen rendering method further includes: when the first bounding volume is a sphere and the bounding volume to be detected is a rectangular parallelepiped, the sub-thread determines a basis vector group of the bounding volume to be detected based on the vertex information of the bounding volume to be detected, and the basis vector group includes a basis vector for representing the side length direction of the bounding volume to be detected; the sub-thread projects the center point on the basis vector based on the coordinate information of the center point of the first bounding volume, and calculates the coordinate information of the target position point in the second bounding volume with the smallest distance from the center point; the sub-thread determines the intersection between the first bounding volume and the bounding volume to be detected based on the coordinate information of the center point, the coordinate information of the target position point and the radius of the first bounding volume.

[0170] For the specific steps of the above two embodiments, please refer to the above embodiments and will not be described in detail here.

[0171] Sub-step 629b: After the multiple sub-threads have respectively determined their own object queues, the object queues of the sub-threads are merged to obtain at least one target virtual object.

[0172] Optionally, the terminal device merges the target virtual objects detected by multiple sub-threads respectively, so as to obtain all target virtual objects affected by the target reflection capture object.

[0173] This method helps to shorten the time spent on determining a target virtual object from a plurality of virtual objects included in the field of view, thereby improving the efficiency of generating a display image.

[0174] In some embodiments, if the target reflection capture object is a mirror reflection object, the geometric information of the target reflection capture object includes the effective direction of mirror reflection, and the effective direction refers to the projection direction of the cube map; the terminal device determines at least one target virtual object from at least one virtual object included in the field of view based on the geometric information of the target reflection capture object, including: the terminal device determines the virtual objects overlapping in the partial scene corresponding to the field of view and the effective direction of mirror reflection as at least one target virtual object, wherein the partial scene is obtained by dividing the virtual scene according to the target reflection capture object.

[0175] The part of the scene corresponding to the effective direction of the specular reflection may refer to a scene corresponding to an area to which the cube map of the target reflection capture object can be projected in the virtual scene.

[0176] Optionally, if a virtual object is both within the field of view and within a portion of the scene corresponding to the effective direction of the mirror reflection, the terminal device determines the virtual object as a target virtual object; if a virtual object is both within the field of view and not within the portion of the scene corresponding to the effective direction of the mirror reflection, the terminal device cannot determine the virtual object as a target virtual object; if a virtual object is not within the field of view and is within the portion of the scene corresponding to the effective direction of the mirror reflection, the terminal device cannot determine the virtual object as a target virtual object; if a virtual object is not within the field of view and is not within the portion of the scene corresponding to the effective direction of the mirror reflection, the terminal device cannot determine the virtual object as a target virtual object. In this way, when the target reflection capture object is a mirror reflection object, the target virtual object can be simply and quickly determined through the field of view and the portion of the scene corresponding to the effective direction of the mirror reflection, thereby effectively improving the efficiency of determining the target virtual object.

[0177] The following describes the re-rendering process of the target virtual object through several embodiments.

[0178] In some embodiments, the terminal device re-renders the target virtual object to generate a re-rendered target virtual object, including: for any target virtual object, generating a rendering instruction of the target virtual object; sending the rendering instruction of the target virtual object to the image processor, and the rendering instruction is used to trigger the image processor to re-render the material on the surface of the target virtual object to generate a re-rendered target virtual object.

[0179] In some embodiments, the terminal device records the determined target virtual object in a status update list and removes the old data recorded in the status update list. Optionally, the status update list includes an object identifier of the target virtual object. Exemplarily, the object identifier is used to uniquely identify the virtual object. The object identifier can be the name, number, icon, etc. of the virtual object, which is not limited in this application; the terminal device then generates rendering instructions corresponding to each target virtual object in the status update list, and re-renders the target virtual object according to the rendering instructions through the graphics processor in the terminal device to obtain each re-rendered target virtual object.

[0180] In some embodiments, the terminal device generates rendering instructions corresponding to the target virtual objects respectively, including: setting the rendering state of the target virtual object according to the attribute information of the target virtual object, and generating rendering instructions corresponding to the rendering state.

[0181] Optionally, the attribute information of the target virtual object is used to characterize the display attributes of the target virtual object. Exemplarily, the attribute information of the target virtual object includes the surface material of the target virtual object, the vertex information of the target virtual object, etc. The rendering state refers to the state to be rendered. Since the process of generating rendering instructions includes a large number of calculation steps, the present application reduces the number of rendering instructions that need to be updated by screening the target virtual object from the virtual objects included in the field of view, and only updating the rendering instructions of the target virtual object. This can effectively reduce the computational overhead in the virtual object rendering process, improve the computer's rendering performance, and help the target application provide a high-quality display screen.

[0182] The following is an example to illustrate the process of generating rendering instructions for a target virtual object.

[0183] The terminal device marks the target virtual object and obtains the object identification of the target virtual object. In the process of generating rendering instructions, the terminal device uses all marked virtual objects as target virtual objects; and records the object identification of the target virtual object in the dynamic update list (PrimitivesNeedingStaticMeshUpdate) of the virtual scene.

[0184] The terminal device will call the visibility calculation function (ComputeViewVisibility) to traverse the dynamic update list (PrimitivesNeedingStaticMeshUpdate), remove the old data in the dynamic update list, and update the attribute information of the target virtual object.

[0185] For each target virtual object, the terminal device regenerates a rendering instruction for the target virtual object based on the attribute information of the target virtual object.

[0186] The terminal device generates a display image within the field of view through the graphics processor according to the rendering instructions of each virtual object.

[0187] The following describes a screen rendering method using an example with reference to FIG9 . The method mainly involves the logic thread and the rendering thread in the terminal device. The method mainly includes the following steps:

[0188] Step A10: When the reflection effect of the reflection capture object changes, reflection capture information is generated through a logic thread, where the logic thread is used to manage logic operations related to the virtual scene.

[0189] Optionally, the reflection capture information includes at least one reflection capture object whose reflection effect changes.

[0190] Step A20: Obtain reflection capture information from the logic thread through the rendering thread according to the access cycle.

[0191] Step A30-1: If the reflection capture object is a mirror reflection object, the virtual objects that overlap with the part of the scene corresponding to the effective direction of the mirror reflection are determined as at least one target virtual object. After this step, step A50 is directly executed.

[0192] Step A30-2: Calculate the first bounding volume of the reflection capture object according to the geometric information of the reflection capture object through the rendering thread.

[0193] Step A40: Determine, by a rendering thread, at least one target virtual object according to the first bounding volume and the second bounding volume corresponding to the at least one virtual object.

[0194] Step A40 mainly includes the following situations:

[0195] 1. The first bounding volume is a bounding box of a rectangular parallelepiped: Based on the vertex information of the first bounding volume, the first normal vector group of the first bounding volume is calculated by the rendering thread; based on the vertex information of the bounding volume to be detected, the second normal vector group of the bounding volume to be detected is determined; the cross product vector between the two normal vectors from the first normal vector group and the second normal vector group is calculated, and the cross product vector refers to the result vector obtained by vector cross multiplication; the first normal vector, the second normal vector and the cross product vector are used as k separating axes between the first bounding volume and the bounding volume to be detected; based on the projections of the first bounding volume and the bounding volume to be detected on the k separating axes, the intersection between the first bounding volume and the bounding volume to be detected is determined.

[0196] 2. The first bounding volume is a sphere: The rendering thread determines the basis vector group of the bounding volume to be detected based on the vertex information of the bounding volume to be detected, where the basis vector group includes basis vectors used to represent the length direction of the side of the bounding volume to be detected; based on the coordinate information of the center point of the first bounding volume, the center point is projected onto the basis vectors, and the coordinate information of the target position point with the smallest distance from the center point in the second bounding volume is calculated; based on the coordinate information of the center point, the coordinate information of the target position point and the radius of the first bounding volume, the intersection between the first bounding volume and the bounding volume to be detected is determined.

[0197] Step A50, for any target virtual object, generate a rendering instruction of the target virtual object; send the rendering instruction of the target virtual object to the image processor, the rendering instruction is used to trigger the image processor to re-render the material on the surface of the target virtual object to generate a re-rendered target virtual object.

[0198] Step A60 : generating a display image of the field of view based on the re-rendered target virtual object and other virtual objects in the field of view except the target virtual object.

[0199] This method reduces the number of drawing instructions that need to be updated, helps improve the rendering performance of the terminal device, and avoids screen freezes. For matters not described in the embodiments of this application, please refer to the above embodiments and will not be repeated here.

[0200] The following describes a screen rendering method using another example. The method is mainly executed by a logic thread and a rendering thread in a terminal device. The rendering thread includes multiple sub-threads. The method mainly includes the following steps (not shown in the figure):

[0201] Step B10: establishing m sub-threads according to the number n of central processing units possessed by the terminal device, where n is a positive integer and m is less than or equal to n.

[0202] Step B20, creating a thread pool, which includes the m sub-threads mentioned above. The thread pool is used to manage the thread cycles of the m sub-threads and deregister the sub-threads after their tasks are completed to avoid a large amount of performance consumption by the sub-threads.

[0203] Step B30: Divide the multiple virtual objects in the field of view into m virtual object subsets. For example, if there are 10,000 virtual objects in the field of view and the thread pool includes 8 threads, each virtual object subset contains 1,250 virtual objects. Optionally, the multiple virtual objects in the field of view can be dynamically divided. Please refer to the above embodiment for details.

[0204] Step B40: When the reflection effect of the reflection capture object changes, reflection capture information is generated through a logic thread, where the logic thread is used to manage logic operations related to the virtual scene.

[0205] Step B50: Acquire reflection capture information from the logical thread through each sub-thread according to the access cycle.

[0206] In step B60, each sub-thread verifies whether the virtual objects in the virtual object subset belong to the target virtual object based on the type of the reflection capture object recorded in the reflection capture information, thereby obtaining an object queue for each sub-thread. For details about this step, please refer to the above embodiment and will not be repeated here.

[0207] Step B70: After the multiple sub-threads have respectively determined their own object queues, the object queues of the sub-threads are merged to obtain at least one target virtual object.

[0208] Step B80, for any target virtual object, generate a rendering instruction for the target virtual object; send the rendering instruction for the target virtual object to the image processor, the rendering instruction is used to trigger the image processor to re-render the material on the surface of the target virtual object to generate a re-rendered target virtual object.

[0209] Step B90 : generating a display image of the field of view based on the re-rendered target virtual object and other virtual objects in the field of view except the target virtual object.

[0210] By executing the target object screening process in parallel through multiple sub-threads, the computing resources in the terminal device can be fully utilized, which helps to improve the verification speed of the target virtual object and shorten the time consumed by introducing this method.

[0211] The application scenarios of the screen rendering method provided in this application include at least one of the following: the generation of game screens in game matches, the generation process of virtual screens in mixed reality applications, the generation of three-dimensional navigation animations in navigation programs, the capture of virtual character motion pictures during animation production, etc. For example, in the generation process of game screens, the virtual scene refers to the virtual environment in the game match, the virtual object refers to the three-dimensional model in the virtual environment, and the display screen refers to the game screen displayed by the terminal device. For another example, in mixed reality applications, the virtual scene refers to a three-dimensional model that needs to be integrated with the real scene, and the display screen is used to display the upper layer of the environment screen captured by the camera from the real world. Optionally, the above-mentioned game screen can be generated by a game engine corresponding to the game application, such as UE (Unreal Engine).

[0212] It should be noted that the above application scenarios are only used to list the uses of the screen rendering method, and do not limit the application scenarios of the screen rendering method provided in this application.

[0213] In some embodiments, the screen rendering method provided by the present application is executed by a server, such as a background server of a target application. For example, the display screen in the embodiment of the present application is generated by the server and displayed by the client. For example, in the case of a target reflection capture object with a changed reflection effect, the server generates a re-rendered target virtual object and generates a display screen of the field of view. The server sends the display screen to the client, and the client displays the display screen. This helps reduce the computing pressure of the terminal device.

[0214] In some embodiments, the embodiments of the present application can greatly reduce the problem of screen freezes caused by the update of reflection capture objects in complex virtual scenes. Taking open world games as an example, in a large world scene including approximately 11,000 virtual objects, the process of controlling the virtual character to run the map will trigger the update of the reflection capture object. Before the technical solution provided by the embodiment of the present application is adopted, the update of the reflection capture object will cause about 1,000 virtual objects within the field of view to be updated. After adopting the technical solution provided by the embodiment of the present application, the number of updated virtual objects is reduced to about 20. This improves the terminal device from occasional freezes of more than 60ms (milliseconds) per frame to a stable frame time of less than 33.3ms per frame, meeting the 30FPS (Frames Per Second) standard.

[0215] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0216] Figure 10 shows a block diagram of a screen rendering device provided by an exemplary embodiment of the present application. This device can be implemented as all or part of a terminal device through software, hardware, or a combination of both. The device 1000 may include an information acquisition module 1010, an object determination module 1020, an object rendering module 1030, and a screen generation module 1040.

[0217] The information acquisition module 1010 is used to acquire reflection capture information of a virtual scene, wherein the reflection capture information includes geometric information of at least one reflection capture object, and the reflection capture object is used to project a cube map representing a reflection effect onto a material surface of a virtual object.

[0218] The object determination module 1020 is used to determine at least one target virtual object from at least one virtual object included in the field of view according to the geometric information of the target reflection capture object when there is a target reflection capture object whose reflection effect changes in the at least one reflection capture object. The target virtual object refers to a virtual object whose surface display effect changes accordingly after the reflection effect of the target reflection capture object changes.

[0219] The object rendering module 1030 is configured to re-render the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes.

[0220] The image generation module 1040 is configured to generate a display image of the field of view according to the re-rendered target virtual object and other virtual objects in the at least one virtual object except the target virtual object.

[0221] In some embodiments, the object determination module 1020 includes: a bounding volume determination unit, which is used to calculate the first bounding volume of the target reflection capture object based on the geometric information of the target reflection capture object, and the first bounding volume refers to the geometric space in which the target reflection capture object is effective in the virtual scene; an object determination unit, which is used to determine the at least one target virtual object based on the second bounding volume corresponding to the first bounding volume and the at least one virtual object, and the second bounding volume refers to the geometric space occupied by the virtual object in the virtual scene.

[0222] In some embodiments, the object determination unit is configured to, for any one of the second bounding volumes corresponding to the at least one virtual object, determine the virtual object corresponding to the bounding volume to be detected as the target virtual object if the bounding volume to be detected intersects with the first bounding volume.

[0223] In some embodiments, the step of determining at least one target virtual object is performed by a rendering thread, which includes multiple sub-threads; the object determination unit is used to: for any one of the multiple sub-threads, calculate the second bounding volume corresponding to each virtual object in the virtual object subset through the sub-thread, the virtual object subset includes m virtual objects in the at least one virtual object, each sub-thread corresponds to one virtual object subset, and m is a positive integer; for the bounding volume to be detected corresponding to the virtual object to be detected in the virtual object subset, if the bounding volume to be detected intersects with the first bounding volume, the virtual object corresponding to the bounding volume to be detected is added to an object queue, and the object queue includes the target virtual object in the virtual object subset; after the multiple sub-threads respectively determine their respective object queues, the object queues of each sub-thread are merged to obtain the at least one target virtual object.

[0224] In some embodiments, the device 1000 further includes: a first determination module, configured to, when the first bounding volume is a cuboid and the bounding volume to be detected is a cuboid, calculate a first normal vector group for the first bounding volume based on vertex information of the first bounding volume, the first normal vector group including a first normal vector perpendicular to the plane of the first bounding volume; determine a second normal vector group for the bounding volume to be detected based on vertex information of the bounding volume to be detected, the second normal vector group including a second normal vector perpendicular to the plane of the bounding volume to be detected; calculate a cross product vector between two normal vectors from the first normal vector group and the second normal vector group, respectively, the cross product vector being a result vector obtained by vector cross multiplication; use the first normal vector, the second normal vector, and the cross product vector as k separating axes between the first bounding volume and the bounding volume to be detected, where k is a positive integer; and determine an intersection between the first bounding volume and the bounding volume to be detected based on projections of the first bounding volume and the bounding volume to be detected on the k separating axes, the intersection being used to indicate whether the first bounding volume intersects with the bounding volume to be detected.

[0225] In some embodiments, the device 1000 also includes: a second judgment module, which is used to determine the basis vector group of the enclosing body to be detected based on the vertex information of the enclosing body to be detected when the first enclosing body is a sphere and the enclosing body to be detected is a rectangular parallelepiped, and the basis vector group includes basis vectors used to characterize the side length direction of the enclosing body to be detected; based on the coordinate information of the center point of the first enclosing body, the center point is projected onto the basis vectors, and the coordinate information of the target position point in the second enclosing body with the smallest distance from the center point is calculated; based on the coordinate information of the center point, the coordinate information of the target position point and the radius of the first enclosing body, determine the intersection between the first enclosing body and the enclosing body to be detected, and the intersection is used to indicate whether the first enclosing body and the enclosing body to be detected intersect.

[0226] In some embodiments, the target reflection capture object is a mirror reflection object, and the geometric information of the target reflection capture object includes the effective direction of mirror reflection, and the effective direction refers to the projection direction of the cube map; the object determination module 1020 is used to determine the virtual objects overlapping in the partial scene corresponding to the field of view range and the effective direction of the mirror reflection as the at least one target virtual object, wherein the partial scene is obtained by dividing the virtual scene according to the target reflection capture object.

[0227] In some embodiments, the information acquisition module 1010 is used to generate the reflection capture information through a logical thread, and the logical thread is used to manage logical operations related to the virtual scene; the reflection capture information is obtained from the logical thread according to an access cycle through a rendering thread, and the rendering thread is used to render and generate a display screen of the field of view.

[0228] In some embodiments, the object rendering module 1030 is used to generate a rendering instruction for any one of the target virtual objects; and send the rendering instruction of the target virtual object to the image processor, where the rendering instruction is used to trigger the image processor to re-render the material on the surface of the target virtual object to generate the re-rendered target virtual object.

[0229] To sum up, when the reflection effect of the reflection capture object changes, the virtual objects affected by the reflection capture object are filtered out from the virtual objects included in the field of view, and only the rendering instructions of these filtered out virtual objects are updated. This can effectively reduce the number of updates of the rendering instructions. This method helps to alleviate the problem of a sudden increase in computing pressure caused by updating the rendering instructions when the reflection effect of the reflection capture object changes, thereby helping to reduce the power consumption of the terminal device.

[0230] In addition, by reducing the number of virtual objects that need to be updated and rendered, the computing pressure on the terminal device to generate the display image when the reflection effect of the reflection capture object changes is reduced, thereby reducing the chance of screen freeze problems. This helps to maintain a stable frame rate for display image updates, thereby helping to improve the rendering performance of the terminal device and maintain the smoothness of the display image during use of the target application.

[0231] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here. For the beneficial effects of the device provided in the above embodiment, please refer to the description of the method side embodiment, which will not be repeated here.

[0232] Figure 11 shows a block diagram of a terminal device provided by an exemplary embodiment of the present application. The terminal device 1100 may be the terminal device described above.

[0233] Typically, the terminal device 1100 includes a processor 1101 and a memory 1102 .

[0234] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 11-core processor, and the like. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0235] The memory 1102 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1102 stores at least one instruction, at least one program, code set, or instruction set, which is loaded and executed by the processor 1101 to implement the above-mentioned screen rendering method.

[0236] Those skilled in the art will understand that the structure shown in FIG11 does not constitute a limitation on the terminal device 1100 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0237] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned image rendering method.

[0238] The computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, DVD (Digital Video Disc) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the above-mentioned ones.

[0239] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor reads and executes the computer program from the computer-readable storage medium to implement the above-mentioned screen rendering method.

[0240] It should be noted that, in the embodiments of the present application, before collecting the relevant data of the user and during the process of collecting the relevant data of the user, a prompt interface, pop-up window or voice prompt information can be displayed. The prompt interface, pop-up window or voice prompt information is used to remind the user that its relevant data is currently being collected, so that the present application only starts to execute the relevant steps of obtaining the relevant data of the user after obtaining the confirmation operation issued by the user on the prompt interface or pop-up window. Otherwise (that is, when the confirmation operation issued by the user on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the relevant data of the user are terminated, that is, the relevant data of the user is not obtained. In other words, all user data collected by this application are processed strictly in accordance with the requirements of relevant national laws and regulations. The informed consent or separate consent of the personal information subject is obtained only when the user agrees and authorizes the collection, and the subsequent data use and processing behavior is carried out within the scope of the authorization of the laws and regulations and the personal information subject. The collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the virtual scenes, virtual objects, display screens, etc. involved in this application are all obtained with full authorization.

[0241] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0242] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switches, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A picture rendering method, the method being executed by a terminal device, the method comprising: Acquire reflection capture information of a virtual scene, wherein the reflection capture information includes geometric information of at least one reflection capture object, and the reflection capture object is used to project a cube map representing a reflection effect onto a material surface of a virtual object; In the case where there is a target reflection capture object whose reflection effect changes in the at least one reflection capture object, determining at least one target virtual object from at least one virtual object included in the field of view according to geometric information of the target reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect changes accordingly after the reflection effect of the target reflection capture object changes; Re-rendering the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes; A display screen of the field of view is generated according to the re-rendered target virtual object and other virtual objects among the at least one virtual object except the target virtual object.

2. The method according to claim 1, wherein: The step of determining at least one target virtual object from at least one virtual object included in a field of view according to the geometric information of the target reflection capturing object comprises: Calculating a first bounding volume of the target reflection capture object according to the geometric information of the target reflection capture object, where the first bounding volume refers to a geometric space in which the target reflection capture object is effective in the virtual scene; The at least one target virtual object is determined according to the first bounding volume and the second bounding volume corresponding to the at least one virtual object respectively, where the second bounding volume refers to a geometric space occupied by the virtual object in the virtual scene.

3. The method according to any one of claims 1 to 2, wherein: The determining the at least one target virtual object according to the first enclosing volume and the second enclosing volume respectively corresponding to the at least one virtual object comprises: For any to-be-detected enclosing volume in the second enclosing volumes respectively corresponding to the at least one virtual object, if the to-be-detected enclosing volume intersects with the first enclosing volume, the virtual object corresponding to the to-be-detected enclosing volume is determined as the target virtual object.

4. The method according to any one of claims 1 to 2, wherein: The step of determining at least one target virtual object is performed by a rendering thread, and the rendering thread includes a plurality of sub-threads; The determining the at least one target virtual object according to the first enclosing volume and the second enclosing volume respectively corresponding to the at least one virtual object comprises: For any one of the multiple sub-threads, calculating, by the sub-thread, second bounding volumes respectively corresponding to each virtual object in a virtual object subset, the virtual object subset including m virtual objects in the at least one virtual object, each of the sub-threads corresponding to one virtual object subset, and m being a positive integer; For a bounding volume to be detected corresponding to a virtual object to be detected in the virtual object subset, if the bounding volume to be detected intersects with the first bounding volume, adding the virtual object corresponding to the bounding volume to be detected to an object queue, wherein the object queue includes a target virtual object in the virtual object subset; After the multiple sub-threads respectively determine their own object queues, the object queues of the sub-threads are merged to obtain the at least one target virtual object.

5. The method according to claim 3 or 4, wherein: Before determining the at least one target virtual object according to the first enclosing volume and the second enclosing volume respectively corresponding to the at least one virtual object, the method further includes: When the first bounding volume is a cuboid and the bounding volume to be detected is a cuboid, a first normal vector group of the first bounding volume is calculated according to vertex information of the first bounding volume, wherein the first normal vector group includes a first normal vector perpendicular to a plane of the first bounding volume; Determine a second normal vector group of the bounding volume to be detected according to the vertex information of the bounding volume to be detected, wherein the second normal vector group includes a second normal vector perpendicular to the plane of the bounding volume to be detected; Calculate a cross product vector between two normal vectors from the first normal vector group and the second normal vector group, where the cross product vector refers to a result vector obtained by vector cross multiplication; Taking the first normal vector, the second normal vector and the cross product vector as k separation axes between the first bounding volume and the bounding volume to be detected, where k is a positive integer; According to the projections of the first enclosing volume and the enclosing volume to be detected on the k separation axes, an intersection condition between the first enclosing volume and the enclosing volume to be detected is determined, wherein the intersection condition is used to indicate whether the first enclosing volume intersects with the enclosing volume to be detected.

6. The method according to claim 3 or 4, wherein: Before determining the at least one target virtual object according to the first enclosing volume and the second enclosing volume respectively corresponding to the at least one virtual object, the method further includes: In the case where the first bounding volume is a sphere and the bounding volume to be detected is a cuboid, determining a basis vector group of the bounding volume to be detected according to vertex information of the bounding volume to be detected, wherein the basis vector group includes basis vectors for representing the length direction of the side of the bounding volume to be detected; According to the coordinate information of the center point of the first bounding volume, the center point is projected onto the basis vector, and the coordinate information of the target position point in the second bounding volume with the smallest distance from the center point is calculated; According to the coordinate information of the center point, the coordinate information of the target position point and the radius of the first enclosing volume, the intersection between the first enclosing volume and the enclosing volume to be detected is determined, and the intersection is used to indicate whether the first enclosing volume intersects with the enclosing volume to be detected.

7. The method according to any one of claims 1 to 6, wherein: The target reflection capture object is a specular reflection object, and the geometric information of the target reflection capture object includes an effective direction for specular reflection, and the effective direction refers to a projection direction of the cube map; The step of determining at least one target virtual object from at least one virtual object included in a field of view according to the geometric information of the target reflection capturing object comprises: The virtual objects overlapped in the partial scene corresponding to the field of view and the effective direction of the mirror reflection are determined as the at least one target virtual object, wherein the partial scene is obtained by dividing the virtual scene according to the target reflection capture object.

8. The method according to any one of claims 1 to 7, wherein: The obtaining of reflection capture information of the virtual scene includes: generating the reflection capture information by a logic thread, wherein the logic thread is used to manage logic operations related to the virtual scene; The reflection capture information is obtained from the logic thread according to an access cycle through a rendering thread, and the rendering thread is used to render and generate a display screen in the field of view.

9. The method according to any one of claims 1 to 8, wherein: The re-rendering of the target virtual object to generate the re-rendered target virtual object includes: For any one of the target virtual objects, generating a rendering instruction of the target virtual object; A rendering instruction of the target virtual object is sent to the image processor, wherein the rendering instruction is used to trigger the image processor to re-render the material on the surface of the target virtual object to generate the re-rendered target virtual object.

10. A picture rendering device, the device comprising: An information acquisition module is used to acquire reflection capture information of a virtual scene, wherein the reflection capture information includes geometric information of at least one reflection capture object, and the reflection capture object is used to project a cube map representing a reflection effect onto a virtual object. The material surface of the body; an object determination module, configured to determine, when there is a target reflection capture object whose reflection effect changes in the at least one reflection capture object, at least one target virtual object from at least one virtual object included in a field of view according to geometric information of the target reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect changes accordingly after the reflection effect of the target reflection capture object changes; An object rendering module, used for re-rendering the target virtual object to generate a re-rendered target virtual object, wherein the texture of the material surface of the re-rendered target virtual object changes; A picture generation module is used to generate a display picture of the field of view according to the re-rendered target virtual object and other virtual objects among the at least one virtual object except the target virtual object.

11. A terminal device, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the picture rendering method according to any one of claims 1 to 9.

12. A computer-readable storage medium, wherein a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the picture rendering method according to any one of claims 1 to 9.

13. A computer program product, comprising a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the picture rendering method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Page rendering method and device

    CN103678631A

  • Panorama-based method influencing virtual object shade and shadow effect

    CN107093204A

  • Display method and device for virtual object in game and electronic terminal

    CN111514581A

  • Virtual object rendering method and device, equipment and storage medium

    CN116485980A

  • Method of construction of a computer-generated image and a virtual environment

    US20200312034A1