Picture rendering method and device, equipment and storage medium
By identifying and re-rendering the target virtual object affected by reflection capture objects in the virtual scene, the problem of waste of computing resources caused by changes in reflection effects in the prior art is solved, and the rendering performance and picture fluency are improved.
Patent Information
- Application Number
- CN202311047351.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
When the reflection effect of reflecting and capturing objects in a virtual scene changes, it is necessary to update the rendering instructions of a large number of virtual objects, resulting in excessive consumption of computing resources and insufficient rendering performance.
By obtaining the reflection capture information of the virtual scene, the target virtual objects affected by the reflection capture object are determined, and only these target virtual objects are re-rendered to generate an updated rendering instruction to generate the next display screen.
Reduces the calculation pressure when the reflection effect of the reflection capture object changes, reduces the power consumption of terminal devices, improves rendering performance, and maintains the smoothness of the display screen.
Smart Images

Figure CN119494910A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and Internet technology, and in particular to a picture rendering method, device, equipment and storage medium. Background Art
[0002] By setting a reflection capture object in a virtual scene, the surface of a virtual object in the virtual scene shows a reflection effect, making the material of the virtual object more realistic.
[0003] In the related technology, when the reflection state of the reflection capture object changes, the terminal device needs to update the rendering instructions 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 to generate the next display screen.
[0004] However, this method requires a lot of computing resources, and the rendering performance of terminal devices needs to be further improved. Summary of the invention
[0005] The present application provides a method, device, equipment and storage medium for rendering a picture. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a screen rendering method is provided, the method comprising:
[0007] Acquire reflection capture information of a virtual scene, the reflection capture information including geometric information of at least one reflection capture object whose reflection effect changes, the reflection capture object being used to project a cube map representing the reflection effect onto a material surface of a virtual object;
[0008] For any one of the reflection capture objects, determining 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 reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the reflection capture object changes;
[0009] 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;
[0010] 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.
[0011] According to one aspect of an embodiment of the present application, a picture rendering device is provided, the device comprising:
[0012] An information acquisition module, 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 whose reflection effect changes, and the reflection capture object is used to project a cube map representing the reflection effect onto a material surface of a virtual object;
[0013] An object determination module, configured to determine, for any one of the reflection capture objects, at least one target virtual object from at least one virtual object included in a field of view according to geometric information of the reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the reflection capture object changes;
[0014] 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;
[0015] 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.
[0016] According to one aspect of an embodiment of the present application, a terminal device is provided, the terminal device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the screen rendering method as described above.
[0017] 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 picture rendering method as described above.
[0018] 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, and a processor reads and executes the computer program from the computer-readable storage medium to implement the screen rendering method as described above.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0020] 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 method helps to reduce the sudden increase in computing pressure caused by the change of the reflection effect of the reflection capture object, and helps to reduce the power consumption of the terminal device.
[0021] Furthermore, by reducing the number of virtual objects that need to be updated and rendered, the computing pressure on the terminal device in the process of generating the display screen is reduced, thereby helping to maintain a stable frame rate for display screen updates, helping to improve the rendering performance of the terminal device, and maintaining the smoothness of the display screen during the use of the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of a solution implementation environment provided by an exemplary embodiment of the present application;
[0023] Figure 2 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;
[0024] Figure 3 is a schematic diagram of an existing screen rendering method provided by an exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a change in computing overhead provided by an exemplary embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of an inventive concept provided by an exemplary embodiment of the present application;
[0027] Figure 6 is a flowchart of a screen rendering method provided by an exemplary embodiment of the present application;
[0028] Figure 7 is a schematic diagram of a reflection effect provided by an exemplary embodiment of the present application;
[0029] Figure 8 is a schematic diagram of a geometric information format provided by an exemplary embodiment of the present application;
[0030] Fig. 9 is a schematic diagram of a screen rendering method provided by an exemplary embodiment of the present application;
[0031] Fig.10 is a block diagram of a picture rendering device provided by an exemplary embodiment of the present application;
[0032] Fig.11 It is a structural block diagram of a terminal device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0034] Before introducing the present application, the background technology involved in the present application is first explained.
[0035] Reflection Capture (RC) refers to the technology used to capture environmental reflection and diffuse reflection during the rendering process. Reflection capture can simulate the reflection and indirect lighting of materials and scenes, which is very helpful in improving the realism and details of the scene.
[0036] Drawcall is used to complete the data transmission and command calling process between the central processing unit (CPU) and the graphics processing unit (GPU). In computer graphics, the process of submitting rendering commands to the graphics processor, each rendering information generated is realized through rendering instructions. Rendering instructions contain all the steps required to render a virtual object, such as model conversion, texture sampling, shader calculation, etc. Optimizing the number of rendering instructions is an important factor in improving application performance.
[0037] Bounding Box (BB) is used to represent the position and size of a virtual object in a virtual scene. The bounding box is usually determined by four values, namely the x and y coordinates of the upper left corner and the width and height of the rectangle.
[0038] Axis Aligned Bounding Box (AABB) refers to a border or bounding box consisting of 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).
[0039] A virtual scene refers to a three-dimensional space designed to realize 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.
[0040] A virtual camera (VC) refers to an object that is set in a virtual scene and has the ability to observe virtual objects in the virtual scene. The virtual camera can follow the virtual character moving in the virtual scene. Optionally, the setting position of the virtual camera in the virtual scene is independent of the virtual character, that is, when the virtual character moves in the virtual scene, the setting position of the virtual camera does not move with the movement of the virtual character. Optionally, the virtual camera is placed in the virtual scene, such as the virtual camera is placed on the surface of a virtual object that the virtual character cannot reach. For example, the virtual camera is set on the surface of a virtual building in the virtual scene.
[0041] 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.
[0042] Occlusion Query (OC) is used to determine which virtual objects in a virtual scene are visible and which virtual objects are occluded.
[0043] Figure 1 1 is a schematic diagram of a solution implementation environment provided by an exemplary embodiment of the present application. The solution implementation environment can be implemented as a computer system, such as a game application system. The solution implementation environment can include: a terminal device 10 and a server 20.
[0044] 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, a vehicle terminal, a virtual reality (VR), an augmented reality (AR) device, an extended reality (ExtendedReality), a mixed reality (MR), etc. In one example, a target application is running in the terminal device 10, and the target application may be a game application, and other applications that can provide display images of virtual scenes, such as virtual reality applications, augmented reality applications, three-dimensional map applications, social applications, interactive entertainment applications, etc., which are not limited in the embodiments of the present application.
[0045] In some embodiments, game applications include but are not limited to: First Person Shooting (FPS) games, Adventure Games (ATG), Action Games (ACT), Multiplayer Online Battle Arena (MOBA) and Simulation Games (SLG), etc.
[0046] For example, the target application is a game application, and the game of the target application is completed in a virtual scene, and virtual objects are set in the virtual scene; wherein 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 to obtain a display screen of the field of view.
[0047] In order to achieve an immersive effect, the surface texture of the virtual object needs to be rendered such as reflection to make the material of the virtual object more realistic.
[0048] The server 20 can provide background services for the target application running on the terminal device 10. For example, the server 20 can be a background server of the target application, and the server 20 can provide services for the terminal device.
[0049] The server 20 may be an independent physical server, or 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. The server 20 has at least data transmission, storage, and computing functions.
[0050] In some embodiments, the server 20 provides the terminal device 10 with data such as a game installation package and a game patch package. The terminal device 10 downloads data related to the target application from the server 20. After the target application is installed, the terminal device 10 runs the target application to start the game. During the game, the terminal device 10 renders virtual objects in the virtual scene, generates and displays a display screen within the viewing angle range.
[0051] The imaging principle of virtual objects in the viewing angle range is introduced below.
[0052] The camera model refers to a computational model used in computer vision to convert a 3D virtual object into a 2D image. 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.
[0053] 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 in the three-dimensional space through the model transformation matrix. 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 taking the position of the camera model as the coordinate origin; the three-dimensional model in the camera space coordinate system is transformed into the clip space coordinate system through the projection matrix. The clip space coordinate system is used to describe the projection of the three-dimensional model in the view 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 big and far 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.
[0054] Figure 2 It 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.
[0055] Combination Figure 2 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) is shown. 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. The imaging plane 204 and the camera plane 202 are parallel to each other. The imaging plane 204 is located within the field of view when observing the virtual scene.
[0056] Figure 3 It is a schematic diagram of an existing screen rendering method provided by an exemplary embodiment of the present application.
[0057] In the related technology, when the reflection effect of the reflection capture object in the virtual scene changes, the terminal device will generate rendering instructions corresponding to all virtual objects in the virtual scene. In this way, it is ensured that the texture of the material surface of each virtual object can change synchronously with the change of the reflection capture object, improve the realism of the display screen in the generated field of view, and realize the correct drawing of the virtual scene.
[0058] However, in order to ensure the correct drawing of the virtual scene, this method requires a large number of rendering instructions to be updated. If the reflection capture object changes in a complex scene, a large number of rendering instructions need to be updated, causing the display screen to freeze. Especially in open world games, the "big world" brings more complex virtual scenes, and the "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 effect of the reflection capture object, resulting in a significant increase in the computing overhead of the terminal device.
[0059] Figure 4 It is a schematic diagram of the change of computing overhead provided by an exemplary embodiment of the present application.
[0060] After the reflection capture object changes, the terminal device needs to update the rendering instructions of a large number of virtual objects, and the computing overhead increases suddenly, which can easily lead to unstable frame rate of the displayed image, or even excessively choppy display or jamming.
[0061] Figure 5 It is a schematic diagram of the inventive concept provided by an exemplary embodiment of the present application.
[0062] When the reflection capture object changes, first, the terminal device determines the virtual objects within the influence range of the reflection capture object. Specifically, 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 as the reflection capture object changes, and it is necessary to regenerate rendering instructions for the virtual object.
[0063] Before triggering the rendering process by recording the changed reflection capture object, the rendering instructions of some virtual objects are selectively updated according to whether each virtual object in the field of view will be affected by the reflection capture object.
[0064] This method can effectively reduce the number of rendering instructions that need to be generated without consuming a lot of computing overhead, which helps to reduce the computing overhead in the process of rendering and generating display images, reduces the time spent on generating display images, and improves the smoothness of display image playback.
[0065] Figure 6 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 Figure 1 The terminal device 10 in the implementation environment of the solution, for example, the execution subject can be the client of the target application running on the terminal device 10. Figure 2As shown, the method may include the following steps (610-640):
[0066] Step 610, obtaining reflection capture information of the virtual scene, the reflection capture information including geometric information of at least one reflection capture object whose reflection effect changes, the reflection capture object is used to project a cube map representing the reflection effect onto the material surface of the virtual object.
[0067] A virtual scene refers to a digital scene drawn by a computer through digital communication technology. A virtual scene can be understood as a digital three-dimensional space, and the display screen of the target application comes from the virtual scene.
[0068] In some embodiments, the virtual scene includes virtual objects and functional objects; wherein the virtual objects refer to visible objects in the virtual scene, and the functional objects refer to objects set in the virtual scene for realizing independent functions. In some cases, the functional objects are not visible in the virtual scene, that is, the functional objects are not displayed in the display screen, and the functional objects may have an influence range in the virtual environment, and the influence range of the functional objects is preset.
[0069] Optionally, the virtual objects include: virtual characters controlled by the terminal device, virtual props and buildings that cannot be controlled by the terminal device. Virtual objects can be fixed at a certain position in the virtual scene, or they can move in the virtual scene. That is, virtual objects can be understood as any existence in the virtual scene that can appear in the display screen.
[0070] In order to distinguish the display effects of different virtual objects, the virtual objects have material attributes, and the materials of the virtual objects are used to simulate the real objects corresponding to the virtual objects. Optionally, the material attributes of the virtual objects are reflected by the cube map of the material surface. The terminal device merges the cube map into the material surface of the virtual object so that the surface texture of the virtual object is close to the display effect of the real object. Exemplarily, the cube map refers to a texture map organized in a cube structure and mapped by a combination of multiple textures. Optionally, the cube map includes 6 two-dimensional maps, which are respectively used to characterize the surface textures of the upper, lower, 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 according to the position of the virtual object in the virtual scene.
[0071] In some embodiments, the reflection capture object is used to provide a cube map for a virtual object having a reflection property. Optionally, the cube map provided by the reflection capture object is 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.
[0072] That is, the reflection capture object is used to project the cube map captured from the virtual scene onto a surface with a reflective material, so as to achieve the effect that the surface of the virtual object reflects the scenery in the first area of the virtual scene. Exemplarily, the reflection capture object includes a probe, which is used to observe the first area in the virtual scene from a first observation angle to obtain the cube map 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 this application does not limit them here.
[0073] Optionally, the reflection capture object has an influence range, and the influence range of the reflection capture object refers to the effective range of the reflection capture. The influence range of the reflection capture object is part of the three-dimensional space in the virtual scene. The geometric shape of the influence range of the reflection capture object includes but is not limited to at least one of the following: a bounding box (Box), a sphere (Sphere), and a mirror (Planar). The influence ranges of different reflection capture objects are not exactly the same.
[0074] The surface of the virtual object within the influence range of the reflection capture object needs to map the cube map provided by the reflection capture object, and the surface of the virtual object outside the influence range of the reflection capture object does not need to map the cube map provided by the reflection capture object.
[0075] Figure 7 It is a schematic diagram of the reflection effect provided by an exemplary embodiment of the present application.
[0076] like Figure 7 As shown, the reflection capturing object enables the surface texture of the virtual object to have a reflection effect, and the surface texture of the virtual object 710 (river) in the virtual scene includes a first area 720 from the virtual scene.
[0077] 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 so that the reflection capture object is ineffective.
[0078] Optionally, the change in reflection effect refers to a change in the reflection effect of the reflection capture object, and the change in effect includes: switching from reflection failure to reflection validity, and switching from reflection validity to reflection failure.
[0079] Exemplarily, the timing of the change in the reflection effect of the reflection capture object is related to the behavior of the virtual character controlled by the terminal device in the virtual scene. For example, after the coordinates of the virtual character move to the influence range of a certain reflection capture object, the terminal device loads 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 greater than a threshold, the terminal device unloads the reflection capture object, and the threshold can be any positive real number.
[0080] Exemplarily, the timing of the change in the reflection effect of the reflection capture object is preset. For example, the target application is preset to unload a certain reflection capture object at a first moment, and the terminal device unloads the reflection capture object at the first moment. For another example, the target application is preset to load a certain reflection capture object at a second moment, and the terminal device loads the reflection capture object at the first moment. The first moment and the second moment are any moments in the running process of the target application.
[0081] In some embodiments, the reflection capture information is used to represent information related to the reflection capture object whose reflection effect has 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.
[0082] Exemplarily, in the target application, the logic thread responsible for managing the execution logic of the virtual scene records the reflection capture information when detecting the loading or unloading of the reflection capture information. If the reflection effects of multiple reflection capture objects change at a certain moment, the logic thread records the geometric information of the multiple reflection capture objects to obtain the reflection capture information.
[0083] Optionally, the logic thread records the reflection capture information in a first array, and each array unit of the first array includes geometric information of a reflection capture object whose reflection effect has changed and an object identifier of the reflection capture object.
[0084] Step 620, for any reflection capture object, 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 reflection capture object. The target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the reflection capture object changes.
[0085] In some embodiments, any reflection capture object refers to a reflection object whose reflection effect changes in the virtual scene. The geometric information of any reflection capture object is obtained by acquiring the reflection capture information in step 610. Optionally, the reflection capture information includes the geometric information of the reflection capture object.
[0086] In some embodiments, the field of view is used to characterize 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, and 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 cone with the imaging center of the virtual camera as the vertex.
[0087] Optionally, the field of view changes as the virtual camera moves, so the field of view at different moments is different, and the virtual characters included in the field of view also change at different moments. For example, at the kth moment, the field of view includes virtual object 1, virtual object 2, and virtual object 3, and at the k+1th moment, the field of view includes virtual object 3 and virtual object 4, where k is a positive integer.
[0088] Exemplarily, the types of field of view include: field of view under the first-person perspective, and field of view under the third-person 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 screen observed by the virtual character. Optionally, 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 still, and the shooting direction of the virtual camera is the same as the line of sight of the virtual character. The shooting range of the virtual scene by the virtual camera is the field of view.
[0089] In the display screen obtained by observing the virtual scene in the field of view of the first-person perspective, no virtual character will appear, or only part of the virtual character will appear (for example, only the hand image of the virtual character will appear in the virtual screen, but not the face image of the virtual character, etc.). 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.
[0090] The third-person perspective refers to the perspective obtained by following the virtual character to observe the virtual scene. In some embodiments, the virtual character can be observed in the third-person perspective. The third-person perspective can be understood as setting a virtual camera at a first distance from the virtual character, and the virtual camera and the first virtual character remain relatively still. It should be noted that the method for setting the field of view is set according to actual needs, and this application does not limit it here.
[0091] In some embodiments, the target virtual object refers to: a virtual object within the influence range of the reflection capture object among the virtual objects included in the field of view, and the surface material of the target virtual object has a reflection property, for example, the surface material of the target virtual object is a water surface material, a glass material, a metal plane material, etc.
[0092] 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; for any one of the at least one reflection capture objects, the terminal device determines the target virtual object within the influence range of the 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 reflection capture object.
[0093] Optionally, after the reflection effect of the reflection capture object changes, the texture of the material surface of the target virtual object needs to change synchronously. For example, after a terminal device loads a certain reflection capture object, the surface texture of the target virtual object of the reflection capture object needs to display the cube map provided by the reflection capture object. For another example, after a terminal device uninstalls a certain reflection capture object, the surface texture of the target virtual object corresponding to the reflection capture object should not have the cube map provided by the reflection capture object.
[0094] Therefore, 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.
[0095] 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 and obtains reflection capture information from the logic thread; the rendering thread determines at least one reflection capture object whose reflection effect has changed according to the reflection capture information, and determines the target virtual object included in each reflection capture object. For the specific content of the method for determining the target virtual object, please refer to the following embodiment.
[0096] Step 630 , 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.
[0097] In some embodiments, the terminal device re-renders the target virtual object to generate a target virtual object with a changed material surface texture. For virtual objects other than the target virtual object in the field of view, the terminal device also renders these virtual objects, and the surface textures of these virtual objects after rendering will not change due to the influence of the reflection capture object.
[0098] 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; the terminal device performs the rendering process according to the rendering instructions of the target virtual object and the unupdated rendering instructions of other virtual objects.
[0099] Exemplarily, in the process of generating a certain display screen, the rendering instructions of each virtual object included in the field of view need to be used. 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 (it 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.
[0100] Step 640 : Generate a display screen 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.
[0101] 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. The present application does not limit the type of the display screen.
[0102] In one example, the target application is a game application, and the virtual scene is used to provide a game screen. The terminal device controls the movement of the virtual character 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 geometric information of the reflection capture object A and generates reflection capture information; the terminal device 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 based on the geometric information of the reflection capture object A; 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.
[0103] To summarize, 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 method helps to reduce the sudden increase in computing pressure caused by the change in the reflection effect of the reflection capture object, and helps to reduce the power consumption of the terminal device.
[0104] Furthermore, by reducing the number of virtual objects that need to be updated and rendered, the computing pressure of the terminal device in the process of generating the display screen is reduced. Therefore, it helps to improve the rendering performance of the terminal device, helps to keep the update frame rate of the display screen stable, and maintains the smoothness of the display screen during the use of the target application.
[0105] The following describes a method for obtaining reflection capture information through several embodiments.
[0106] In some embodiments, step 610, obtaining reflection capture information of a virtual scene, may include the following sub-steps:
[0107] Sub-step 613, when the reflection effect of the reflection capture object changes, the terminal device generates reflection capture information through a logical thread, and the logical thread is used to manage logical operations related to the virtual scene.
[0108] In some embodiments, the reflection effect of the reflection capture object needs to be changed by calling the effect change function; after receiving the call to the effect change function, the logic thread determines 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 reflection capture information according to the geometric information of the reflection capture object; wherein the reflection capture information includes the geometric information of all reflection capture objects whose reflection effects have changed in the next frame display. Optionally, in the case where the target application is a game application, the logic thread is also called a game thread.
[0109] Figure 8 The figure is a schematic diagram of the geometric information format of an exemplary embodiment of the present application. The geometric information includes the influence range type of the reflection capture object and the position information of the influence range in the virtual scene.
[0110] 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.
[0111] In some embodiments, the access period is related to the frame rate of the display picture, wherein the frame rate refers to the number of display pictures per unit time. Exemplarily, the access period is equal to the inverse of the frame rate of the display picture.
[0112] Optionally, the rendering thread determines whether the reflection effect of each reflection capture object included in the virtual scene changes every access cycle; if the reflection effect of at least one reflection capture object in the virtual scene changes, the rendering thread obtains the reflection capture information from the logical thread; if the reflection effect of at least one reflection capture object in the virtual scene does not change, there is no need to execute the step of determining the target virtual object in the field of view.
[0113] Exemplarily, the rendering thread determines whether there is a reflection capture object whose reflection effect has changed by accessing the storage address where the logic thread stores the reflection capture information. If the storage address is empty, the rendering thread determines that there is no reflection capture object whose reflection effect has changed; if the storage address is not empty, the rendering thread determines that there is a reflection capture object whose reflection effect has changed. In this case, the rendering thread reads the reflection capture information from the storage address.
[0114] In some embodiments, since the terminal device needs to generate display images at different times according to the frame rate, the rendering thread needs 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 emission 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 reflection capture information from the logic thread and determines at least one target virtual object based on the reflection capture information.
[0115] Through the above method, performing optimization steps such as frustum clipping before determining the target object helps reduce the number of virtual objects that need to be verified whether they are affected by the reflection capture object, helps reduce the computational overhead of the rendering thread in determining the target virtual object, and improves the rendering performance of the terminal device.
[0116] The following describes a method for determining a target virtual object through several embodiments.
[0117] As can be seen from the above content, the terminal device determines at least one target virtual object from at least one virtual object included in the field of view according to the influence range of the reflection capture object. Specifically, the virtual object within the influence range of the reflection capture object needs to be determined as the target virtual object, and the virtual object outside the influence range of the reflection capture object cannot be determined as the target virtual object. The method for determining the positional relationship between the virtual object and the influence range of the reflection capture object is as follows.
[0118] In some embodiments, step 620, determining 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 reflection capture object, may also include the following sub-steps (not shown in the drawings of the specification):
[0119] Sub-step 623a, calculating the first bounding volume of the reflection capture object according to the geometric information of the reflection capture object, where the first bounding volume refers to the geometric space in which the reflection capture object is effective in the virtual scene.
[0120] In some embodiments, the first bounding volume is used to characterize the influence range of the reflection capture object in the virtual scene. In some cases, the influence range of the reflection capture object in the virtual scene is a closed geometric body. Optionally, the types of the first bounding volume include: a cuboid bounding box, a sphere.
[0121] Exemplarily, if the influence range of the reflection capture object is a bounding box of a rectangular parallelepiped, 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 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. 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.
[0122] Sub-step 626a, determining 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, wherein the second bounding volume refers to the geometric space occupied by the virtual object in the virtual scene.
[0123] In some embodiments, the second bounding volume is used to represent the position of the virtual object in the virtual scene. Optionally, the second bounding volume is a bounding box of a cuboid.
[0124] Optionally, if the virtual object is an immovable virtual object, the second enclosing volume of the virtual object is pre-set, and the terminal device directly reads the coordinate information of the second enclosing volume of the virtual object from the storage space. If the virtual object is a movable virtual object, it means that the position of the second enclosing volume of the virtual object in the virtual scene will change, and the terminal device calculates the coordinate information of the second enclosing volume in the virtual scene based on the initial coordinate information of the second enclosing volume and the movement information of the virtual object; wherein 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 characterize the movement of the virtual object in the virtual scene.
[0125] 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, the virtual object is determined as 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, the virtual object is not determined as 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.
[0126] 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.
[0127] The following describes a method for determining whether bounding volumes intersect through several embodiments.
[0128] 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.
[0129] Optionally, the rendering thread sequentially determines whether the second bounding volume corresponding to at least one virtual object intersects with the first bounding volume, and the bounding volume to be detected refers to the second bounding volume that has not been determined to overlap with the first bounding volume. Exemplarily, the terminal device determines one by one whether the 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.
[0130] In some embodiments, the method for determining whether the bounding volume to be detected intersects with the first bounding volume is related to the shape of the first bounding volume (that is, the shape of the influence range of the reflection capture object). From the above content, it can be seen that if the influence range of the reflection capture object represents a closed space, the first bounding volume is a rectangular bounding box or a sphere. The following two examples are used to introduce the method of determining the first bounding volume and the second bounding volume when the first bounding volume belongs to the bounding box of the rectangular parallelepiped and the first bounding volume belongs to the first bounding volume sphere.
[0131] Example 1: The first bounding volume is a bounding box of a rectangular parallelepiped.
[0132] In some embodiments, the screen rendering method also includes: when the first enclosing volume is a rectangular parallelepiped and the enclosing volume to be detected is a rectangular parallelepiped, the terminal device calculates a first normal vector group for the first enclosing volume based on the vertex information of the first enclosing volume, the first normal vector group includes a first normal vector perpendicular to the plane of the first enclosing volume; the terminal device determines a second normal vector group for the enclosing volume to be detected based on the vertex information of the enclosing volume to be detected, the second normal vector group includes a second normal vector perpendicular to the plane of the enclosing 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, 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 separation axes between the first enclosing volume and the enclosing volume to be detected, k is a positive integer; 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 the k separation axes.
[0133] In some embodiments, the vertex information of the first enclosing volume is determined according to the geometric information of the reflection capture object. Optionally, the geometric information of the reflection capture object includes the coordinate information of the center point of the first enclosing volume and the side lengths of each point of the first enclosing volume. The terminal device calculates the coordinate information of the 8 vertices of the first enclosing volume according to the coordinate information of the center point of the first enclosing volume and the side lengths of each point of the first enclosing volume. Exemplarily, the 8 vertices are A1, A2, A3, A4, A5, A6, A7, and A8.
[0134] 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 direction of the side length 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.
[0135] Optionally, from the basic geometric relationship, it can be known that the cuboid includes 6 surfaces, among which there are 3 groups of mutually parallel surfaces, and the normal vectors of the mutually parallel surfaces are the same. That is, the cuboid has three non-parallel normal vectors, which are respectively denoted as NA1, NA2 and NA3. The cuboid has side lengths in 3 directions, that is, it has 3 basis vectors. For any of the 3 basis vectors, the basis vector can be calculated based on the difference in coordinates of the two vertices on the side length corresponding to the basis vector of the cuboid. The basis vectors in the 3 directions can be respectively denoted as U1, V1, and W1.
[0136] Exemplarily, the first normal vector group includes three normal vectors in different directions: NA1, NA2 and NA3, which can be calculated by the following formulas respectively: NA1=U1×V1, NA2=W1×V1, NA3=W1×U1.
[0137] The calculation method of the second normal vector group is the same as that of 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, and the three basis vectors U2, V2, and W2 of the second bounding volume can be calculated through the eight vertices of the second bounding volume. The terminal device performs cross multiplication on any two basis vectors of the three basis vectors of the second bounding volume to obtain the three normal vectors of the second bounding volume: NB1, NB2, and NB3; among which, NB1 = U2 × V2, NB2 = W2 × V2, and NB3 = W2 × U2. That is, the second normal vector group includes three normal vectors in different directions: NB1, NB2, and NB3.
[0138] After calculating the first normal vector group and the second normal vector group, the terminal device calculates the separation axis according to each normal vector verified by the first normal vector group and the second normal vector group. Optionally, the separation axis includes 2 types. Among them, the first type of separation 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 separation axis. The second type of separation axis is calculated by two normal vectors in the first normal vector group and the second normal vector group.
[0139] Exemplarily, the separation axes in the second type of separation axes can be recorded 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, 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, N33.
[0140] 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 separation axis among 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.
[0141] Optionally, if there is a first separation axis, and the first projection line and the second projection line on the first separation axis do not overlap, the terminal device determines that the enclosing volume to be detected does not intersect with the first enclosing volume; if on k separation axes, the first projection line and the second projection line overlap, the terminal device determines that the enclosing volume to be detected intersects with the first enclosing volume.
[0142] 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 separation axes, the terminal device determines whether there is a first separation axis among the k separation axes, and the first separation axis refers to a separation axis on which the first projection line and the second projection line do not overlap. If a separation axis belongs to the first separation axis, the terminal device stops verifying other separation axes and determines that the first enclosing volume and the enclosing volume to be verified do not intersect. If the first separation axis does not exist, the terminal device continues to verify whether other separation axes are the first separation axes until the verification process of the k separation axes is completed. If the first separation axis is not included in the k separation axes, the terminal device determines that the first enclosing volume and the enclosing volume to be detected intersect.
[0143] Example 2: The first bounding volume belongs to a sphere.
[0144] 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 vertex information of the enclosing volume to be detected, the basis vector group including basis vectors for characterizing the direction of the side length of the enclosing volume to be detected; based on the coordinate information of the center point of the first enclosing volume, projecting the center point on the basis vector, 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.
[0145] 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.
[0146] 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 that is the shortest 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 that is the shortest distance from the center point, and the line connecting the basis vector and the target position point is perpendicular to the basis vector.
[0147] Subsequently, the terminal device calculates the distance between the target location point and the center point based on the coordinate information of the target location 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 location point and the center point and the radius of the first enclosing volume.
[0148] Optionally, if the radius of the first enclosing volume and the distance between the target position point and the center point are greater than the radius of the first enclosing volume, the terminal device determines that the first enclosing volume and the second enclosing volume do not intersect; if the radius of the first enclosing volume and the distance between the target position point and the center point are less than or equal to the radius of the first enclosing volume, the terminal device determines that the first enclosing volume and the second enclosing volume intersect.
[0149] When the visual field of the virtual scene includes a large number of virtual objects, it takes a certain amount of time for the terminal device to determine the target virtual object. In order to improve the efficiency of the terminal device in determining the target virtual object and shorten the time spent in determining the target virtual object, the steps of determining the target virtual object in parallel are introduced and explained through several embodiments.
[0150] In some embodiments, the step of determining at least one target virtual object by the terminal device is performed by a rendering thread, and the rendering thread includes multiple sub-threads; step 620, determining at least one target virtual object according to the first enclosing volume and the second enclosing volume corresponding to the at least one virtual object, includes the following sub-steps:
[0151] Sub-step 623b: For any one of the multiple sub-threads, the sub-thread is used to calculate second bounding volumes corresponding to respective virtual objects in a virtual object subset, wherein the virtual object subset includes some virtual objects in the at least one virtual object.
[0152] 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, and each sub-thread has independent computing resources and storage resources, that is, the execution logics of each sub-thread do not interfere with each other.
[0153] Optionally, the number of sub-threads created by the terminal device is related to 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 screens virtual objects in the field of view through the n sub-threads to determine at least one target virtual object.
[0154] When the visual field 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. That is, the value of m is less than or equal to the number of virtual objects included in the visual field.
[0155] 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 no virtual object needs to be checked once, which helps to save computing resources of the terminal device.
[0156] In some embodiments, the terminal device statically divides multiple virtual objects in the field of view to obtain m virtual object subsets. Optionally, the maximum difference in the number of virtual objects included in any virtual object subset of the m virtual object subsets does not exceed t, where t is a natural number.
[0157] Exemplarily, the field of view at a certain moment includes p virtual objects. The terminal device evenly divides the p virtual objects to obtain m virtual object subsets, and allocates the m virtual object subsets to m sub-threads respectively, so that each sub-thread detects whether there is a target object from its own allocated virtual object subset.
[0158] If p is divisible by m, the number of virtual objects included in any virtual object subset in each virtual object subset is p / m; if p is not divisible by m, the m virtual object subsets include (m-1) virtual object subsets, and the (m-1) virtual object subsets each include p / m virtual objects, and the virtual object subsets other than the (m-1) virtual object subsets include p%m virtual objects, where % is a remainder operation. This division method can relatively simply divide the multiple virtual objects included in the field of view into virtual object subsets corresponding to each sub-thread.
[0159] In some embodiments, the terminal device dynamically divides multiple virtual objects in the field of view to obtain m virtual object subsets.
[0160] Optionally, the terminal device divides the multiple virtual objects into multiple static subsets and a dynamic subset; wherein, any two static subsets do not include the same virtual object, and any static subset and dynamic subset do not include the same virtual object. Optionally, the number of static subsets is equal to the number of subthreads created by the terminal device, and the number of virtual objects included in each static subset is the same. Optionally, the static subset includes at least one virtual object.
[0161] Exemplarily, the field of view at a certain moment includes p virtual objects, the terminal device selects q virtual objects from the p virtual objects, the dynamic subset includes the q virtual objects, the terminal device divides the remaining (pq) virtual objects into m static subsets, and assigns the m static subsets to m sub-threads, 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 configures m static subsets to m subthreads respectively. If the first subthread among the m subthreads completes the verification process of each virtual object included in the first static subset at time t1, and there is at least a second subthread among the m subthreads that has not completed the verification process of each virtual object included in the second static subset, then 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; wherein the first subthread and the second subthread are both subthreads among the m subthreads, the first static subset refers to the static subset assigned to the first subthread, and the second subset refers to the static subset assigned to the second subthread; if the first virtual object belongs to the target object, then the first subthread adds the first virtual object to the object queue of the first subthread. For the specific content of the object queue, please refer to the following embodiment. When the m subthreads have completed the verification process of each virtual object in the corresponding static subset, and the dynamic subset does not include the virtual object, the above m subthreads complete the verification process of the virtual objects included in the field of view.
[0162] From the above content, it can be seen that when the shape of the first bounding volume of the reflection capture object is different, the algorithm for verifying whether the first bounding volume and the bounding volume to be verified intersect is different. That is, for different virtual objects, the calculation time of calculating whether the second bounding volume of the virtual object intersects with the first bounding volume is different. By dynamically dividing the multiple virtual objects included in the field of view, the time difference between the multiple sub-threads completing the verification process of the virtual objects they are responsible for can be reduced, avoiding the situation where most of the multiple sub-threads complete the inspection process of the virtual object, but need to wait for a few sub-threads to complete the inspection process of the virtual object, which helps to further speed up the speed of determining the target virtual object and reduce the rendering time caused by introducing this method.
[0163] 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.
[0164] The method by which each sub-thread determines whether the first enclosing volume and the second enclosing volume intersect is related to the shape of the first enclosing volume. In some embodiments, the screen rendering method further includes: when the first enclosing volume is a cuboid and the enclosing volume to be detected is a cuboid, the sub-thread calculates the first normal vector group of the first enclosing volume according to the vertex information of the first enclosing volume, and the first normal vector group includes a first normal vector perpendicular to the plane of the first enclosing volume; the sub-thread determines the second normal vector group of the enclosing volume to be detected according to the vertex information of the enclosing volume to be detected, and the second normal vector group includes a second normal vector perpendicular to the plane of the enclosing volume to be detected; the sub-thread calculates the 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 the 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 separation axes between the first enclosing volume and the enclosing volume to be detected, where k is a positive integer; and determines the intersection between the first enclosing volume and the enclosing volume to be detected according to the projections of the first enclosing volume and the enclosing volume to be detected on the k separation axes.
[0165] In some implementations, the screen rendering method also 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 vertex information of the bounding volume to be detected, the basis vector group includes basis vectors for characterizing the direction of the side length 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.
[0166] For the specific steps of the above two embodiments, please refer to the above embodiments, which will not be described in detail here.
[0167] 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.
[0168] Optionally, the terminal device merges the target virtual objects detected by each of the multiple sub-threads to obtain all target virtual objects affected by the reflection capture object.
[0169] This method helps to shorten the time spent in determining a target virtual object from a plurality of virtual objects within a field of view, thereby improving the efficiency of generating a display image.
[0170] In some embodiments, the reflection capture object is a mirror reflection object, and the geometric information of the reflection capture object includes an effective direction for mirror reflection, where 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 according to the geometric information of the reflection capture object, including: the terminal device determines the virtual objects overlapping with the partial scene corresponding to the field of view and the effective direction of the mirror reflection as at least one target virtual object, wherein the partial scene is obtained by dividing the virtual scene according to the reflection capture object.
[0171] Optionally, if a virtual object is both in the field of view and in a partial scene corresponding to the effective direction of mirror reflection, the terminal device determines the virtual object as a target virtual object; if a virtual object is both in the field of view and not in the partial scene corresponding to the effective direction of mirror reflection, the terminal device cannot determine the virtual object as a target virtual object; if a virtual object is in the field of view and in a partial scene corresponding to the effective direction of mirror reflection, the terminal device cannot determine the virtual object as a target virtual object; if a virtual object is not in the field of view and is not in the partial scene corresponding to the effective direction of mirror reflection, the terminal device cannot determine the virtual object as a target virtual object.
[0172] The following describes the re-rendering process of the target virtual object through several embodiments.
[0173] 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, the rendering instruction is used to instruct the image processor to render the target virtual object; sending the rendering instruction of the target virtual object to the image processor; and re-rendering the material on the surface of the target virtual object by the image processor to generate a re-rendered target virtual object.
[0174] 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 included 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.
[0175] In some embodiments, the terminal device generates rendering instructions corresponding to the target virtual objects, including: according to the attribute information of the target virtual object, setting the rendering state of the target virtual object, and generating rendering instructions corresponding to the rendering state. 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. 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 generated by screening the target virtual object from the virtual objects included in the field of view, which can effectively reduce the computational overhead in the process of rendering virtual objects, improve the rendering performance of the computer, and help the target application to provide a high-quality display screen.
[0176] The following is an example to illustrate the process of generating rendering instructions for a target virtual object.
[0177] The terminal device marks the target virtual object. When generating rendering instructions, the terminal device uses all marked virtual objects as target virtual objects. The object identifier of the target virtual object is recorded in the dynamic update list (PrimitivesNeedingStaticMeshUpdate) of the virtual scene.
[0178] 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.
[0179] The terminal device uses the attribute information of the target virtual object to regenerate rendering instructions for each target virtual object.
[0180] The terminal device generates a display screen within the field of view through a graphics processor according to the rendering instructions of each virtual object.
[0181] Combine the following Fig. 9 , an example is used to introduce the screen rendering method. The method is mainly participated by the logic thread and the rendering thread in the terminal device. The method mainly includes the following steps:
[0182] Step A10, when the reflection effect of the reflection capture object changes, the reflection capture information is generated through the logic thread, and the logic thread is used to manage the logic operations related to the virtual scene.
[0183] Step A20, obtaining reflection capture information from the logic thread according to the access cycle through the rendering thread.
[0184] Step A30-1, when the reflection capture object is a mirror, the virtual objects overlapped in the partial scene corresponding to the effective direction of the mirror reflection are determined as at least one target virtual object. After this step is executed, step A50 is directly executed.
[0185] Step A30-2, calculating the first bounding volume of the reflection capture object according to the geometric information of the reflection capture object through the rendering thread.
[0186] Step A40: determining at least one target virtual object through a rendering thread according to the first bounding volume and the second bounding volume corresponding to the at least one virtual object.
[0187] Step A40 mainly includes the following situations:
[0188] 1. The first bounding volume is a rectangular bounding box: the vertex information of the first bounding volume is used to calculate the first normal vector group of the first bounding volume through the rendering thread; according to 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 the k separation axes between the first bounding volume and the bounding volume to be detected; according to the projections of the first bounding volume and the bounding volume to be detected on the k separation axes, the intersection between the first bounding volume and the bounding volume to be detected is determined.
[0189] 2. The first bounding volume is a sphere: determine the basis vector group of the bounding volume to be detected according to the vertex information of the bounding volume to be detected through the rendering thread, and the basis vector group includes basis vectors used to characterize 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, project the center point on the basis vector, and calculate the coordinate information of the target position point in the second bounding volume with the smallest distance from the center point; according to the coordinate information of the center point, the coordinate information of the target position point and the radius of the first bounding volume, determine the intersection between the first bounding volume and the bounding volume to be detected.
[0190] 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; re-render the material on the surface of the target virtual object through the image processor to generate a re-rendered target virtual object.
[0191] Step A60: generating a display screen 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.
[0192] 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 details of the process, please refer to the above embodiment, which will not be repeated here.
[0193] The following is another example to introduce the screen rendering method. The method mainly involves the logic thread and the rendering thread in the terminal device. The rendering thread includes multiple sub-threads. The method mainly includes the following steps:
[0194] 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.
[0195] 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 to deregister the sub-threads after their tasks are completed, so as to avoid a large amount of performance consumption by the sub-threads.
[0196] Step B30, divide the multiple virtual objects in the field of view to obtain m virtual object subsets. For example, if there are 10,000 virtual objects and 8 word threads in the field of view, then each virtual object subset contains 1,250 virtual objects. Optionally, the multiple virtual objects in the field of view can also be dynamically divided, please refer to the above embodiment for details.
[0197] Step B40, when the reflection effect of the reflection capture object changes, the reflection capture information is generated through the logic thread, and the logic thread is used to manage the logic operations related to the virtual scene.
[0198] Step B50, obtaining reflection capture information from the logical thread through each sub-thread according to the access cycle.
[0199] Step B60: Verify whether the virtual objects in the virtual object subset belong to the target virtual object according to the type of the reflection capture object recorded in the reflection capture information by each sub-thread, and obtain the object queue of each sub-thread. Please refer to the above embodiment for the specific content of this step, which will not be repeated here.
[0200] 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.
[0201] Step B80, 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; re-render the material on the surface of the target virtual object through the image processor to generate a re-rendered target virtual object.
[0202] Step B90: generating a display screen 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.
[0203] By making full use of the computing resources in the terminal device through this method, it is helpful to improve the verification speed of the target virtual object and shorten the time consumption caused by the introduction of this method. The application scenarios of the screen rendering method provided in this application include the generation of game screens in game games, the generation process of virtual screens in mixed reality applications, the generation of three-dimensional navigation animations in navigation programs, and the capture of virtual character motion pictures during animation production. For example, in the process of generating game screens, the virtual scene refers to the virtual environment in the game game, 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.
[0204] For another example, in a mixed reality application, a virtual scene refers to a three-dimensional model that needs to be integrated with a real scene, and a display screen is used to display an upper layer of an environment screen captured by a camera from the real world.
[0205] 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.
[0206] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0207] Fig.10 A block diagram of a screen rendering device provided by an exemplary embodiment of the present application is shown. The 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.
[0208] 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 whose reflection effect changes, and the reflection capture object is used to project a cube map representing the reflection effect onto the material surface of the virtual object.
[0209] 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 for any one of the reflection capture objects according to the geometric information of the reflection capture object. The target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the reflection capture object changes.
[0210] The object rendering module 1030 is used to re-render the target virtual object to generate a re-rendered target virtual object, and the texture of the material surface of the re-rendered target virtual object changes.
[0211] The picture generation module 1040 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.
[0212] In some embodiments, the object determination module 1020 includes: a bounding volume determination unit, used to calculate a first bounding volume of the reflection capture object based on the geometric information of the reflection capture object, wherein the first bounding volume refers to the geometric space in which the reflection capture object is effective in the virtual scene; and an object determination unit, 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, wherein the second bounding volume refers to the geometric space occupied by the virtual object in the virtual scene.
[0213] In some embodiments, the object determination unit is used to determine, for any one of the second bounding volumes corresponding to the at least one virtual object, if the bounding volume to be detected intersects with the first bounding volume, the virtual object corresponding to the bounding volume to be detected as the target virtual object.
[0214] In some embodiments, the step of determining at least one target virtual object is performed by a rendering thread, and the rendering thread 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, and the virtual object subset includes some virtual objects in the at least one virtual object; 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, then 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 have respectively determined their respective object queues, the object queues of each of the sub-threads are merged to obtain the at least one target virtual object.
[0215] In some embodiments, the device 1000 also includes: a first determination module, which is used to calculate a first normal vector group of the first enclosing volume according to the vertex information of the first enclosing volume when the first enclosing volume is a rectangular parallelepiped and the enclosing volume to be detected is a rectangular parallelepiped; determine a second normal vector group of the enclosing volume to be detected according to the vertex information of the enclosing volume to be detected, and the second normal vector group includes a second normal vector perpendicular to the plane of the enclosing 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, and the cross product vector refers to a result vector obtained by vector cross multiplication; use the first normal vector, the second normal vector and the cross product vector as k separation axes between the first enclosing volume and the enclosing volume to be detected, where k is a positive integer; determine the intersection between the first enclosing volume and the enclosing volume to be detected according to the projections of the first enclosing volume and the enclosing volume to be detected on the k separation axes.
[0216] In some embodiments, the device 1000 also includes: a second determination module, which is used to determine, when the first enclosing volume is a sphere and the enclosing volume to be detected is a rectangular parallelepiped, a basis vector group of the enclosing volume to be detected based on vertex information of the enclosing volume to be detected, the basis vector group including basis vectors for characterizing the direction of the side length of the enclosing volume to be detected; based on the coordinate information of the center point of the first enclosing volume, project the center point onto the basis vectors, and calculate the coordinate information of the target position point in the second enclosing volume with the smallest distance from the center point; and determine 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.
[0217] In some embodiments, the reflection capture object is a mirror reflection object, and the geometric information of the reflection capture object includes an effective direction for 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 object overlapping with the partial scene corresponding to the field of view 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 reflection capture object.
[0218] In some embodiments, the information acquisition module 1010 is used to generate the reflection capture information through a logical thread when the reflection effect of the reflection capture object changes, and the logical thread is used to manage logical operations related to the virtual scene; obtain the reflection capture information from the logical thread through a rendering thread according to an access cycle, and the rendering thread is used to render and generate a display screen of the field of view.
[0219] In some embodiments, the object rendering module 1030 is used to generate a rendering instruction for any one of the target virtual objects, wherein the rendering instruction is used to instruct an image processor to render the target virtual object; send the rendering instruction for the target virtual object to the image processor; and re-render the material on the surface of the target virtual object by the image processor to generate the re-rendered target virtual object.
[0220] It should be noted that the device provided in the above embodiment, when realizing its function, 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 is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment belongs to the same concept as the method embodiment. The specific implementation process is detailed in the method embodiment, which will not be repeated here. Please refer to the description of the method side embodiment for the beneficial effects of the device provided in the above embodiment, which will not be repeated here.
[0221] Fig.11 The structure block diagram of a terminal device provided by an exemplary embodiment of the present application is shown. The capacity adjustment device 1100 of the enterprise address book can be the terminal device introduced above.
[0222] Typically, the terminal device 1100 includes: a processor 1101 and a memory 1102 .
[0223] 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), and 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.
[0224] 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 a high-speed random access memory, and a 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 screen rendering method provided by the above-mentioned method embodiments.
[0225] Those skilled in the art will understand that Fig.11 The structure shown in the figure 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.
[0226] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the screen rendering method provided by the above-mentioned method embodiments.
[0227] 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, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above-mentioned ones.
[0228] 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 operation screen rendering method provided by the above-mentioned method embodiments.
[0229] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0230] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switching, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A picture rendering method, characterized in that: The method comprises: Acquire reflection capture information of a virtual scene, the reflection capture information including geometric information of at least one reflection capture object whose reflection effect changes, the reflection capture object being used to project a cube map representing the reflection effect onto a material surface of a virtual object; For any one of the reflection capture objects, determining 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 reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the 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, characterized in that 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 reflection capture object comprises: Calculate a first bounding volume of the reflection capture object according to the geometric information of the reflection capture object, where the first bounding volume refers to a geometric space in which the 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 claim 2, characterized in that 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 claim 2, characterized in that: 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 plurality of sub-threads, calculating, by the sub-thread, second bounding volumes respectively corresponding to respective virtual objects in a virtual object subset, wherein the virtual object subset includes some virtual objects in the at least one virtual object; 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, characterized in that: The method further comprises: 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, the intersection between the first enclosing volume and the enclosing volume to be detected is determined.
6. The method according to claim 3 or 4, characterized in that: The method further comprises: 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.
7. The method according to claim 1, characterized in that The reflection capture object is a specular reflection object, and the geometric information of the 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 reflection capture object comprises: A virtual object overlapped and included in a partial scene corresponding to the field of view and the effective direction of the mirror reflection is determined as the at least one target virtual object, wherein the partial scene is obtained by dividing the virtual scene according to the reflection capture object.
8. The method according to claim 1, characterized in that The obtaining of reflection capture information of the virtual scene includes: In the case where the reflection effect of the reflection capture object changes, generating the reflection capture information through 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 claim 1, characterized in that: 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, wherein the rendering instruction is used to instruct an image processor to render the target virtual object; Sending a rendering instruction of the target virtual object to the image processor; The material on the surface of the target virtual object is re-rendered by the image processor to generate the re-rendered target virtual object.
10. A picture rendering device, characterized in that: The device comprises: An information acquisition module, 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 whose reflection effect changes, and the reflection capture object is used to project a cube map representing the reflection effect onto a material surface of a virtual object; An object determination module, configured to determine, for any one of the reflection capture objects, at least one target virtual object from at least one virtual object included in a field of view according to geometric information of the reflection capture object, wherein the target virtual object refers to a virtual object whose surface display effect will change after the reflection effect of the 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, characterized in that: The terminal device includes 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, characterized in that: The storage medium stores a computer program, which 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, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The 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.