Virtual scene rendering method and device, computer equipment, medium and program product
By dynamically adjusting the details level of interactive objects in the virtual scene and optimizing the rendering effect according to changes in hardware performance, the problem of low hardware performance utilization in the existing technology is solved, and high-quality virtual scene rendering is achieved.
Patent Information
- Application Number
- CN202510096066.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-23
Smart Images

Figure CN120022589A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment, medium and program product for rendering a virtual scene. Background Art
[0002] With the development of computer technology, virtual scenes can be rendered in real time, that is, the screen is calculated and displayed at the same time, thus converting the virtual scene into a video.
[0003] Generally, the number of interactive objects in a virtual scene is relatively random, and the time required to render frames of the same virtual scene with different numbers of interactive objects is different. In related technologies, in order to balance hardware performance and rendering effects, rendering parameters are generally obtained by testing under extreme scenes (such as scenes with as many interactive objects as possible), so as to render the virtual scene based on the rendering parameters, thereby ensuring the rendering effect without affecting hardware performance.
[0004] However, in reality, the number of interactive objects included in the virtual scene does not reach the number of interactive objects included in the extreme scene, resulting in low utilization of hardware performance, and thus failing to achieve a high rendering effect within the limited hardware performance. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a virtual scene rendering method, apparatus, computer equipment, medium and program product, which are used to achieve higher rendering effect within limited hardware performance.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a method for rendering a virtual scene, the method comprising:
[0008] Obtaining a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer;
[0009] If the frame time is less than the frame time threshold, determining a first interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; increasing the detail level of the first interactive object to obtain an increased detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene;
[0010] If the frame time is greater than the frame time threshold, determining a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; reducing the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
[0011] On the other hand, an embodiment of the present application provides a virtual scene rendering device, the device comprising: an acquisition unit, an upgrade unit and a degradation unit;
[0012] The acquisition unit is used to acquire a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer;
[0013] The upgrading unit is configured to, if the frame time is less than the frame time threshold, determine a first interactive object from the multiple interactive objects according to the importance of each of the interactive objects in the virtual scene; increase the detail level of the first interactive object to obtain an increased detail level; and in the process of rendering the i+1th group of video frames of the virtual scene, render the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene;
[0014] The degradation unit is used to determine a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene if the frame time is greater than the frame time threshold; reduce the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, render the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
[0015] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0016] The memory is used to store a computer program and transmit the computer program to the processor;
[0017] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.
[0018] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.
[0019] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the above aspects.
[0020] It can be seen from the above technical solution that the frame time threshold corresponding to the virtual scene and the frame time of rendering the i-th group of video frames of the virtual scene are obtained. If the frame time is less than the frame time threshold, it means that there is still a lot of surplus in the current computing resources. Therefore, according to the importance of each interactive object in the virtual scene, a first interactive object with a higher degree of importance is determined from the multiple interactive objects included in the virtual scene, the detail level of the first interactive object is increased, and the increased detail level is obtained. The first interactive object is rendered based on the increased detail level, thereby obtaining the i+1th group of video frames of the virtual scene. Similarly, if the frame time is greater than the frame time threshold, it means that the current computing resources are limited. Therefore, according to the importance of each interactive object in the virtual scene, a second interactive object with a lower degree of importance is determined from the multiple interactive objects included in the virtual scene, the detail level of the second interactive object is reduced, and the reduced detail level is obtained. The second interactive object is rendered based on the reduced detail level, thereby obtaining the i+1th group of video frames of the virtual scene.
[0021] Therefore, if the current computing resources are sufficient, the detail level of more important interactive objects is increased and rendered first; if the current computing resources are limited, the detail level of less important interactive objects is decreased and rendered first. In other words, the detail level of interactive objects is dynamically adjusted according to changes in hardware performance, and interactive objects that can improve the rendering effect are selected from multiple interactive objects based on their importance for adjustment, thereby improving the utilization of hardware performance and achieving a higher rendering effect within limited hardware performance. In addition, in the process of rendering the virtual scene, only the interactive objects are adjusted instead of all virtual objects in the virtual scene, further improving the utilization of hardware performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1A schematic diagram of an application scenario of a virtual scene rendering method provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a flow chart of a method for rendering a virtual scene provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of determining a detail level based on a zoom-in operation in a related technology provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of determining a detail level based on a zoom-in operation provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of an application of a virtual scene rendering method provided in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of the structure of a virtual scene rendering device provided in an embodiment of the present application;
[0029] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0032] In related technologies, in order to reasonably utilize the hardware performance of computer devices, multiple levels of detail (LOD) are used to render virtual objects. In LOD, multiple levels of detail are set for rendering virtual objects, and different levels of detail correspond to different rendering parameters. Rendering parameters include screen ratio and model parameters of virtual objects. Take the four levels of detail as an example for explanation. See Table 1, which shows the rendering parameters corresponding to the four levels of detail.
[0033] Table 1
[0034] Level of Detail Screen-to-body ratio Model parameters of virtual objects LOD 0 Number of faces: 1228; Number of vertices: 664 LOD 1 0.003 Number of faces: 614; Number of vertices: 353 LOD 2 0.001 Number of faces: 306; Number of vertices: 191 LOD 3 0 Number of faces: 152; Number of vertices: 107
[0035] Among them, the model parameters of the virtual object include the number of facets and the number of vertices. As the number of facets and the number of vertices increase, the rendering accuracy of the virtual object increases, and the corresponding level of detail is higher, thereby increasing the utilization of hardware performance, that is, more computing resources need to be allocated to perform rendering operations.
[0036] The screen ratio refers to the ratio of the virtual object on the screen, which can be obtained by calculating the distance between the virtual object and the virtual camera corresponding to the current field of view. When the virtual object is far away from the virtual camera, the display of the virtual object on the screen will be reduced, that is, the screen ratio of the virtual object will be reduced.
[0037] If the screen-to-body ratio of the virtual object is reduced, the user is less likely to pay attention to the virtual object, so the detail level of the virtual object can be reduced, resulting in lower rendering accuracy of the virtual object. This, in turn, releases more computing resources without affecting the user's viewing experience, so that virtual objects with higher attention have higher rendering accuracy, while virtual objects with lower attention have lower rendering accuracy. This allows computing resources to be reasonably allocated under limited hardware performance to improve rendering effects.
[0038] In the above method, rendering parameters need to be set in advance, such as the correspondence between the size of the screen ratio and the model parameters of the virtual object. In related technologies, in order to take into account both hardware performance and rendering effects, rendering parameters are generally tested under extreme scenarios so that virtual scenes can be rendered based on the rendering parameters, thereby ensuring rendering effects without affecting hardware performance. Taking the virtual scene of a hundred-person team battle in the game as an example, the distance can be switched when 100 virtual objects are on the same screen, and the rendering parameters can be gradually tested to ensure hardware performance under extreme conditions.
[0039] However, in actual situations, the number of interactive objects included in the virtual scene does not reach the number of interactive objects included in the extreme scene. Continuing with the above example, there may be only 30 virtual objects on the same screen, and then rendering based on the rendering parameters set in the extreme case may lead to redundant computing resources and the ability to improve the rendering effect. In other words, the utilization rate of hardware performance is not high, so it is impossible to achieve a high rendering effect within the limited hardware performance.
[0040] In the related technology, although the corresponding rendering parameters can be tested for each number of virtual objects on the same screen, such as improving the rendering effect by reducing the screen-to-body ratio, and releasing more computing resources by increasing the screen-to-body ratio, etc., it will cause testers to repeatedly try the hardware performance and rendering effects, resulting in longer testing time and higher testing costs.
[0041] In other words, although the related art seems to take hardware performance into consideration, i.e., setting rendering parameters based on hardware performance, in actual use, it does not really consider the impact of dynamic changes in hardware performance, i.e., it only renders the real-time changing virtual scene based on preset and fixed rendering parameters without considering the changes in current hardware performance, thus resulting in low utilization of hardware performance.
[0042] Based on this, an embodiment of the present application provides a method for rendering a virtual scene. If the current computing resources are sufficient, the detail level of more important interactive objects is increased and rendered first; if the current computing resources are limited, the detail level of less important interactive objects is decreased and rendered first. In other words, the detail level of the interactive objects is dynamically adjusted according to the changes in hardware performance, and the interactive objects that can improve the rendering effect are selected from multiple interactive objects based on their importance for adjustment, thereby improving the utilization of hardware performance and achieving a higher rendering effect within limited hardware performance. In addition, in the process of rendering the virtual scene, only the interactive objects are adjusted instead of all virtual objects in the virtual scene, which further improves the utilization of hardware performance.
[0043] The virtual scene rendering method provided in the present application can be applied to computer devices with virtual scene rendering capabilities, such as terminal devices and servers.
[0044] Among them, the terminal devices can specifically be desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The smart car-mounted devices can be car-mounted navigation terminals and car-mounted computers, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc., but are not limited to these.
[0045] The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The terminal device and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0046] In order to facilitate understanding of the virtual scene rendering method provided in the embodiment of the present application, the following takes the execution subject of the virtual scene rendering method as a server as an example to exemplarily introduce the application scenario of the virtual scene rendering method.
[0047] See also Figure 1 , which is a schematic diagram of an application scenario of a virtual scene rendering method provided in an embodiment of the present application. Figure 1As shown, the application scenario includes a terminal device 110 and a server 120, and the terminal device 110 and the server 120 can communicate through a communication network. The communication network uses standard communication technology and / or protocols, usually the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, dedicated network or any combination of virtual private networks. In some embodiments, customized or dedicated data communication technology can be used to replace or supplement the above data communication technology.
[0048] The terminal device 110 is installed with a game client, and the player can start the game through the game client. The game client can be a massively multiplayer online (MMO) game, a shooting game, a simulation game (SLG), a multiplayer online tactical competitive game (MOBA), a first / third-person shooter game, a virtual reality application, etc., which is not specifically limited in this application. Taking a shooting game as an example, during a game, the player needs to continuously render the virtual scene in the game according to the player's operation.
[0049] The server 120 is a server corresponding to the game client, and can render the virtual scene and send the rendered video frames to the terminal device 110. In order to achieve a higher rendering effect within the limited hardware performance, the video frames are rendered in groups. The rendering of the i+1th group of video frames is used as an example for description.
[0050] Continue to see Figure 1 ,There are three interactive objects in the player’s field of view, as described in Table 2.
[0051] Table 2
[0052]
[0053] If the frame time of the i-th group of video frames is less than the frame time threshold, it means that there is still a lot of surplus in the current computing resources, and the interactive object A is the most important. The interactive object A can be determined as the first interactive object, and the detail level of the interactive object A is upgraded from LOD 1 to LOD 0. Therefore, in the process of rendering the i+1-th group of video frames, the interactive object A is rendered based on LOD 0, the interactive object B is rendered based on LOD 1, and the interactive object C is rendered based on LOD 2, thereby obtaining the i+1-th group of video frames. The rendering parameters corresponding to each detail level can be seen in Table 1, which will not be repeated here.
[0054] Similarly, if the i-th group of video frames is greater than the frame time consumption threshold, it means that the current computing resources are limited and the interactive object C is the least important. The interactive object C can be determined as the second interactive object, and the detail level of the interactive object C can be reduced from LOD 2 to LOD 3. Therefore, in the process of rendering the i+1-th group of video frames, the interactive object A is rendered based on LOD 1, the interactive object B is rendered based on LOD 1, and the interactive object C is rendered based on LOD 3, so as to obtain the i+1-th group of video frames.
[0055] Therefore, if the current computing resources are sufficient, the detail level of more important interactive objects is increased and rendered first; if the current computing resources are limited, the detail level of less important interactive objects is decreased and rendered first. In other words, the detail level of interactive objects is dynamically adjusted according to changes in hardware performance, and interactive objects that can improve the rendering effect are selected from multiple interactive objects based on their importance for adjustment, thereby improving the utilization of hardware performance and achieving a higher rendering effect within limited hardware performance. In addition, in the process of rendering the virtual scene, only the interactive objects are adjusted instead of all virtual objects in the virtual scene, further improving the utilization of hardware performance.
[0056] The virtual scene rendering method provided in the embodiment of the present application can be executed by the server. However, in other embodiments of the present application, the terminal device can also have similar functions as the server, so as to execute the virtual scene rendering method provided in the embodiment of the present application, or the terminal device and the server can jointly execute the virtual scene rendering method provided in the embodiment of the present application, and this embodiment does not limit this.
[0057] The virtual scene rendering method provided in this application can be applied to various technologies, including but not limited to virtual reality, augmented reality, mixed reality, etc., and can be specifically applied to video games, the construction industry, e-commerce, the education industry, the film and television industry, etc. The following takes two scenes as examples.
[0058] Scene 1, video games.
[0059] Real-time rendering allows developers to create an immersive interactive environment that responds immediately to players' operations. By using the virtual scene rendering method provided in the embodiment of the present application, complex 3D models, realistic lighting effects, and dynamic environments can be rendered, and all of these are performed at an interactive frame rate, thereby improving the rendering effect within limited hardware performance and providing a better user experience.
[0060] Scenario 2: e-commerce.
[0061] Through real-time rendering, customers can see extremely realistic details of the product, transforming the online shopping process into a situation where the customer is really in the store. By using the virtual scene rendering method provided by the embodiment of the present application, customers can interact with the product, view it from multiple angles, zoom in and out, and even change its color, thereby improving the rendering effect within limited hardware performance, which not only provides a better user experience, but also enables retailers to expand their sales capabilities.
[0062] It should be noted that the above application scenarios are only examples, and the virtual scene rendering method provided in this embodiment can also be applied to other scenarios, which is not limited here.
[0063] A virtual scene rendering method provided by the present application is described in detail below through a method embodiment.
[0064] See also Figure 2 , which is a flow chart of a virtual scene rendering method provided by an embodiment of the present application. For the sake of convenience, the following embodiment is still introduced by taking the execution subject of the virtual scene rendering method as a server as an example. Figure 2 As shown, the virtual scene rendering method includes the following steps:
[0065] S201: Obtaining a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene.
[0066] A virtual scene is a virtual scene displayed (or provided) when an application is running on a terminal. The virtual scene can be a simulation of a real scene, a semi-simulation and semi-fictitious scene, or a purely fictitious scene. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, and a three-dimensional virtual scene, and this application does not limit this.
[0067] The frame time refers to the time taken from the start of rendering to the end of rendering to obtain the video frame of the virtual scene, and the frame time of the i-th group of video frames refers to the time taken from the start of rendering to the end of rendering to obtain the i-th group of video frames of the virtual scene, where i is a positive integer. The embodiment of the present application does not specifically limit the number of each group of video frames, and those skilled in the art can set it according to actual needs, such as each group of video frames includes 15 video frames.
[0068] The embodiment of the present application does not specifically limit the way to obtain the frame time consumption, which can be obtained based on indicators such as frame rate, logic time consumption or rendering and drawing time consumption. Among them, the frame rate is the frequency at which images in frames appear continuously on the display, and the frame time consumption is the reciprocal of the frame rate. The logic time consumption is the time used to update the game or application logic in the rendering loop. For example, including calculations related to logic such as object position, speed, animation state, collision detection, etc., the size of the logic time consumption will affect the size of the frame rate. Rendering and drawing time consumption refers to the time to draw the elements included in the virtual scene (such as models, textures, lighting, etc. of interactive objects) onto the screen. Such as setting the rendering state, binding resources, submitting drawing commands, etc. The size of the rendering and drawing time consumption will affect the size of the frame rate.
[0069] The embodiment of the present application does not specifically limit the way to obtain the frame time consumption. For example, if a group of video frames includes one video frame, the frame time consumption of the video frame can be used as the frame time consumption of the group of video frames. For another example, if a group of video frames includes multiple video frames, continue to take the i-th group of video frames as an example, obtain the frame time consumption of each video frame included in the i-th group of video frames, and obtain the frame time consumption of the i-th group of video frames of the virtual scene according to the average value of the frame time consumption of each video frame included in the i-th group of video frames. Thus, the frame time consumption of the group of video frames is determined as the average value of the multiple frame time consumptions included in a group of video frames, which can not only reduce single-point errors (such as errors in obtaining the frame time consumption of a frame of video frames, which is larger or smaller), but also has high stability and improves the rendering effect. It is also possible to perform an upgrade or downgrade operation on each subsequent group of video frames to reduce the occupancy of computing resources.
[0070] The frame time threshold is used to measure the boundary value of the rendered video frame without freezing or delay, which seriously affects the user experience. When it is greater than the frame time threshold, the rendered video frame may freeze; when it is less than the frame time threshold, the rendered video frame can be played smoothly. The embodiment of the present application does not specifically limit the size of the frame time threshold, and those skilled in the art can set it according to actual needs.
[0071] As a possible implementation method, since the hardware performance of different rendering devices (such as servers) is different, different rendering devices can use different frame consumption thresholds, that is, establish a mapping relationship between the device model and the frame consumption threshold. In this way, the target device model of the currently used rendering device and the mapping relationship between the device model and the frame consumption threshold are obtained. According to the mapping relationship, the frame consumption threshold corresponding to the target device model is determined, and the frame consumption threshold corresponding to the target device model is determined as the frame consumption threshold corresponding to the virtual scene. In this way, through refinement, that is, setting different frame consumption thresholds for rendering devices with different hardware performance, the hardware performance of various rendering devices can be further fully utilized, and the utilization rate of hardware performance can be improved, so as to improve the accuracy of subsequent calculations and improve rendering effects.
[0072] In addition, a mapping relationship between frame time thresholds corresponding to different virtual scenes can be established to further refine the frame time threshold and improve the accuracy of subsequent calculations. For example, a game includes multiple virtual scenes, and multiple virtual scenes can share a frame time threshold, or use multiple frame time thresholds. The same virtual scene can also be refined into multiple gears according to the number of interactive objects, etc. This application does not make specific limitations on this.
[0073] A virtual object refers to an active object in a virtual scene. The active object may be a virtual person, a virtual animal, an animated character, etc., for example, a person, an animal, a plant, an oil drum, a wall, a stone, etc. displayed in a three-dimensional virtual scene. Optionally, the virtual object is a three-dimensional stereo model created based on animation skeleton technology. Each virtual object has its own shape and volume in the three-dimensional virtual scene and occupies a part of the space in the three-dimensional virtual scene.
[0074] The virtual scene includes multiple interactive objects, which are virtual objects that change in the virtual scene, such as virtual characters controlled by players. Compared with paying attention to the detail level of all virtual objects in the virtual scene, the interactive objects that affect the visual effect in the virtual scene are generally interactive objects that change. In other words, the interactive objects generally affect the frame time threshold. Therefore, paying attention to the detail level of interactive objects only can ensure the rendering effect while improving the calculation speed, which is more convenient and quick.
[0075] In the embodiment of the present application, the virtual scene is rendered in real time, and the number of interactive objects in the virtual scene will change. The same virtual scene includes different numbers of interactive objects, and the time required to obtain the video frame for the virtual scene is different, that is, rendering different numbers of interactive objects has different requirements for computing resources, and thus different hardware performance utilization.
[0076] Based on this, in order to improve the rendering effect within the limited hardware performance, the embodiment of the present application changes the adjustment of the detail level based on the screen ratio to the adjustment of the detail level based on the frame time consumption that reflects the hardware performance.
[0077] S202: If the frame time is less than the frame time threshold, determine a first interactive object from multiple interactive objects according to the importance of each interactive object in the virtual scene; increase the detail level of the first interactive object to obtain an increased detail level; in the process of rendering the i+1th group of video frames of the virtual scene, render the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene.
[0078] If the frame time of the i-th group of video frames is less than the frame time threshold, it means that the video frames rendered by the server can not only be played smoothly, but also the server's computing resources have a lot of margin. In order to improve the utilization of the server hardware performance, one or more interactive objects can be selected from multiple interactive objects and determined as the first interactive object, and the first interactive object with a higher importance is determined from the multiple interactive objects based on the importance, so as to subsequently increase the detail level of the first interactive object and improve the rendering effect of the first interactive object.
[0079] Among them, the importance is used to measure the visual effect of the interactive object in the virtual scene. The more important the interactive object is to the player's visual effect on the screen, the higher the importance of the interactive object. The embodiment of the present application does not specifically limit the way to determine the importance, and those skilled in the art can set it according to actual needs. For example, the importance is determined based on one or more combinations of the movement speed, screen ratio and position of the interactive object in the virtual scene, which will be specifically described based on A1-A2 later and will not be repeated here.
[0080] The embodiments of the present application do not specifically limit the number of interactive objects whose importance is obtained. For example, the importance of all interactive objects is obtained, and then one, two, or more than three interactive objects are selected from multiple interactive objects as the first interactive object based on the importance of each interactive object. For another example, if it is possible to pre-estimate that some interactive objects have a higher importance from multiple interactive objects, the importance of these estimated interactive objects can be obtained, thereby reducing the amount of calculation.
[0081] The number of the first interactive objects may be one interactive object or multiple interactive objects. The embodiment of the present application does not specifically limit the first interactive object. For example, the most important interactive object among multiple interactive objects is determined as the first interactive object. For another example, the first interactive object is selected from the first few most important interactive objects among multiple interactive objects.
[0082] The first interactive object is more important, that is, the visual effect of the first interactive object in the virtual scene is more important to the player, such as in the video frame obtained by rendering the virtual scene, the first interactive object is the largest interactive object among the multiple interactive objects included in the video frame, etc., so that when the computing resources of the server still have margin, the detail level of the first interactive object can be increased to obtain an increased detail level. For example, in the i-th group of video frames, the detail level of the first interactive object is LOD 1, and the increased detail level obtained after the increase can be LOD 0, so that in the process of rendering the i+1th group of video frames of the virtual scene, the first interactive object is rendered based on the increased detail level to obtain the i+1th group of video frames for the virtual scene.
[0083] Thus, by increasing the detail level of the first interactive object with a higher degree of importance, an increased detail level is obtained, and the first interactive object is rendered based on the increased detail level to obtain the rendering result of the next set of video frames. Therefore, if the server's computing resources still have margin, the more abundant computing resources can be used to improve the rendering effect of the first interactive object, thereby improving the utilization rate of the server's hardware resources and achieving improved rendering effect within limited hardware performance.
[0084] S203: If the frame time is greater than the frame time threshold, determine a second interactive object from multiple interactive objects according to the importance of each interactive object in the virtual scene; reduce the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, render the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene.
[0085] If the frame time of the i-th group of video frames is greater than the frame time threshold, it means that the video frames rendered by the server cannot be played smoothly and the computing resources of the server are limited. In order to reduce the occupation of server resources by rendering, one or more interactive objects can be selected from multiple interactive objects and determined as the second interactive object, and the interactive objects with lower importance can be determined from the multiple interactive objects based on the importance, so as to subsequently reduce the detail level of the second interactive object and reduce the computing resources consumed by rendering the second interactive object, thereby releasing more computing resources to improve the smoothness of the video frames.
[0086] The embodiments of the present application do not specifically limit the number of interactive objects whose importance is obtained. For example, the importance of all interactive objects is obtained, and then one, two, or more than three interactive objects are selected from multiple interactive objects as the second interactive object based on the importance of each interactive object. For another example, if it is possible to pre-estimate that some interactive objects from multiple interactive objects have low importance, the importance of these estimated interactive objects can be obtained, thereby reducing the amount of calculation.
[0087] The number of the second interactive objects may be one interactive object or multiple interactive objects. The embodiment of the present application does not specifically limit the second interactive object. For example, the interactive object with the lowest importance among the multiple interactive objects is determined as the second interactive object. For another example, the second interactive object is selected from the first few interactive objects with the lowest importance among the multiple interactive objects.
[0088] The second interactive object is less important, that is, the visual effect of the second interactive object in the virtual scene is not particularly important to the player. For example, in the video frame obtained by rendering the virtual scene, the second interactive object is the smallest interactive object among the multiple interactive objects included in the video frame, etc., so that when the computing resources of the server are limited, the detail level of the second interactive object can be reduced to obtain a reduced detail level. For example, in the i-th group of video frames, the detail level of the second interactive object is LOD 1, and the reduced detail level obtained after the reduction can be LOD 2, so that in the process of rendering the i+1th group of video frames of the virtual scene, the second interactive object is rendered based on the reduced detail level to obtain the i+1th group of video frames for the virtual scene.
[0089] Thus, by reducing the detail level of the second interactive object with a lower degree of importance, a reduced detail level is obtained, and the second interactive object is rendered based on the reduced detail level to obtain the rendering result of the next set of video frames. Therefore, when the computing resources of the server are limited, the rendering effect of the second interactive object with a smaller impact on the visual effect can be reduced, thereby releasing more computing resources and ensuring the smoothness of the video frame, thereby ensuring the smoothness of the video frame while minimizing the impact on the visual effect, and achieving less impact on the rendering effect within limited hardware performance.
[0090] It should be noted that the importance of the first interactive object is greater than that of the second interactive object, that is, the first interactive object is an interactive object with a higher importance, and the second interactive object is an interactive object with a lower importance. For example, the first interactive object is the interactive object with the highest importance, and the second interactive object is the interactive object with the lowest importance, etc. Therefore, when there is a large margin of computing resources, the detail level of interactive objects with a higher importance is increased first, and when computing resources are limited, the detail level of interactive objects with a lower importance is reduced first, thereby improving the utilization of hardware resources while improving the rendering effect of interactive objects in video frames or ensuring that the visual effect is not affected after the rendering effect of video frames is reduced, thereby improving the user experience. Therefore, when rendering a virtual scene, the embodiment of the present application can improve the model accuracy of the model corresponding to the interactive object, such as increasing the number of rendered patches in the virtual scene.
[0091] It can be seen from the above technical solution that the frame time threshold corresponding to the virtual scene and the frame time of rendering the i-th group of video frames of the virtual scene are obtained. If the frame time is less than the frame time threshold, it means that there is still a lot of surplus in the current computing resources. Therefore, according to the importance of each interactive object in the virtual scene, a first interactive object with a higher degree of importance is determined from the multiple interactive objects included in the virtual scene, the detail level of the first interactive object is increased, and the increased detail level is obtained. The first interactive object is rendered based on the increased detail level, thereby obtaining the i+1th group of video frames of the virtual scene. Similarly, if the frame time is greater than the frame time threshold, it means that the current computing resources are limited. Therefore, according to the importance of each interactive object in the virtual scene, a second interactive object with a lower degree of importance is determined from the multiple interactive objects included in the virtual scene, the detail level of the second interactive object is reduced, and the reduced detail level is obtained. The second interactive object is rendered based on the reduced detail level, thereby obtaining the i+1th group of video frames of the virtual scene.
[0092] Therefore, if the current computing resources are sufficient, the detail level of more important interactive objects is increased and rendered first; if the current computing resources are limited, the detail level of less important interactive objects is decreased and rendered first. In other words, the detail level of interactive objects is dynamically adjusted according to changes in hardware performance, and interactive objects that can improve the rendering effect are selected from multiple interactive objects based on their importance for adjustment, thereby improving the utilization of hardware performance and achieving a higher rendering effect within limited hardware performance. In addition, in the process of rendering the virtual scene, only the interactive objects are adjusted instead of all virtual objects in the virtual scene, further improving the utilization of hardware performance.
[0093] As a possible implementation method, the embodiment of the present application provides a method for determining the degree of importance, see A1-A2 for details.
[0094] A1: Obtain the visual influencing factors of each interactive object in the virtual scene.
[0095] Visual influencing factors are factors that affect vision. The visual influencing factors of interactive objects include one or more combinations of the movement speed of the interactive object in the virtual scene, the screen ratio of the interactive object in the video frame corresponding to the virtual scene, and the position of the interactive object in the virtual scene.
[0096] The screen ratio of the interactive object in the video frame corresponding to the virtual scene (hereinafter referred to as the screen ratio of the interactive object) refers to the ratio between the size of the interactive object and the size of the video frame corresponding to the virtual scene. The larger the screen ratio of the interactive object, the more attractive the interactive object is to the viewer, and thus the better its visual effect should be, that is, it needs a higher level of detail for rendering to improve the user experience.
[0097] The movement speed of an interactive object in a virtual scene (referred to as the movement speed of the interactive object) refers to the displacement distance of the interactive object in a virtual scene per unit time. For example, if the movement speed of an interactive object is too fast, you may only see an afterimage, and you cannot clearly identify the shape and details of the interactive object. In this way, you can render the interactive object based on a higher level of detail to improve the user experience.
[0098] The position of the interactive object in the virtual scene (referred to as the position of the interactive object) can reflect whether the interactive object can attract viewers. For example, the more central the position of the interactive object is, the greater the probability of attracting viewers, and thus the better the visual effect should be, that is, it requires a higher level of detail for rendering to improve the user experience.
[0099] A2: Determine the importance of interactive objects based on visual influencing factors.
[0100] After obtaining the visual influence factors of each interactive object in the virtual scene, each interactive object is traversed, and the importance of each interactive object is determined according to the visual influence factors.
[0101] From the foregoing, it can be seen that the importance of an interactive object can be determined based on visual influencing factors, namely, one or more combinations of the screen ratio, movement speed and position of the interactive object, so that the interactive object with the detail level adjusted can be selected based on the importance, thereby achieving a higher rendering effect within limited hardware performance.
[0102] In addition, if the visual influencing factors include motion speed and screen-to-body ratio, compared to the related art, the method of selecting interactive objects with adjusted detail levels based only on the screen-to-body ratio only considers the static effects of the interactive objects. However, by introducing motion speed, the visual effects of the moving interactive objects on the overall picture of the video frame can be considered, thereby improving the accuracy of the importance and further improving the rendering effect within limited hardware performance.
[0103] It should be noted that the higher the speed range of the interactive object's movement in the virtual scene, the higher the importance of the interactive object; the higher the screen ratio range of the interactive object in the virtual scene, the higher the importance of the interactive object; the higher the degree of centralization of the interactive object's position in the virtual scene, the higher the importance of the interactive object.
[0104] The range covered by the motion speed can be divided into two or more speed ranges, the range covered by the screen ratio can be divided into two or more ratio ranges, and the degree of centering of the position can be divided into two or more ratio ranges.
[0105] The following uses the visual influencing factors including motion speed and screen ratio as an example to illustrate.
[0106] For example, the maximum speed of the interactive object in the virtual scene is 100 kilometers per hour, and 10 speed ranges can be obtained, with a scoring gradient of 1-10 points. Among them, 0-10 kilometers per hour is a speed range, counted as 1 point, 11 kilometers per hour-20 kilometers per hour is a speed range, counted as 2 points, and so on, 91 kilometers per hour-100 kilometers per hour is a speed range, counted as 10 points. The maximum screen ratio of the interactive object in the virtual scene is 100%, and 10 ratio ranges can be obtained, with a scoring gradient of 1-10 points. Among them, 0-10% is a speed range, counted as 1 point, 11%-20% is a speed range, counted as 2 points, and so on, 91%-100% is a speed range, counted as 10 points. Therefore, the importance can be the sum of the score corresponding to the speed range of the movement speed of the interactive object in the virtual scene and the score corresponding to the ratio range of the screen ratio of the interactive object in the virtual scene.
[0107] For another example, the visual effect will only be affected if the speed of the interactive object in the virtual scene exceeds the speed threshold. Based on the speed threshold, the range covered by the motion speed is divided into two speed ranges, a speed range greater than or equal to the speed threshold, and a speed range less than the speed threshold. The screen ratio of the interactive object is the same and will not be elaborated.
[0108] As a possible implementation method, if the visual influencing factors include multiple factors, each corresponding weight can be obtained, so as to determine the importance of the interactive object based on the weight and the visual influencing factors. If the visual influencing factors include motion speed, screen ratio and position, the first weight corresponding to the motion speed, the second weight corresponding to the screen ratio, and the third weight corresponding to the position can be obtained, so as to determine the importance of the interactive object based on the motion speed, screen ratio, position, first weight, second weight and third weight. Thus, through the weight, the influence of each visual influencing factor on the importance is adjusted to improve the accuracy of the importance. For another example, taking the visual influencing factors including motion speed and screen ratio as an example, the importance can be determined based on the first weight, the second weight, the motion speed and the screen ratio, where the first weight corresponding to the motion speed is 0.4, the second weight corresponding to the screen ratio is 0.6, etc., and this application does not make specific limitations on this.
[0109] Therefore, compared to determining the interactive objects for adjusting the detail level based only on the screen-to-body ratio, the importance of the interactive objects is determined based on the speed of the interactive objects in the virtual scene, the screen-to-body ratio of the interactive objects in the video frames corresponding to the virtual scene, or the position of the interactive objects in the virtual scene. The dimensions for determining the importance are richer and more in line with the movement of the interactive objects in the virtual scene. Thus, the method of determining the interactive objects for adjusting the detail level based on importance is more accurate, so as to achieve higher rendering effects within limited hardware performance.
[0110] Players can adjust the viewing angle of the virtual scene, which may cause the interactive object to be enlarged or reduced during the adjustment process. The following takes the zoom operation in a shooting game as an example to illustrate.
[0111] See also Figure 3 , which is a schematic diagram of determining the detail level based on a zoom-in operation in a related technology provided by an embodiment of the present application. For the convenience of explanation, the interactive object controlled by the player is referred to as a controlled object, and the controlled object is an interactive object among multiple interactive objects, and the non-controlled object is an interactive object other than the controlled object among multiple interactive objects. The interactive object not controlled by the player is referred to as a non-controlled object, and the non-controlled object is an interactive object other than the controlled object among multiple interactive objects, such as Figure 3 The interactive object A shown in the middle figure (A) is a non-controlled object. The controlled object is one of the multiple interactive objects.
[0112] In related technologies, such as Figure 3 As shown in the middle figure (B), the distance between the non-controlled object in the distance and the virtual camera corresponding to the controlled object is large, that is, the distance between the non-controlled object and the controlled object is far, and the screen ratio corresponding to the non-controlled object is small, so it will be rendered at a lower level of detail. After the interactive object is enlarged based on the zoom operation, since the distance for determining the screen ratio has not changed, the screen ratio will not change, and the detail level of the non-controlled object will not be adjusted, and it will be rendered based on the lower level of detail, resulting in poor rendering effect when the player watches the non-controlled object in split screen upgrade, and a poor user experience.
[0113] Based on this, in the embodiment of the present application, if the visual influencing factor includes the screen ratio, the screen ratio can be refined into the main screen ratio and the split screen ratio. Among them, the main screen ratio is the ratio between the size of the interactive object and the size of the video frame corresponding to the virtual scene in which it is located, and the split screen ratio is the ratio between the size of the interactive object and the size of the split screen generated by the zoom operation.
[0114] If a zoom operation is performed, the distance between the virtual camera corresponding to the split screen generated by the zoom operation and the non-controlled object in the virtual scene is determined, the split screen ratio is determined, and the importance of the non-controlled object is determined according to the split screen ratio.
[0115] The zoom operation includes a zoom-out operation and a zoom-in operation. In response to the zoom operation, a split screen of a picture corresponding to the zoom operation is generated based on the zoom operation for display, and a virtual camera corresponding to the split screen. Figure 4 , which is a schematic diagram of determining the detail level based on a zoom-in operation provided by an embodiment of the present application. Figure 4As shown in FIG. (A) in FIG. 1 , in response to the zoom-in operation, the screen corresponding to the zoom-in operation is displayed based on the generated split screen. Figure 4 As shown in (B) of the figure, due to the zoom operation, the virtual camera corresponding to the split screen is equivalent to moving forward, so as to calculate the distance between the virtual camera corresponding to the split screen and the non-controlled object, and determine the split screen ratio based on the distance, and then determine the importance of the non-controlled object based on the split screen ratio. The importance can be determined based on the adjusted distance, and the detail level obtained based on the importance can be rendered to avoid the interactive object aimed by the player being in a rough state when the perspective is zoomed in.
[0116] In addition, if the zoom operation is not performed, the main screen ratio is determined according to the distance between the virtual camera corresponding to the controlled object and the non-controlled object in the virtual scene, and the importance of the non-controlled object is determined according to the main screen ratio, such as Figure 3 shown.
[0117] Therefore, if the visual influencing factors include the screen ratio, the screen ratio can be refined into the main screen ratio and the split screen ratio. If a zoom operation is performed, a split screen will be generated on the main screen. The distance between the virtual camera and the non-controlled object corresponding to the split screen in the virtual scene can be used to determine the split screen ratio, and the importance of the non-controlled object can be determined based on the split screen ratio, thereby improving the accuracy of the importance. Furthermore, in the process of adjusting the viewing angle of observing the virtual scene, if the zoom operation causes the interactive object to be enlarged or reduced, the importance can be determined based on the adjusted distance, and the level of detail obtained based on the importance can be rendered, taking into account the visual effects of motion, which is more in line with the player's observation status and improves the user experience.
[0118] The embodiment of the present application does not specifically limit the method of determining the first interactive object and the second interactive object based on the importance. Two cases are taken as examples for explanation below. For case one, see B1-B5, and for case two, see C1-C4.
[0119] Case 1: The top K interaction objects ranked by importance are determined as the first interaction object or the second interaction object.
[0120] K is a positive integer, which can be preset or determined based on the difference between the frame time and the frame time threshold. This application does not make any specific restrictions on this, and those skilled in the art can set it according to actual needs. It should be noted that the number of the first interactive objects and the number of the second interactive objects can be different or the same, and this application does not make any specific restrictions on this.
[0121] B1: Obtain the importance of each interactive object in the virtual scene.
[0122] In this embodiment, the importance of each interactive object in the virtual scene is obtained.
[0123] If the frame time consumption is less than the frame time consumption threshold, the first interaction object is determined through B2 and B3; if the frame time consumption is greater than the frame time consumption threshold, the second interaction object is determined through B4 and B5.
[0124] B2: Sort the multiple interactive objects in descending order according to their importance to obtain a first ranking order for the multiple interactive objects.
[0125] The multiple interactive objects are sorted according to the importance of each interactive object, such as in descending order, to obtain a first arrangement order of the multiple interactive objects, that is, the first arrangement order is the order obtained by sorting the multiple interactive objects in descending order according to their importance.
[0126] B3: Determine the top K interaction objects in the first ranking order as the first interaction objects.
[0127] The top K interactive objects in the first arrangement order are determined as the first interactive objects, that is, the first interactive object is the top K interactive objects with the highest importance among the multiple interactive objects, such as the interactive object with the highest importance is the first interactive object.
[0128] B4: Sort the multiple interactive objects in ascending order according to their importance to obtain a second arrangement order for the multiple interactive objects.
[0129] The multiple interactive objects are sorted according to the importance of each interactive object, such as in ascending order, to obtain a second arrangement order of the multiple interactive objects, that is, the second arrangement order is the order obtained by sorting the multiple interactive objects in ascending order according to the importance of the multiple interactive objects.
[0130] B5: Determine the first L interaction objects in the second arrangement order as the second interaction objects.
[0131] The first L interactive objects in the second arrangement order are determined as the second interactive objects, that is, the second interactive object is the first L interactive objects with the lowest importance among the multiple interactive objects, such as the interactive object with the lowest importance is the second interactive object.
[0132] Therefore, by obtaining the importance of each interactive object, multiple interactive objects are sorted according to their importance, so that the top K interactive objects with the highest importance are determined as the first interactive objects for upgrading; the top L interactive objects with the lowest importance are determined as the second interactive objects, so that the detail level can be upgraded based on K interactive objects or reduced based on L interactive objects each time, thereby optimizing the detail levels of more interactive objects within limited performance, improving the rendering effect of video frames, and improving user experience.
[0133] As a possible implementation, during subsequent upgrades, if the detail level of the first interactive object is the highest level and cannot be upgraded, the highest level can be directly determined as the increased detail level, that is, the current detail level is maintained and no longer upgraded. For example, if the detail level of the first interactive object is LOD 0, LOD 0 is directly determined as the increased detail level. Similarly, during subsequent downgrades, if the detail level of the second interactive object is the lowest level and cannot be downgraded, the lowest level can be directly determined as the reduced detail level, that is, the current detail level is maintained and no longer downgraded.
[0134] Therefore, by directly determining the highest level as the increased detail level, or the lowest level as the decreased detail level, it can be ensured that when subsequent rendering is performed based on the increased detail level or the decreased detail level, the problem of being unable to upgrade or downgrade due to the highest detail level or the lowest detail level is reduced, thereby improving the rendering success rate.
[0135] As a possible implementation, during subsequent upgrades, the detail level of the first interactive object will be increased if the detail level of the first interactive object is not the highest level. Similarly, during subsequent downgrades, the detail level of the second interactive object will be decreased if the detail level of the second interactive object is not the lowest level. Thus, by limiting the detail level of the upgraded or downgraded object, it is possible to ensure that when rendering is performed based on the increased or decreased detail level, the problem of being unable to upgrade or downgrade due to the highest or lowest detail level is reduced, thereby improving the rendering success rate.
[0136] As a possible implementation, after determining the first interactive object or the second interactive object, it is possible to determine whether to upgrade the detail level of the first interactive object or whether to reduce the detail level of the second interactive object. It is also possible to determine the first interactive object after removing the interactive object with the highest detail level in advance, or to determine the second interactive object after removing the interactive object with the lowest detail level in advance.
[0137] Specifically, if the frame time is greater than the frame time threshold, the interactive objects whose detail levels are not the highest level are obtained from multiple interactive objects, and the interactive objects whose detail levels are not the highest level are sorted in descending order according to their importance to obtain a first arrangement order; if the frame time is less than the frame time threshold, the interactive objects whose detail levels are not the lowest level are obtained from multiple interactive objects, and the interactive objects whose detail levels are not the lowest level are sorted in ascending order according to their importance to obtain a second arrangement order.
[0138] Therefore, before sorting multiple interactive objects according to their importance, the interactive objects with the highest detail level or the lowest detail level are removed from the multiple interactive objects, and sorting is performed based on the removed interactive objects to obtain a first arrangement order or a second arrangement order, so that the first interactive object obtained based on the first arrangement order or the second interactive object obtained based on the second arrangement order reduces the problem of being unable to upgrade or downgrade due to the highest detail level or the lowest detail level, thereby improving the rendering success rate.
[0139] The embodiments of the present application are not specifically limited to the rendering method in the following situation, and three methods are used as examples for explanation below.
[0140] Method 1: In the (i+1)th group of video frames, as time goes by, an interactive object is added to each video frame for rendering.
[0141] If the frame time is less than the frame time threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to K.
[0142] In the process of rendering the i+1th group of video frames of the virtual scene, the video frames are rendered respectively according to the importance of the K interactive objects included in the first interactive object and the increased detail levels corresponding to the K interactive objects, so as to obtain the i+1th group of video frames of the virtual scene. Wherein, based on the increased detail levels of the first k interactive objects in the first interactive object, the first k interactive objects are rendered respectively to obtain the kth video frame in the i+1th group of video frames, where k is a positive integer less than or equal to K.
[0143] For example, in the process of rendering the M video frames included in the i+1th group of video frames, for the first video frame, based on the increased detail level corresponding to the interactive object with the highest importance, the interactive object with the highest importance is rendered, and the first video frame in the i+1th group of video frames is obtained. For the second video frame, based on the increased detail level corresponding to the interactive object with the highest importance, the interactive object with the highest importance is rendered, and based on the increased detail level corresponding to the interactive object with the second highest importance, the interactive object with the second highest importance is rendered, and the second video frame in the i+1th group of video frames is obtained. And so on, until M video frames of the i+1th group of video frames are obtained.
[0144] It should be noted that, since M is greater than or equal to K, if M is greater than K, then for the K+1th video frame to the Mth video frame in the i+1th group of video frames, each video frame no longer adds a rendered interactive object compared to the previous video frame, but instead each video frame is rendered separately based on the importance of the first K interactive objects and the increased detail levels corresponding to the K interactive objects, to obtain the i+1th group of video frames of the virtual scene.
[0145] Similarly, if the frame consumption is greater than the frame consumption threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to L.
[0146] In the process of rendering the i+1th group of video frames of the virtual scene, the video frames are rendered respectively according to the importance of the L interactive objects included in the second interactive object and the reduced detail levels corresponding to the L interactive objects, so as to obtain the i+1th group of video frames of the virtual scene. Wherein, based on the reduced detail levels of the first l interactive objects in the second interactive objects, the first l interactive objects are rendered to obtain the lth video frame in the i+1th group of video frames, where l is an integer less than or equal to L.
[0147] For example, in the process of rendering the M video frames included in the i+1th group of video frames, for the first video frame, based on the reduced detail level corresponding to the interactive object with the first lowest importance, the interactive object with the first lowest importance is rendered, and the first video frame in the i+1th group of video frames is obtained. For the second video frame, based on the reduced detail level corresponding to the interactive object with the first lowest importance, the interactive object with the first lowest importance is rendered, and based on the reduced detail level corresponding to the interactive object with the second lowest importance, the interactive object with the second lowest importance is rendered, and the second video frame in the i+1th group of video frames is obtained. And so on, until M video frames of the i+1th group of video frames are obtained.
[0148] It should be noted that, since M is greater than or equal to L, if M is greater than L, then for the K+1th to Lth video frames in the i+1th group of video frames, each video frame no longer adds a rendered interactive object compared to the previous video frame, but each video frame is rendered separately based on the importance of the first L interactive objects and the increased detail levels corresponding to the L interactive objects, to obtain the i+1th group of video frames of the virtual scene.
[0149] Therefore, if each group of video frames includes multiple video frames, after obtaining the first interactive object or the second interactive object, when rendering each group of video frames, each of the multiple video frames in a group renders one more interactive object than the previous video frame, that is, each rendering only upgrades or reduces the detail level of one interactive object, so that it is not easy to be noticed by the observer, and the user experience is higher. In addition, each time a part of the interactive objects is rendered, the multiple interactive objects can be re-sorted before rendering each video frame, and then the appropriate interactive objects are rendered to upgrade or reduce the detail level of the appropriate interactive objects, thereby improving the accuracy of the calculation.
[0150] Method 2: In the (i+1)th group of video frames, as time goes by, an interactive object with an increased importance level is rendered in each video frame.
[0151] If the frame time is less than the frame time threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to K.
[0152] Obtain the corresponding relationship between importance and importance level, such as importance 70% - importance 80% are at the same importance level, importance 80% - importance 90% are at the same importance level, etc.
[0153] According to the importance and corresponding relationship corresponding to each first interactive object, the importance level corresponding to each first interactive object is determined, and multiple first interactive objects are divided according to the importance level corresponding to each first interactive object to obtain first object sets corresponding to each importance level, so that first interactive objects in the same first object set correspond to the same importance level. For example, the importance levels of 70% to 80% are at the same importance level, and interactive objects with importance levels between 70% and 80% will be divided into the same first object set.
[0154] The third arrangement order of multiple first object sets is obtained by sorting them from large to small according to the importance. For example, in the third arrangement order, the first object set where the interactive objects with an importance of 90% to 100% are located, the first object set where the interactive objects with an importance of 80% to 90% are located, and so on. Thus, in the process of rendering the i+1th group of video frames of the virtual scene, each video frame is rendered separately according to the importance of the K interactive objects included in the first interactive object, and the increased detail level corresponding to the K interactive objects, to obtain the i+1th group of video frames of the virtual scene. Among them, the interactive objects included in the first k first object sets in the third arrangement order are rendered separately to obtain the kth video frame in the i+1th group of video frames, and the first interactive objects at the same importance level are rendered in the same video frame, and k is a positive integer less than or equal to K.
[0155] For example, in the process of rendering the M video frames included in the i+1th group of video frames, for the first video frame, the first first object set is selected from the third arrangement order, and the rendering is performed based on the first interactive objects included in the first object set and the corresponding increased detail levels, so as to obtain the first video frame. For the second video frame, the first and second first object sets are selected from the third arrangement order, and the rendering is performed based on the first interactive objects included in the first and second first object sets and the corresponding increased detail levels, so as to obtain the second video frame. And so on, until the M video frames of the i+1th group of video frames are obtained.
[0156] It should be noted that since M is greater than or equal to K, if M is greater than K, then for the K+1th video frame to the Mth video frame in the i+1th group of video frames, each video frame is no longer rendered with an additional interactive object of a higher importance level compared to the previous video frame. Instead, all first interactive objects are rendered separately to obtain the i+1th group of video frames of the virtual scene.
[0157] Similarly, if the frame consumption is greater than the frame consumption threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to L.
[0158] Obtain the correspondence between importance and importance level, determine the importance level corresponding to each second interactive object according to the importance and the correspondence corresponding to each second interactive object, divide multiple second interactive objects according to the importance level corresponding to each second interactive object, and obtain second object sets corresponding to each importance level, so that second interactive objects in the same second object set correspond to the same importance level.
[0159] The plurality of second object sets are sorted from small to large according to the importance, and a fourth arrangement order of the plurality of second object sets is obtained, so that in the process of rendering the i+1th group of video frames of the virtual scene, the respective video frames are rendered according to the importance of the L interactive objects included in the second interactive objects and the reduced detail level corresponding to the L interactive objects, respectively, to obtain the i+1th group of video frames of the virtual scene. The interactive objects included in the first l second object sets in the fourth arrangement order are rendered respectively, to obtain the lth video frame in the i+1th group of video frames, and the second interactive objects at the same importance level are rendered in the same video frame, where l is a positive integer less than or equal to L.
[0160] For example, in the process of rendering the M video frames included in the i+1th group of video frames, for the first video frame, the first second object set is selected from the fourth arrangement order, and the rendering is performed based on the second interactive objects included in the second object set and the corresponding reduced detail levels, so as to obtain the first video frame. For the second video frame, the first and second second object sets are selected from the fourth arrangement order, and the rendering is performed based on the second interactive objects included in the first and second second object sets and the corresponding reduced detail levels, so as to obtain the second video frame. And so on, until the M video frames of the i+1th group of video frames are obtained.
[0161] It should be noted that since M is greater than or equal to L, if M is greater than L, then for the L+1th video frame to the Mth video frame in the i+1th group of video frames, each video frame is no longer rendered with an additional interactive object of a higher importance level compared to the previous video frame. Instead, all first interactive objects are rendered separately to obtain the i+1th group of video frames of the virtual scene.
[0162] Therefore, compared with method one, in method two, each video frame renders one more interactive object of a rendering level than the previous video frame, that is, each rendering only upgrades or reduces the detail level of the interactive object, so that interactive objects at the same importance level can be upgraded or reduced together, thereby avoiding large differences in rendering results of multiple interactive objects with similar visual effects, improving the aesthetics of the picture, and enhancing the user experience.
[0163] Method 3: In the (i+1)th group of video frames, all first interactive objects are rendered in each video frame.
[0164] If the frame time is less than the frame time threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to K.
[0165] In the process of rendering the i+1th group of video frames of the virtual scene, each video frame is rendered according to the importance of the K interactive objects included in the first interactive object and the increased detail levels corresponding to the K interactive objects, so as to obtain the i+1th group of video frames of the virtual scene. Each video frame in the i+1th group of video frames renders the K interactive objects, that is, all the first interactive objects are rendered starting from the first video frame until the Mth video frame.
[0166] Similarly, if the frame consumption is greater than the frame consumption threshold, the (i+1)th group of video frames includes M video frames, and M is an integer greater than or equal to L.
[0167] In the process of rendering the i+1th group of video frames of the virtual scene, each video frame is rendered according to the importance of the L interactive objects included in the second interactive object and the increased detail level corresponding to the L interactive objects, so as to obtain the i+1th group of video frames of the virtual scene. Each video frame in the i+1th group of video frames renders the L interactive objects, that is, all the second interactive objects are rendered starting from the first video frame until the Lth video frame.
[0168] Therefore, after obtaining the first interactive object or the second interactive object, when rendering each group of video frames, each video frame will render all the first interactive objects or the second interactive objects. That is, during the rendering process, it is no longer necessary to render one more interactive object per frame. Instead, each video frame renders all the first interactive objects or the second interactive objects, thereby quickly improving the rendering effect and improving the user experience.
[0169] Case 2: Determine the first interactive object or the second interactive object based on performance conditions.
[0170] C1: Determine the time difference between the frame time and the frame time threshold.
[0171] The frame time difference is the difference between the frame time and the frame time threshold, and the frame time difference can reflect the performance of the server. For example, if the frame time difference is positive and the value is large, it means that the computing resources of the server are severely limited; if the frame time difference is negative and the absolute value of the value is large, it means that the computing resources of the server have a large margin.
[0172] C2: The time taken to obtain the inter-level time between each level of detail.
[0173] The inter-level time between detail levels refers to the difference between the frame times required before and after the level of detail changes. Specifically, the inter-level time between detail levels refers to the difference between the frame time required after the detail level is upgraded and the frame time required before the upgrade, or the inter-level time corresponding to the detail level refers to the difference between the frame time required before the detail level is downgraded and the frame time required after the downgrade. For example, the inter-level time between detail level LOD 0 and detail level LOD 1 refers to the difference between the frame time required for detail level LOD 1 and the frame time required for detail level LOD 0.
[0174] The embodiment of the present application does not specifically limit the frame time between each detail level, and those skilled in the art can set it according to actual needs. For example, the inter-level time between detail level LOD 0 and detail level LOD 1 is greater than the inter-level time between detail level LOD 1 and detail level LOD 2.
[0175] If the frame time consumption is less than the frame time consumption threshold, C3 is executed; if the frame time consumption is greater than the frame time consumption threshold, C4 is executed.
[0176] C3: determining a first interactive object from multiple interactive objects according to the time consumption difference, the inter-level time consumption, and the importance of each interactive object in the virtual scene.
[0177] For example, based on the importance of each interactive object in the virtual scene, an interactive object with a higher importance is selected from multiple interactive objects as a pending interactive object, such as first determining the interactive object with the highest importance as the pending interactive object, and then determining the upgrade number of the pending interactive object based on the time consumption between levels within the allowed range of the time consumption difference, such as upgrading to the highest level, upgrading one level, or upgrading a preset number of levels, etc., which is not specifically limited in this application. The pending interactive object is determined as the first interactive object.
[0178] The time difference can also be updated based on the obtained upgrade quantity, thereby obtaining the update time difference. From the interactive objects other than the first interactive object, an interactive object with a higher degree of importance is selected to be determined as a pending interactive object, and then within the range allowed by the update time difference, the upgrade quantity of the pending interactive object is determined based on the inter-level time consumption, and the pending interactive object is also determined as the first interactive object. This process is repeated until the update time difference is 0 or the update time difference can no longer determine the upgrade quantity, and all first interactive objects are obtained.
[0179] For other methods, please refer to method (1) to method (3), which will not be described in detail here.
[0180] C4: determining a second interactive object from the plurality of interactive objects according to the time consumption difference, the inter-level time consumption, and the importance of each interactive object in the virtual scene.
[0181] Similarly, based on the importance of each interactive object in the virtual scene, an interactive object with a lower importance is selected from multiple interactive objects as a pending interactive object, such as first determining the interactive object with the lowest importance as the pending interactive object, and then determining the number of downgrades of the pending interactive object based on the time consumption between levels within the allowed range of the time consumption difference, such as downgrading to the highest level, downgrading by one level, or downgrading by a preset number of levels, etc., which is not specifically limited in this application. The pending interactive object is determined as the second interactive object.
[0182] The time difference can also be updated based on the obtained downgrade quantity, thereby obtaining the updated time difference. An interactive object with a lower degree of importance is selected from the interactive objects other than the second interactive object to be determined as a pending interactive object, and then the downgrade quantity of the pending interactive object is determined based on the inter-level time consumption within the allowed range of the updated time difference, and the pending interactive object is also determined as the second interactive object. This process is repeated until the updated time difference is 0 or the updated time difference can no longer determine the downgrade quantity, and all second interactive objects are obtained.
[0183] For other methods, please refer to method (1) to method (3), which will not be described in detail here.
[0184] Therefore, the time difference between the frame time and the frame time threshold can reflect the usage of the server's computing resources. If the usage of computing resources is low, more first interactive objects and second interactive objects can be determined; if the usage of computing resources is high, fewer first interactive objects and second interactive objects can be determined. Therefore, the number of first interactive objects and second interactive objects is dynamically determined based on the time difference, so that each adjustment is more in line with the hardware performance of the server. Moreover, each adjustment can generally adjust one or more first interactive objects or second interactive objects, the adjustment is more flexible, the adjustment efficiency is higher, and the user experience is higher.
[0185] The embodiments of the present application do not specifically limit the method of determining the first interactive object or the second interactive object based on the time consumption difference, the inter-level time consumption and the importance of each interactive object in the virtual scene. The following three methods are used as examples for explanation.
[0186] Method (1): Do not use cyclic upgrades, and upgrade multiple items at a time.
[0187] D1: Determine the adjustable number of detail levels based on the time difference and the time between levels.
[0188] If the time between multiple levels of detail is equal, the adjustable number of detail levels can be determined based on the time difference and the time between levels. The adjustable number refers to the number of levels that can be used for upgrading or downgrading, such as 10 levels can be upgraded based on the current computer resources of the server.
[0189] If the frame time consumption is less than the frame time consumption threshold, D2-D4 are executed; if the frame time consumption is greater than the frame time consumption threshold, D5-D7 are executed.
[0190] D2: From among the multiple interactive objects, determine the most important interactive object as the first target object, obtain the detail level of the first target object, and determine the upgrade quantity of the first target object according to the difference between the detail level of the first target object and the highest level;
[0191] First, the interactive object with the highest importance is determined as the first target object, the detail level of the first target object is obtained, and the upgrade quantity of the first target object is determined according to the difference between the detail level of the first target object and the highest level.
[0192] For example, the detail level of the first target object can be upgraded to the highest level and the upgrade quantity can be determined based on the difference between the detail level of the first target object and the highest level. Alternatively, if the detail level of the first target object is upgraded by a preset number of levels and the detail level of the first target object has not reached the highest level, the preset number of levels can be determined as the upgrade quantity. Alternatively, if the detail level of the first target object is not the highest level, one level can be used as the upgrade quantity, and the present application does not make any specific limitations on this.
[0193] D3: If the sum of the upgrade quantities of the first target object is less than the adjustable quantity, the interactive object with the highest importance among the interactive objects with less importance than the first target object is determined as the first target object, and D2 and D3 are executed until the sum of the upgrade quantities of the first target object is greater than or equal to the adjustable quantity, thereby obtaining the first interactive object.
[0194] For example, multiple interactive objects can be respectively selected as the first target object in the order of importance from large to small. Specifically, the interactive object with the highest importance is selected as the first target object for the first time, the interactive object with the second highest importance is selected as the first target object for the second time, and the interactive object with the third highest importance is selected as the first target object for the third time, which is equivalent to selecting the interactive object with the highest importance as the first target object from the interactive objects smaller than the two interactive objects as the first target object.
[0195] After step D2, there is only one first interactive object at this time. If the upgrade quantity of the first interactive object is less than the adjustable quantity, the first target object is continued to be determined, that is, the interactive object with the second highest importance is determined as the first target object, and the above operations are performed to obtain the upgrade quantity of the interactive object with the second highest importance. At this time, there are multiple first interactive objects. If the sum of the upgrade quantities of multiple first interactive objects is less than the adjustable quantity, the first target object is continued to be determined, and the above operations are repeated, which will not be repeated here.
[0196] If the sum of the upgrade numbers of all first interactive objects is greater than or equal to the adjustable number, the first target object will no longer be determined, but the first interactive object will be obtained based on the currently existing first target object. For example, if the sum of the upgrade numbers of all first interactive objects is equal to the adjustable number, all first interactive objects will be determined as first interactive objects. For another example, if the sum of the upgrade numbers of all first interactive objects is greater than the adjustable number, the upgrade number of the last interactive object will be controlled so that the sum of the upgrade numbers of all first target objects is equal to or less than the adjustable number, thereby obtaining the first interactive object. For another example, if the sum of the upgrade numbers of all first interactive objects is greater than the adjustable number, the first interactive object will be obtained after removing the last first target object from multiple first target objects, etc. This application does not make specific limitations on this.
[0197] D4: increasing the detail level of the first interactive object according to the upgrade quantity of the first interactive object to obtain an increased detail level of the first interactive object.
[0198] If there are multiple first interactive objects, the detail level of each first interactive object is increased according to the upgraded number of each first interactive object, so as to obtain the increased detail level of each first interactive object.
[0199] D5: Determine the least important interactive object among the multiple interactive objects as the second target object, obtain the detail level of the second target object, and determine the degradation amount of the second target object according to the difference between the detail level of the second target object and the lowest level.
[0200] First, the interactive object with the lowest importance is determined as the second target object, the detail level of the second target object is obtained, and the upgrade quantity of the second target object is determined according to the difference between the detail level of the second target object and the lowest level.
[0201] For example, the detail level of the second target object can be downgraded to the lowest level and the downgrade amount can be determined based on the difference between the detail level of the second target object and the lowest level. Alternatively, if the detail level of the second target object is downgraded by a preset number of levels and the detail level of the second target object has not reached the lowest level, the preset number of levels can be determined as the downgrade amount. Alternatively, if the detail level of the second target object is not the lowest level, one level can be used as the downgrade amount, and the present application does not make any specific limitations on this.
[0202] D6: If the sum of the downgraded numbers of the second target objects is less than the adjustable number, then the interactive object with the lowest importance among the interactive objects with greater importance than the second target object is determined as the second target object, D5 and D6, until the sum of the downgraded numbers of the second target objects is greater than or equal to the adjustable number, and the second interactive object is obtained.
[0203] For example, multiple interactive objects can be arranged in order from small to large importance as the second target object. Specifically, the interactive object with the lowest importance is selected as the second target object for the first time, the interactive object with the second lowest importance is selected as the second target object for the second time, and the interactive object with the third lowest importance is selected as the second target object for the third time, which is equivalent to selecting the interactive object with the lowest importance from the interactive objects larger than the two interactive objects as the second target object to determine as the second target object.
[0204] After step D5, there is only one second interactive object at this time. If the number of downgrades of the second interactive object is less than the adjustable number, the second target object is determined, that is, the interactive object with the second lowest importance is determined as the second target object, and the above operations are performed to obtain the number of downgrades of the interactive object with the second lowest importance. At this time, there are multiple second interactive objects. If the sum of the number of downgrades of multiple second interactive objects is less than the adjustable number, the second target object is determined, and the above operations are repeated, which will not be repeated here.
[0205] If the sum of the downgraded numbers of all second interactive objects is greater than or equal to the adjustable number, the second target object will no longer be determined, but the second interactive object will be obtained based on the currently existing second target object. For example, if the sum of the downgraded numbers of all second interactive objects is equal to the adjustable number, all second interactive objects will be determined as second interactive objects. For another example, if the sum of the downgraded numbers of all second interactive objects is greater than the adjustable number, the upgrade numbers of the last two interactive objects will be controlled so that the sum of the upgrade numbers of all second target objects is equal to or less than the adjustable number, thereby obtaining a second interactive object. For another example, if the sum of the downgraded numbers of all second interactive objects is greater than the adjustable number, the second interactive object will be obtained after removing the last second target object from multiple second target objects, etc. This application does not make specific limitations on this.
[0206] D6: reducing the detail level of the second interactive object according to the degradation amount of the second interactive object to obtain a reduced detail level of the second interactive object.
[0207] If there are multiple second interactive objects, the detail level of each second interactive object is correspondingly reduced according to the number of the degraded second interactive objects to obtain the reduced detail level of each second interactive object.
[0208] Therefore, through the time difference and the time consumption between levels, multiple first interactive objects can be determined at one time, so that the multiple first interactive objects can be upgraded or downgraded in batches later, thereby fully utilizing the computing resources of the server while quickly improving the rendering effect and enhancing the user experience.
[0209] Method (2): Use cyclic upgrade, upgrading one at a time.
[0210] If the frame time is less than the frame time threshold, the interactive object with the highest importance is determined as the first interactive object according to the importance of each interactive object in the virtual scene, that is, the number of the first interactive object is one; the detail level of the first interactive object is increased by one level to obtain an increased detail level. In the process of rendering the i+1th group of video frames of the virtual scene, for the first video frame in the i+1th group of video frames, the first interactive object is rendered based on the increased detail level to obtain the first video frame in the i+1th group of video frames.
[0211] The frame time is determined based on the first video frame in the i+1th group of video frames. For example, taking each group of video frames including 15 video frames as an example, the frame time of the first group of video frames can be the average value of the frame time of the first video frame to the frame time of the fifteenth video frame. The first video frame in the second group of video frames is the sixteenth video frame, and the frame time determined based on the sixteenth video frame can be the sixteenth video frame, or can be the average value of the frame time of the second video frame to the sixteenth video frame, etc., and the present application does not make specific limitations on this.
[0212] If the frame time determined according to the first video frame in the i+1th group of video frames is less than the frame time threshold, the importance of each interactive object in the virtual scene is calculated again, and the interactive object with the highest importance is determined as the first interactive object, that is, the number of the first interactive object is one; the detail level of the first interactive object is increased to obtain an increased detail level. In the process of rendering the i+1th group of video frames of the virtual scene, for the second video frame in the i+1th group of video frames, the first interactive object is rendered based on the increased detail level to obtain the second video frame in the i+1th group of video frames, and so on, until the i+1th group of video frames is obtained.
[0213] Similarly, if the frame time is greater than the frame time threshold, then according to the importance of each interactive object in the virtual scene, the interactive object with the lowest importance is determined as the second interactive object, that is, the number of the second interactive object is one; the detail level of the second interactive object is reduced by one level to obtain a reduced detail level. In the process of rendering the i+1th group of video frames of the virtual scene, for the first video frame in the i+1th group of video frames, the second interactive object is rendered based on the reduced detail level to obtain the second video frame in the i+1th group of video frames.
[0214] The frame time is determined according to the second video frame in the i+1th group of video frames. If the frame time determined according to the first video frame in the i+1th group of video frames is greater than the frame time threshold, the importance of each interactive object in the virtual scene is calculated again, and the interactive object with the lowest importance is determined as the second interactive object, that is, the number of second interactive objects is one; the detail level of the second interactive object is reduced to obtain a reduced detail level. In the process of rendering the i+1th group of video frames of the virtual scene, for the second video frame in the i+1th group of video frames, the second interactive object is rendered based on the reduced detail level to obtain the second video frame in the i+1th group of video frames. And so on, until the i+1th group of video frames is obtained.
[0215] Therefore, each video frame only upgrades or downgrades one interactive object, and each interactive object is only upgraded or downgraded by one level. Through loop calculation, each loop can accurately adjust the most important or least important interactive object, while being able to more accurately utilize the server's computing resources, improve rendering effects, and thus improve user experience.
[0216] Method (3): Use cyclic upgrade to upgrade multiple items at a time.
[0217] Compared with method (2), method (3) no longer adjusts only one interactive object each time during each cycle of calculation, but adjusts multiple interactive objects while satisfying the computing resources of the server, thereby improving the adjustment speed. The following is a detailed description.
[0218] If the frame time is less than the frame time threshold, then according to the importance of each interactive object in the virtual scene, multiple interactive objects with higher importance are determined as first interactive objects, that is, the number of first interactive objects is multiple; the detail level of each first interactive object is increased respectively, and the increased detail level corresponding to each first interactive object is obtained. In the process of rendering the i+1th group of video frames of the virtual scene, for the first video frame in the i+1th group of video frames, the first interactive objects are rendered respectively based on the increased detail levels to obtain the first video frame in the i+1th group of video frames.
[0219] Determine the frame time based on the first video frame in the i+1th group of video frames. If the frame time determined based on the first video frame in the i+1th group of video frames is less than the frame time threshold, calculate the importance of each interactive object in the virtual scene again, and determine multiple interactive objects with higher importance as first interactive objects, that is, the number of first interactive objects is multiple; increase the detail level of each first interactive object respectively, and obtain the increased detail level corresponding to each first interactive object. In the process of rendering the i+1th group of video frames of the virtual scene, for the second video frame in the i+1th group of video frames, render the first interactive objects respectively based on the increased detail levels to obtain the second video frame in the i+1th group of video frames. And so on, until the i+1th group of video frames is obtained.
[0220] Similarly, if the frame time is greater than the frame time threshold, then multiple interactive objects with lower importance are determined as second interactive objects according to the importance of each interactive object in the virtual scene, that is, the number of second interactive objects is multiple; the detail levels of the multiple second interactive objects are respectively reduced to obtain the reduced detail level of each second interactive object. In the process of rendering the i+1th group of video frames of the virtual scene, for the first video frame in the i+1th group of video frames, each second interactive object is rendered based on each reduced detail level to obtain the second video frame in the i+1th group of video frames.
[0221] The frame time is determined according to the second video frame in the i+1th group of video frames. If the frame time determined according to the first video frame in the i+1th group of video frames is greater than the frame time threshold, the importance of each interactive object in the virtual scene is calculated again, and multiple interactive objects with lower importance are determined as second interactive objects, that is, the number of second interactive objects is multiple; the detail level of the multiple second interactive objects is reduced respectively to obtain the reduced detail level of each second interactive object. In the process of rendering the i+1th group of video frames of the virtual scene, for the first video frame in the i+1th group of video frames, each second interactive object is rendered based on each reduced detail level to obtain the second video frame in the i+1th group of video frames. And so on, until the i+1th group of video frames is obtained.
[0222] It should be noted that the number of first interactive objects and the number of second interactive objects are determined based on the time-consuming difference to prevent a large number of first interactive objects or second interactive objects from limiting the computing resources of the server.
[0223] Therefore, each video frame can upgrade or downgrade multiple interactive objects, and each interactive object is only upgraded or downgraded by one level. Then, through loop calculation, each loop can accurately adjust multiple interactive objects with higher or lower importance. While being able to more accurately utilize the server's computing resources, it improves rendering effect and rendering speed, thereby improving user experience.
[0224] If rendering is performed directly from one detail level to another detail level, that is, direct replacement without transition, problems such as insufficient smoothness of the switching effect may occur. In order to improve the rendering effect, the present application embodiment provides a transition method. The following is a detailed description, see E1-E6.
[0225] If the frame time consumption is less than the frame time consumption threshold, E1-E3 are executed; if the frame time consumption is greater than the frame time consumption threshold, E4-E6 are executed.
[0226] E1: Obtain a first historical detail level of a first interactive object in rendering an i-th group of video frames.
[0227] The first historical detail level is the detail level last used to render the first interactive object. Taking the example of using the same detail level for each group of video frames, relative to the i+1th group of video frames, the detail level last used to render the first interactive object is the detail level used to render the ith group of video frames, that is, the first historical detail level.
[0228] E2: A first intermediate level of detail is obtained according to the first historical level of detail and the elevated level of detail.
[0229] The first historical detail level is the detail level used for the last rendering of the first interactive object, and the increased detail level is the detail level used for the next rendering of the first interactive object. The first intermediate detail level can be obtained according to the first historical detail level and the increased detail level.
[0230] The number of model vertices corresponding to the first intermediate detail level is less than the number of model vertices corresponding to the ascending detail level, and the number of model vertices corresponding to the first intermediate detail level is greater than the number of model vertices corresponding to the first historical detail level.
[0231] As a possible implementation, the number of model faces corresponding to the first intermediate detail level is less than the number of model faces corresponding to the ascending detail level, and the number of model faces corresponding to the first intermediate detail level is greater than the number of model faces corresponding to the first historical detail level.
[0232] The embodiment of the present application does not specifically limit the manner of obtaining the first intermediate detail level according to the first historical detail level and the elevated detail level, such as obtaining the first intermediate detail level by interpolating the first historical detail level and the elevated detail level, etc. For example, the vertex positions of each vertex are obtained by interpolating the first historical detail level and the elevated detail level, thereby obtaining a face based on the vertex position, and then obtaining the model of the first interactive object.
[0233] The embodiment of the present application does not specifically limit the number of the first intermediate detail levels, which may be one or more, and those skilled in the art may define it according to actual needs.
[0234] E3: In the process of rendering the i+1th group of video frames of the virtual scene, the first interactive object is rendered based on the first intermediate detail level and the increased detail level to obtain the i+1th group of video frames of the virtual scene.
[0235] The first video frame in the i+1th group of video frames is rendered based on the first intermediate detail level, the second video frame in the i+1th group of video frames is rendered based on the increased detail level, and the second video frame is a video frame after the first video frame. That is to say, in the i+1th group of video frames, the first interactive object is first rendered based on the first intermediate detail level, and then rendered based on the increased detail level, so that transition rendering is achieved through the first intermediate detail level rendering, thereby improving the rendering effect.
[0236] E4: Obtain a second historical detail level of the second interactive object when rendering the i-th group of video frames.
[0237] The second historical detail level is the detail level last used to render the second interactive object. Taking the example of using the same detail level for each group of video frames, relative to the i+1th group of video frames, the detail level last used to render the second interactive object is the detail level used to render the ith group of video frames, i.e., the second historical detail level.
[0238] E5: A second intermediate level of detail is obtained according to the second historical level of detail and the reduced level of detail.
[0239] The second historical detail level is the detail level used for the last rendering of the second interactive object, and the reduced detail level is the detail level used for the next rendering of the second interactive object. The second intermediate detail level can be obtained according to the second historical detail level and the reduced detail level.
[0240] The number of model vertices corresponding to the second intermediate detail level is greater than the number of model vertices corresponding to the reduced detail level, and the number of model vertices corresponding to the second intermediate detail level is less than the number of model vertices corresponding to the first historical detail level. For example, by interpolating the second historical detail level and the reduced detail level, the vertex position of each vertex is obtained, thereby obtaining a face based on the vertex position, and then obtaining the model of the second interactive object.
[0241] As a possible implementation, the number of model faces corresponding to the second intermediate detail level is greater than the number of model faces corresponding to the reduced detail level, and the number of model faces corresponding to the second intermediate detail level is less than the number of model faces corresponding to the second historical detail level.
[0242] The embodiment of the present application does not specifically limit the manner of obtaining the second intermediate detail level according to the second historical detail level and the reduced detail level, such as obtaining the second intermediate detail level by interpolating the second historical detail level and the reduced detail level.
[0243] The embodiment of the present application does not specifically limit the number of the second intermediate detail levels, which may be one or more, and those skilled in the art may define it according to actual needs.
[0244] E6: In the process of rendering the i+1th group of video frames of the virtual scene, render the second interactive object based on the second intermediate detail level and the reduced detail level to obtain the i+1th group of video frames of the virtual scene.
[0245] Among them, the third video frame in the i+1th group of video frames is obtained by rendering based on the second intermediate detail level, and the fourth video frame in the i+1th group of video frames is obtained by rendering based on the second intermediate detail level, and the fourth video frame is a video frame after the third video frame. That is to say, in the i+1th group of video frames, the second interactive object is first rendered based on the second intermediate detail level, and then the second interactive object is rendered based on the reduced detail level, so that transition rendering is achieved through the second intermediate detail level rendering, thereby improving the rendering effect.
[0246] Therefore, during the rendering process, rendering can be performed first based on the first intermediate detail level or the second intermediate detail level, and then based on increasing the detail level or decreasing the detail level, thereby achieving transition rendering through the first intermediate detail level or the second intermediate detail level, avoiding problems such as insufficiently smooth switching effects, improving rendering effects, and improving user experience.
[0247] In order to facilitate further understanding of the technical solution provided by the embodiments of the present application, the following is an overall exemplary introduction to the rendering method of the virtual scene provided by the embodiments of the present application, taking the execution subject of the rendering method of the virtual scene provided by the embodiments of the present application as a terminal device (i.e., a rendering device) as an example.
[0248] See also Figure 5 , which is a schematic diagram of an application of a virtual scene rendering method provided by an embodiment of the present application. Figure 5 , the rendering process of the virtual scene is divided into 5 stages, see S501-S505 for details.
[0249] S501: Acquire performance data.
[0250] The performance data includes data used to determine whether to upgrade or downgrade, and the rendering of the i+1th group of video frames of the virtual scene is continued as an example for explanation.
[0251] The frame time threshold corresponding to the virtual scene is obtained and the frame time of the i-th group of video frames of the virtual scene is obtained by rendering. In the embodiment of the present application, each group of video frames includes multiple video frames, and all time consumptions can be refreshed and counted every second in the main logic of the game. Each time the data is refreshed, the thread status statistics in the game are obtained first, and the latest time-consuming data packet is obtained. The obtained data packets are traversed and parsed one by one in a loop, and the frame time of each video frame in the i-th group of video frames is obtained according to the name, so that the frame time of the i-th group of video frames is obtained by taking the average of the frame time of all video frames included in the i-th group of video frames.
[0252] The various rendering devices are divided into three categories, namely low-end, mid-end and high-end. Different categories correspond to different frame time thresholds. As the hardware performance of the rendering device increases, the frame time threshold becomes smaller, that is, a mapping relationship between the category and the frame time threshold is established, the number of mapping relationships established is reduced, and the workload is reduced.
[0253] See Table 3, which is a table of frame time consumption thresholds provided in an embodiment of the present application.
[0254] Table 3
[0255] Types of rendering devices Virtual Scene Frame rate threshold Frame time threshold Low-end machine Hundred-man team battle 25 frames 40 ms Mid-range Hundred-man team battle 40 fps 25 ms High-end machine Hundred-man team battle 60 fps 16 ms
[0256] After obtaining the target device model of the rendering device, the device category of the rendering device is determined based on the target device model, thereby determining its corresponding frame time threshold. The frame time threshold is the reciprocal of the frame rate threshold. Compared with the frame rate threshold, the terminal device is easier to process the frame time threshold, thereby improving processing efficiency.
[0257] S502: Determine whether the detail level of the interactive object is upgraded or downgraded.
[0258] According to the relationship between the frame time and the frame time threshold, it is determined whether the detail level is upgraded or downgraded. Specifically, if the frame time is less than the frame time threshold, the detail level is upgraded; if the frame time is greater than the frame time threshold, the detail level is downgraded.
[0259] For example, if the frame time of the low-end machine is less than 40 milliseconds, it is upgraded; if the frame time of the low-end machine is more than 40 milliseconds, it is downgraded.
[0260] S503: Determine the importance of the interactive object.
[0261] The importance of the interactive object can be determined based on the aforementioned method A1-A2, that is, based on one or more combinations of the movement speed of the interactive object in the virtual scene, the screen ratio of the interactive object in the video frame corresponding to the virtual scene, and the position of the interactive object in the virtual scene.
[0262] S504: Determine the adjusted detail level of the interactive object according to the importance.
[0263] If the frame time is less than the frame time threshold, the level is upgraded. Specifically, the importance of each interactive object in the virtual scene is sorted in descending order to obtain a first sorting order. Based on the first sorting order, the most important interactive object is determined from multiple interactive objects and used as the first interactive object. If the detail level of the first interactive object is not the highest level, the detail level of the first interactive object is increased by one level to obtain an increased detail level. In addition, only one first interactive object will be upgraded each time, such as the current LOD level is reduced by one, and when the next determination allows for continued upgrading, the upgrade can continue.
[0264] If the frame time is greater than the frame time threshold, downgrade. Specifically, sort the interactive objects in the virtual scene in ascending order according to their importance to obtain a second arrangement order, and determine the interactive object with the lowest importance from the multiple interactive objects based on the second arrangement order, and use it as the second interactive object. If the detail level of the second interactive object is not the lowest level, the detail level of the second interactive object is reduced by one level to obtain a reduced detail level. In addition, only one second interactive object will be downgraded each time, such as adding one to the current LOD level. When the next determination allows for continued downgrade, the downgrade can continue.
[0265] For related details, please refer to the aforementioned B1-B5. In addition, the detail level can also be adjusted using the aforementioned C1-C4 methods, which will not be repeated here.
[0266] S505: Transition rendering of the virtual scene.
[0267] If the frame time is less than the frame time threshold, the first interactive object is transition-rendered based on the first intermediate detail level, that is, the first interactive object is first rendered based on the first intermediate detail level, and then the first interactive object is rendered based on the increased detail level, thereby obtaining the i+1th group of video frames.
[0268] If the frame time is greater than the frame time threshold, the second interactive object is transitionally rendered based on the second intermediate detail level, that is, the second interactive object is first rendered based on the second intermediate detail level, and then the second interactive object is rendered based on the reduced detail level, thereby obtaining the i+1th group of video frames.
[0269] For relevant details, please refer to the aforementioned E1-E6, which will not be repeated here.
[0270] See Table 4, which is a table of rendering effects provided in an embodiment of the present application.
[0271] Table 4
[0272]
[0273] Among them, for the virtual scene of a hundred-person team battle, terminal devices of various categories, low, medium and high, have different degrees of improvement in different frame rates. Among them, low-end devices have increased by 11.1%, mid-range devices have increased by 21.7%, and high-end devices have increased by 25%.
[0274] Therefore, the embodiment of the present application takes into account the visual effects of motion by determining the importance of the interactive objects in the game, and determines the upgrade or downgrade of the level of detail of the interactive objects based on the importance and the hardware performance of the terminal device. When the computing resources of the terminal device (such as a smart phone) are sufficient, the interactive objects will be displayed at an upgraded LOD. When the computing resource performance of the terminal device cannot support the current multiple interactive objects, the interactive objects will be displayed at a downgraded LOD, thereby achieving adaptive adjustment of the display effect. Moreover, in the process of rendering the interactive objects, the rendering is performed in a transitional manner to improve the rendering effect. This can help the interactive objects to achieve the maximum performance as much as possible while ensuring the hardware performance during the overall operation, with an improvement of 11%-25% on different models, thereby greatly improving the expressiveness of the game.
[0275] With respect to the virtual scene rendering method described above, the present application also provides a corresponding virtual scene rendering device, so that the virtual scene rendering method described above can be applied and implemented in practice.
[0276] See also Figure 6 , which is a schematic diagram of the structure of a virtual scene rendering device provided in an embodiment of the present application. Figure 6 As shown, the virtual scene rendering device 600 includes: an acquisition unit 601, an upgrade unit 602 and a degradation unit 603;
[0277] The acquisition unit 601 is used to acquire a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer;
[0278] The upgrading unit 602 is configured to, if the frame time is less than the frame time threshold, determine a first interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; increase the detail level of the first interactive object to obtain an increased detail level; and in the process of rendering the i+1th group of video frames of the virtual scene, render the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene;
[0279] The degradation unit 603 is used to determine a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene if the frame time is greater than the frame time threshold; reduce the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, render the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
[0280] It can be seen from the above technical solution that the rendering unit of the virtual scene provided in the embodiment of the present application includes an acquisition unit, an upgrade unit and a downgrade unit. The acquisition unit is used to acquire the frame time threshold corresponding to the virtual scene and the frame time of rendering the i-th group of video frames of the virtual scene. The upgrade unit is used to determine the first interactive object with a higher degree of importance from the multiple interactive objects included in the virtual scene according to the importance of each interactive object in the virtual scene, increase the detail level of the first interactive object, obtain the increased detail level, and render the first interactive object based on the increased detail level, thereby obtaining the i+1th group of video frames of the virtual scene. Similarly, the downgrade unit is used to determine the second interactive object with a lower degree of importance from the multiple interactive objects included in the virtual scene according to the importance of each interactive object in the virtual scene, reduce the detail level of the second interactive object, obtain the reduced detail level, and render the second interactive object based on the reduced detail level, thereby obtaining the i+1th group of video frames of the virtual scene. Similarly, the downgrade unit is used to determine the second interactive object with a lower degree of importance from the multiple interactive objects included in the virtual scene according to the importance of each interactive object in the virtual scene, reduce the detail level of the second interactive object, obtain the reduced detail level, and render the second interactive object based on the reduced detail level, thereby obtaining the i+1th group of video frames of the virtual scene.
[0281] Therefore, if the current computing resources are sufficient, the detail level of more important interactive objects is increased and rendered first; if the current computing resources are limited, the detail level of less important interactive objects is decreased and rendered first. In other words, the detail level of interactive objects is dynamically adjusted according to changes in hardware performance, and interactive objects that can improve the rendering effect are selected from multiple interactive objects based on their importance for adjustment, thereby improving the utilization of hardware performance and achieving a higher rendering effect within limited hardware performance. In addition, in the process of rendering the virtual scene, only the interactive objects are adjusted instead of all virtual objects in the virtual scene, further improving the utilization of hardware performance.
[0282] As a possible implementation manner, the device further includes an importance determination unit, which is used to:
[0283] Acquire a visual impact factor of each of the interactive objects in the virtual scene, wherein the visual impact factor includes one or more combinations of a movement speed, a screen ratio, and a position of the interactive object in the virtual scene;
[0284] Determining the importance of the interactive object according to the visual influencing factors;
[0285] Among them, the higher the speed range of the interactive object's movement speed in the virtual scene, the higher the importance of the interactive object; the higher the screen ratio range of the interactive object in the virtual scene, the higher the importance of the interactive object; the higher the degree range of the centralization of the interactive object's position in the virtual scene, the higher the importance of the interactive object.
[0286] As a possible implementation manner, if the visual influencing factor includes the screen ratio, the importance determination unit is specifically configured to:
[0287] If the zoom operation is not performed, the main screen ratio is determined according to the distance between the virtual camera corresponding to the controlled object and the non-controlled object in the virtual scene, and the importance of the non-controlled object is determined according to the main screen ratio, the controlled object is an interactive object among the multiple interactive objects, and the non-controlled object is an interactive object among the multiple interactive objects except the controlled object;
[0288] If the zoom operation is performed, the distance between the virtual camera corresponding to the split screen generated by the zoom operation and the non-controlled object in the virtual scene is determined, the split screen ratio is determined, and the importance of the non-controlled object is determined according to the split screen ratio.
[0289] As a possible implementation, the acquisition unit 601 is further configured to acquire the importance of each of the interactive objects in the virtual scene;
[0290] The upgrading unit 602 is specifically used for:
[0291] Sort the multiple interactive objects in descending order according to the importance to obtain a first arrangement order for the multiple interactive objects;
[0292] Determine the first K interactive objects ranked in the first arrangement order as the first interactive objects, where K is a positive integer;
[0293] The degradation unit 603 is specifically used for:
[0294] Sort the multiple interactive objects in ascending order according to the importance to obtain a second arrangement order for the multiple interactive objects;
[0295] The first L interaction objects in the second arrangement order are determined as the second interaction objects.
[0296] As a possible implementation manner, if the i+1th group of video frames includes M video frames, the upgrading unit 602 is specifically configured to:
[0297] In the process of rendering the i+1th group of video frames of the virtual scene, rendering each video frame respectively according to the importance of the K interactive objects included in the first interactive object and the increased detail levels respectively corresponding to the K interactive objects, to obtain the i+1th group of video frames of the virtual scene;
[0298] wherein, based on the increased detail levels of the first k interactive objects in the first interactive object, the first k interactive objects are rendered respectively to obtain the kth video frame in the i+1th group of video frames, where k is a positive integer less than or equal to K, and M is an integer greater than or equal to K;
[0299] The degradation unit 603 is specifically used for:
[0300] In the process of rendering the i+1th group of video frames of the virtual scene, rendering each video frame separately according to the importance of the L interactive objects included in the second interactive object and the reduced detail level corresponding to the L interactive objects, to obtain the i+1th group of video frames of the virtual scene;
[0301] Among them, based on the reduced detail level of the first l interactive objects in the second interactive object, the first l interactive object is rendered to obtain the lth video frame in the i+1th group of video frames, where l is the number of frames less than or equal to L, and M is an integer greater than or equal to L.
[0302] As a possible implementation, the acquisition unit 601 is further used to acquire a corresponding relationship between importance and importance level;
[0303] The upgrading unit 602 is specifically used for:
[0304] Determining the importance level corresponding to each of the first interactive objects according to the importance levels corresponding to each of the first interactive objects and the corresponding relationship;
[0305] Dividing the plurality of first interactive objects according to the importance levels respectively corresponding to the first interactive objects, to obtain first object sets respectively corresponding to the importance levels, and first interactive objects in the same first object set correspond to the same importance level;
[0306] Sorting the plurality of first object sets from greatest to least importance to obtain a third arrangement order;
[0307] Rendering the interactive objects included in the first k sets of first objects in the third arrangement order respectively to obtain the kth video frame in the (i+1)th group of video frames, and the first interactive objects at the same importance level are rendered in the same video frame;
[0308] The degradation unit 603 is specifically used for:
[0309] Determining the importance level corresponding to each of the second interactive objects according to the importance level corresponding to each of the second interactive objects and the corresponding relationship;
[0310] Dividing the plurality of second interactive objects according to the importance levels respectively corresponding to the second interactive objects to obtain second object sets respectively corresponding to the importance levels, and second interactive objects in the same second object set correspond to the same importance level;
[0311] Sorting the plurality of second object sets in ascending order of importance to obtain a fourth arrangement order;
[0312] The interactive objects included in the first l second object sets in the fourth arrangement order are rendered respectively to obtain the lth video frame in the i+1th group of video frames, and the second interactive objects at the same importance level are rendered in the same video frame.
[0313] As a possible implementation manner, the device further includes a determining unit, configured to determine a time difference between the frame time and the frame time threshold;
[0314] The acquisition unit 601 is further used to acquire the time consumption between each level of detail;
[0315] The upgrading unit 602 is specifically configured to determine the first interactive object from the multiple interactive objects according to the time consumption difference, the inter-level time consumption and the importance of each interactive object in the virtual scene;
[0316] The degradation unit 603 is specifically configured to determine the second interactive object from the multiple interactive objects according to the time consumption difference, the inter-level time consumption, and the importance of each of the interactive objects in the virtual scene.
[0317] As a possible implementation, the upgrading unit 602 is specifically configured to:
[0318] Determining an adjustable number of detail levels according to the time consumption difference and the inter-level time consumption;
[0319] From the plurality of interactive objects, determine the interactive object with the highest importance as a first target object, obtain a detail level of the first target object, and determine an upgrade quantity of the first target object according to a difference between the detail level of the first target object and a highest level;
[0320] If the sum of the upgrade quantities of the first target object is less than the adjustable quantity, then, from the interactive objects whose importance is less than that of the first target object, the interactive object with the highest importance is determined as the first target object, and the step of obtaining the detail level of the first target object and subsequent steps are performed until the sum of the upgrade quantities of the first target object is greater than or equal to the adjustable quantity, thereby obtaining the first interactive object;
[0321] increasing the detail level of the first interactive object according to the upgrade quantity of the first interactive object, thereby obtaining an increased detail level of the first interactive object;
[0322] The degradation unit 603 is specifically used for:
[0323] Determining an adjustable amount of detail level according to the time consumption difference and the frame consumption;
[0324] From the plurality of interactive objects, determine the interactive object with the lowest importance as a second target object, obtain the detail level of the second target object, and determine the degradation amount of the second target object according to the difference between the detail level of the second target object and the lowest level;
[0325] If the sum of the degradation numbers of the second target objects is less than the adjustable number, determining the least important interactive object as the second target object from the interactive objects whose importance is greater than the second target object, and performing the step of obtaining the detail level of the second target object and subsequent steps until the sum of the degradation numbers of the second target objects is greater than or equal to the adjustable number, thereby obtaining the second interactive object;
[0326] The detail level of the second interactive object is reduced according to the degradation amount of the second interactive object to obtain a reduced detail level of the second interactive object.
[0327] As a possible implementation, the upgrading unit 602 is specifically configured to:
[0328] Obtaining a first historical detail level of the first interactive object in rendering the i-th group of video frames;
[0329] A first intermediate level of detail is obtained according to the first historical level of detail and the elevated level of detail, wherein the number of model vertices corresponding to the first intermediate level of detail is smaller than the number of model vertices corresponding to the elevated level of detail, and the number of model vertices corresponding to the first intermediate level of detail is larger than the number of model vertices corresponding to the first historical level of detail;
[0330] In the process of rendering the i+1th group of video frames of the virtual scene, the first interactive object is rendered based on the first intermediate detail level and the increased detail level to obtain the i+1th group of video frames of the virtual scene; wherein the first video frame in the i+1th group of video frames is obtained by rendering based on the first intermediate detail level, the second video frame in the i+1th group of video frames is obtained by rendering based on the increased detail level, and the second video frame is a video frame after the first video frame;
[0331] The degradation unit 603 is specifically used for:
[0332] Obtaining a second historical detail level of the second interactive object in rendering the i-th group of video frames;
[0333] A second intermediate level of detail is obtained according to the second historical level of detail and the reduced level of detail, wherein the number of model vertices corresponding to the second intermediate level of detail is greater than the number of model vertices corresponding to the reduced level of detail, and the number of model vertices corresponding to the second intermediate level of detail is less than the number of model vertices corresponding to the second historical level of detail;
[0334] In the process of rendering the i+1th group of video frames of the virtual scene, the second interactive object is rendered based on the second intermediate detail level and the reduced detail level to obtain the i+1th group of video frames of the virtual scene; wherein the third video frame in the i+1th group of video frames is rendered based on the second intermediate detail level, the fourth video frame in the i+1th group of video frames is rendered based on the second intermediate detail level, and the fourth video frame is a video frame after the third video frame.
[0335] As a possible implementation manner, the acquisition unit 601 is further configured to acquire the frame time consumption of each of the video frames included in the i-th group of video frames;
[0336] The device also includes a determining unit, which is used to obtain the frame consumption of the i-th group of video frames of the virtual scene according to the average value of the frame consumption of each of the video frames included in the i-th group of video frames.
[0337] As a possible implementation, the acquisition unit 601 is further used to acquire a target device model of a rendering device, and a mapping relationship between the device model and the frame time threshold;
[0338] The device also includes a determining unit, configured to:
[0339] Determine, according to the mapping relationship, a frame time consumption threshold corresponding to the target device model;
[0340] The frame time consumption threshold corresponding to the target device model is determined as the frame time consumption threshold corresponding to the virtual scene.
[0341] The present application also provides a computer device, which may be a server or a terminal device. The following will introduce the computer device provided by the present application from the perspective of hardware entity. Figure 7 The following is a schematic diagram of the server structure. Figure 8 Shown is a schematic diagram of the structure of the terminal equipment.
[0342] See also Figure 7 , which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more processors 1422, such as central processing units (CPU), memory 1432, one or more application programs 1442 or storage media 1430 (such as one or more massive storage devices) for data 1444. Among them, the memory 1432 and the storage medium 1430 may be temporary storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.
[0343] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0344] The steps performed by the server in the above embodiment can be based on the Figure 7 The server structure shown.
[0345] The processor 1422 is used to perform the following steps:
[0346] Obtaining a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer;
[0347] If the frame time is less than the frame time threshold, determining a first interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; increasing the detail level of the first interactive object to obtain an increased detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene;
[0348] If the frame time is greater than the frame time threshold, determining a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; reducing the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
[0349] Optionally, the processor 1422 may also execute method steps of any specific implementation of the method for rendering a virtual scene in the embodiments of the present application.
[0350] See also Figure 8 , which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Taking the terminal device as a smart phone as an example, Figure 8 The block diagram of the partial structure of the smart phone is shown, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Figure 8 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0351] Combine the following Figure 8 A detailed introduction to the various components of a smartphone:
[0352] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.
[0353] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .
[0354] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0355] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0356] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.
[0357] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.
[0358] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.
[0359] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.
[0360] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0361] In the embodiment of the present application, the memory 1520 included in the smart phone can store a computer program and transmit the computer program to the processor.
[0362] The processor 1580 included in the smart phone can execute the virtual scene rendering method provided in the above embodiment according to the instructions in the computer program.
[0363] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the virtual scene rendering method provided in the above embodiment.
[0364] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute a virtual scene rendering method provided in various optional implementations of the above aspects.
[0365] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.
[0366] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0367] All data collected by this application (such as frame duration, etc.) are collected with the consent and authorization of the object to which the data belongs (such as users, institutions or enterprises), and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0368] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0369] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0370] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for rendering a virtual scene, characterized in that: The method comprises: Obtaining a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer; If the frame time is less than the frame time threshold, determining a first interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; increasing the detail level of the first interactive object to obtain an increased detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene; If the frame time is greater than the frame time threshold, determining a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene; reducing the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, rendering the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a visual impact factor of each of the interactive objects in the virtual scene, wherein the visual impact factor includes one or more combinations of a movement speed, a screen ratio, and a position of the interactive object in the virtual scene; Determining the importance of the interactive object according to the visual influencing factors; Among them, the higher the speed range of the interactive object's movement speed in the virtual scene, the higher the importance of the interactive object; the higher the screen ratio range of the interactive object in the virtual scene, the higher the importance of the interactive object; the higher the degree range of the centralization of the interactive object's position in the virtual scene, the higher the importance of the interactive object.
3. The method according to claim 2, characterized in that If the visual influencing factor includes the screen-to-body ratio, the screen-to-body ratio includes a main screen-to-body ratio and a split screen-to-body ratio, and the method further includes: If the zoom operation is not performed, the main screen ratio is determined according to the distance between the virtual camera corresponding to the controlled object and the non-controlled object in the virtual scene, and the importance of the non-controlled object is determined according to the main screen ratio, the controlled object is an interactive object among the multiple interactive objects, and the non-controlled object is an interactive object among the multiple interactive objects except the controlled object; If the zoom operation is performed, the distance between the virtual camera corresponding to the split screen generated by the zoom operation and the non-controlled object in the virtual scene is determined, the split screen ratio is determined, and the importance of the non-controlled object is determined according to the split screen ratio.
4. The method according to claim 1, characterized in that: The method further comprises: Obtaining the importance of each of the interactive objects in the virtual scene; The step of determining a first interactive object from the plurality of interactive objects according to the importance of each of the interactive objects in the virtual scene comprises: Sort the multiple interactive objects in descending order according to the importance to obtain a first arrangement order for the multiple interactive objects; Determine the first K interactive objects ranked in the first arrangement order as the first interactive objects, where K is a positive integer; The step of determining a second interactive object from the plurality of interactive objects according to the importance of each of the interactive objects in the virtual scene comprises: Sort the multiple interactive objects in ascending order according to the importance to obtain a second arrangement order for the multiple interactive objects; The first L interaction objects in the second arrangement order are determined as the second interaction objects.
5. The method according to claim 4, characterized in that If the i+1th group of video frames includes M video frames, then in the process of rendering the i+1th group of video frames of the virtual scene, rendering the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene includes: In the process of rendering the i+1th group of video frames of the virtual scene, rendering each video frame respectively according to the importance of the K interactive objects included in the first interactive object and the increased detail levels respectively corresponding to the K interactive objects, to obtain the i+1th group of video frames of the virtual scene; wherein, based on the increased detail levels of the first k interactive objects in the first interactive object, the first k interactive objects are rendered respectively to obtain the kth video frame in the i+1th group of video frames, where k is a positive integer less than or equal to K, and M is an integer greater than or equal to K; The step of rendering the second interactive object based on the reduced detail level in the process of rendering the i+1th group of video frames of the virtual scene to obtain the i+1th group of video frames of the virtual scene includes: In the process of rendering the i+1th group of video frames of the virtual scene, rendering each video frame separately according to the importance of the L interactive objects included in the second interactive object and the reduced detail level corresponding to the L interactive objects, to obtain the i+1th group of video frames of the virtual scene; Among them, based on the reduced detail level of the first l interactive objects in the second interactive object, the first l interactive object is rendered to obtain the lth video frame in the i+1th group of video frames, where l is the number of frames less than or equal to L, and M is an integer greater than or equal to L.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining the correspondence between importance and importance level; Determining the importance level corresponding to each of the first interactive objects according to the importance levels corresponding to each of the first interactive objects and the corresponding relationship; Dividing the plurality of first interactive objects according to the importance levels respectively corresponding to the first interactive objects, to obtain first object sets respectively corresponding to the importance levels, and first interactive objects in the same first object set correspond to the same importance level; Sorting the plurality of first object sets from greatest to least importance to obtain a third arrangement order; The rendering of the first k interactive objects respectively based on the increased detail levels of the first k interactive objects in the first interactive objects to obtain the kth video frame in the i+1th group of video frames comprises: Rendering the interactive objects included in the first k sets of first objects in the third arrangement order respectively to obtain the kth video frame in the (i+1)th group of video frames, and the first interactive objects at the same importance level are rendered in the same video frame; Determining the importance level corresponding to each of the second interactive objects according to the importance level corresponding to each of the second interactive objects and the corresponding relationship; Dividing the plurality of second interactive objects according to the importance levels respectively corresponding to the second interactive objects to obtain second object sets respectively corresponding to the importance levels, and second interactive objects in the same second object set correspond to the same importance level; Sorting the plurality of second object sets in ascending order of importance to obtain a fourth arrangement order; The rendering of the first lth interactive object based on the reduced detail level of the first lth interactive object in the second interactive object to obtain the lth video frame in the (i+1)th group of video frames includes: The interactive objects included in the first l second object sets in the fourth arrangement order are rendered respectively to obtain the lth video frame in the i+1th group of video frames, and the second interactive objects at the same importance level are rendered in the same video frame.
7. The method according to claim 1, characterized in that The method further comprises: Determine a time difference between the frame time and the frame time threshold; Obtaining the inter-level time consumption between each of the detail levels; The step of determining a first interactive object from the plurality of interactive objects according to the importance of each of the interactive objects in the virtual scene comprises: Determining the first interactive object from the multiple interactive objects according to the time consumption difference, the inter-level time consumption, and the importance of each of the interactive objects in the virtual scene; The step of determining a second interactive object from the plurality of interactive objects according to the importance of the interactive object in the virtual scene comprises: The second interactive object is determined from the multiple interactive objects according to the time consumption difference, the inter-level time consumption and the importance of each of the interactive objects in the virtual scene.
8. The method according to claim 7, characterized in that The determining the first interactive object from the plurality of interactive objects according to the time consumption difference, the inter-level time consumption and the importance of each of the interactive objects in the virtual scene comprises: Determining an adjustable number of detail levels according to the time consumption difference and the inter-level time consumption; From the plurality of interactive objects, determine the interactive object with the highest importance as a first target object, obtain the detail level of the first target object, and determine the upgrade quantity of the first target object according to the difference between the detail level of the first target object and the highest level; If the sum of the upgrade quantities of the first target object is less than the adjustable quantity, then, from the interactive objects whose importance is less than that of the first target object, the interactive object with the highest importance is determined as the first target object, and the step of obtaining the detail level of the first target object and subsequent steps are performed until the sum of the upgrade quantities of the first target object is greater than or equal to the adjustable quantity, thereby obtaining the first interactive object; The step of increasing the detail level of the first interactive object to obtain an increased detail level includes: increasing the detail level of the first interactive object according to the upgrade quantity of the first interactive object, thereby obtaining an increased detail level of the first interactive object; The determining the second interactive object from the plurality of interactive objects according to the time consumption difference, the inter-level time consumption and the importance of each of the interactive objects in the virtual scene comprises: Determining an adjustable amount of detail level according to the time consumption difference and the frame consumption; From the plurality of interactive objects, determine the interactive object with the lowest importance as a second target object, obtain the detail level of the second target object, and determine the degradation amount of the second target object according to the difference between the detail level of the second target object and the lowest level; If the sum of the degradation numbers of the second target objects is less than the adjustable number, determining the least important interactive object as the second target object from the interactive objects whose importance is greater than the second target object, and performing the step of obtaining the detail level of the second target object and subsequent steps until the sum of the degradation numbers of the second target objects is greater than or equal to the adjustable number, thereby obtaining the second interactive object; The reducing the detail level of the second interactive object to obtain a reduced detail level includes: The detail level of the second interactive object is reduced according to the degradation amount of the second interactive object to obtain a reduced detail level of the second interactive object.
9. The method according to claim 1, characterized in that: The step of rendering the first interactive object based on the increased detail level in the process of rendering the i+1th group of video frames of the virtual scene to obtain the i+1th group of video frames of the virtual scene includes: Obtaining a first historical detail level of the first interactive object in rendering the i-th group of video frames; A first intermediate level of detail is obtained according to the first historical level of detail and the elevated level of detail, wherein the number of model vertices corresponding to the first intermediate level of detail is smaller than the number of model vertices corresponding to the elevated level of detail, and the number of model vertices corresponding to the first intermediate level of detail is larger than the number of model vertices corresponding to the first historical level of detail; In the process of rendering the i+1th group of video frames of the virtual scene, the first interactive object is rendered based on the first intermediate detail level and the increased detail level to obtain the i+1th group of video frames of the virtual scene; wherein the first video frame in the i+1th group of video frames is obtained by rendering based on the first intermediate detail level, the second video frame in the i+1th group of video frames is obtained by rendering based on the increased detail level, and the second video frame is a video frame after the first video frame; The rendering of the second interactive object based on the reduced detail level to obtain the (i+1)th group of video frames of the virtual scene includes: Obtaining a second historical detail level of the second interactive object in rendering the i-th group of video frames; A second intermediate level of detail is obtained according to the second historical level of detail and the reduced level of detail, wherein the number of model vertices corresponding to the second intermediate level of detail is greater than the number of model vertices corresponding to the reduced level of detail, and the number of model vertices corresponding to the second intermediate level of detail is less than the number of model vertices corresponding to the second historical level of detail; In the process of rendering the i+1th group of video frames of the virtual scene, the second interactive object is rendered based on the second intermediate detail level and the reduced detail level to obtain the i+1th group of video frames of the virtual scene; wherein the third video frame in the i+1th group of video frames is rendered based on the second intermediate detail level, the fourth video frame in the i+1th group of video frames is rendered based on the second intermediate detail level, and the fourth video frame is a video frame after the third video frame.
10. The method according to claim 1, characterized in that The method further comprises: Obtaining the frame time consumption of each of the video frames included in the i-th group of video frames; The frame duration of the i-th group of video frames of the virtual scene is obtained according to the average value of the frame durations of the video frames included in the i-th group of video frames.
11. The method according to claim 1, characterized in that: The method further comprises: Get the target device model of the rendering device, as well as the mapping relationship between the device model and the frame time threshold; Determine, according to the mapping relationship, a frame time consumption threshold corresponding to the target device model; The frame time consumption threshold corresponding to the target device model is determined as the frame time consumption threshold corresponding to the virtual scene.
12. A virtual scene rendering device, characterized in that: The device comprises: an acquisition unit, an upgrade unit and a downgrade unit; The acquisition unit is used to acquire a frame time threshold corresponding to a virtual scene and a frame time of rendering an i-th group of video frames of the virtual scene, wherein the virtual scene includes a plurality of interactive objects, and i is a positive integer; The upgrading unit is configured to, if the frame time is less than the frame time threshold, determine a first interactive object from the multiple interactive objects according to the importance of each of the interactive objects in the virtual scene; increase the detail level of the first interactive object to obtain an increased detail level; and in the process of rendering the i+1th group of video frames of the virtual scene, render the first interactive object based on the increased detail level to obtain the i+1th group of video frames of the virtual scene; The degradation unit is used to determine a second interactive object from the multiple interactive objects according to the importance of each interactive object in the virtual scene if the frame time is greater than the frame time threshold; reduce the detail level of the second interactive object to obtain a reduced detail level; in the process of rendering the i+1th group of video frames of the virtual scene, render the second interactive object based on the reduced detail level to obtain the i+1th group of video frames of the virtual scene; the importance of the first interactive object is greater than the importance of the second interactive object.
13. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 11 according to the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 11.
Citation Information
Cited By
Television end transplantation application program scene rendering method, device and equipment based on YTS engine
CN121334447A