A resource rendering method and apparatus
By dividing the target scene and adjusting the precision of rendering resources, different rendering optimization resources are generated, which solves the problem of low rendering efficiency in large scene rendering and achieves reduced memory consumption and improved rendering efficiency.
Patent Information
- Application Number
- CN202210879186.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-07-25
AI Technical Summary
Existing technologies suffer from low rendering efficiency and high computer rendering pressure in large-scale scene rendering.
By dividing the target scene into multiple scene regions, adjusting the rendering resource precision of each region, generating different rendering optimization resources, and selecting appropriate rendering resources for rendering based on the viewing distance and scene attributes.
It reduces memory consumption, improves rendering efficiency, and enhances the performance and user experience of large-scene rendering.
Smart Images

Figure CN115228083B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a resource rendering method and apparatus, computing device and computer-readable storage medium. Background Technology
[0002] With the development of information and intelligent technologies, image rendering places increasingly higher demands on computer hardware performance. When a scene contains a large number of images and graphics, the rendering speed is often limited, increasing the rendering burden on the computer. Therefore, improving the rendering efficiency for large scenes is a pressing issue that needs to be addressed. Summary of the Invention
[0003] In view of this, embodiments of this application provide a resource rendering method and apparatus, a computing device and a computer-readable storage medium to address the technical deficiencies existing in the prior art.
[0004] According to a first aspect of the embodiments of this application, a resource rendering method is provided, including:
[0005] The target scene is divided to obtain the scene region of the target scene;
[0006] Adjust the rendering precision of the rendering resources corresponding to the scene area, and generate at least one rendering optimization resource corresponding to the scene area;
[0007] In response to a rendering instruction for the target scene, a target rendering resource corresponding to the scene region is determined based on the rendering resource and the at least one rendering optimization resource;
[0008] The scene area is rendered using the target rendering resource, and a display screen of the target scene is generated based on the area rendering result.
[0009] According to a second aspect of the embodiments of this application, a resource rendering apparatus is provided, comprising:
[0010] The segmentation module is configured to segment the target scene and obtain the scene region of the target scene;
[0011] The adjustment module is configured to adjust the rendering precision of the rendering resources corresponding to the scene area and generate at least one rendering optimization resource corresponding to the scene area.
[0012] The determination module is configured to, in response to a rendering instruction for the target scene, determine a target rendering resource corresponding to the scene region based on the rendering resource and the at least one rendering optimization resource;
[0013] The generation module is configured to render the scene area using the target rendering resource and generate a display screen of the target scene based on the area rendering result.
[0014] According to a third aspect of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the resource rendering method.
[0015] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer instructions, which, when executed by a processor, implement the steps of the resource rendering method.
[0016] According to a fifth aspect of the present application, a chip is provided that stores computer instructions, which, when executed by the chip, implement the steps of the resource rendering method.
[0017] This application provides a resource rendering method, comprising: dividing a target scene to obtain a scene region of the target scene; adjusting the rendering precision of the rendering resources corresponding to the scene region to generate at least one rendering optimization resource corresponding to the scene region; responding to a screen rendering instruction for the target scene, determining a target rendering resource corresponding to the scene region based on the rendering resources and the at least one rendering optimization resource; rendering the scene region through the target rendering resource, and generating a display screen of the target scene based on the region rendering result.
[0018] In this embodiment, the target scene is divided into multiple scene regions. By adjusting the rendering precision of the rendering resources corresponding to each scene region, memory consumption is reduced. Simultaneously, multiple rendering optimization resources with different rendering precisions are generated. During subsequent rendering, different rendering precision resources can be selected for rendering, improving rendering efficiency. Attached Figure Description
[0019] Figure 1 This is a structural block diagram of the computing device provided in the embodiments of this application;
[0020] Figure 2 This is a flowchart of the resource rendering method provided in the embodiments of this application;
[0021] Figure 3 This is a schematic diagram of target scene division provided in the embodiments of this application;
[0022] Figure 4 This is a schematic diagram of the resource rendering method provided in an embodiment of this application;
[0023] Figure 5This is a schematic diagram of the structure of the resource rendering apparatus provided in the embodiments of this application. Detailed Implementation
[0024] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0025] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to any or all possible combinations including one or more of the associated listed items.
[0026] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "in response to a determination".
[0027] First, the terminology used in one or more embodiments of the present invention will be explained.
[0028] LOD: Levels of detail. The purpose of LOD technology is to simplify the model under certain conditions. For models that are farther away from the camera, a simpler model will be used to replace them.
[0029] OpenGL: Open Graphics Library, is a cross-language, cross-platform application programming interface used for rendering 2D and 3D vector graphics.
[0030] DrawCall can be understood as a call from the CPU to the underlying graphics drawing interface, instructing the GPU to perform rendering operations. A DrawCall represents the number of times OpenGL draws. A simple OpenGL drawing sequence is: set color - drawing mode - vertex coordinates - draw - end, and these steps are repeated every frame. This constitutes one DrawCall.
[0031] Traditional LOD technology only optimizes the number of faces of models in the scene. In some small scenes, it can meet basic performance requirements as long as the draw call and texture memory are well controlled. However, in large-scale scenes, the huge scene and the long view distance cause the number of objects in the visible area to increase by several orders of magnitude. Traditional LOD technology cannot meet the performance requirements at all. Therefore, a better LOD solution is needed for large-scale scenes.
[0032] Based on this, this application provides a resource rendering method and apparatus, a computing device and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0033] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of this application is shown. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and a database 150 is used to store data.
[0034] The computing device 100 also includes an access device 140, which enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0035] In one embodiment of this application, the aforementioned components of the computing device 100 and Figure 1 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 1 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0036] The computing device 100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 100 can also be a mobile or stationary server.
[0037] Among them, processor 120 can execute Figure 2 The steps in the resource rendering method shown. Figure 2 A flowchart of a resource rendering method according to an embodiment of this application is shown, including steps 202 to 208.
[0038] Step 202: Divide the target scene and obtain the scene region of the target scene.
[0039] The target scene can be understood as a virtual game scene, a virtual teaching scene, etc. It can include multiple static objects, such as buildings, trees, and flowers. Each static object corresponds to a virtual model, which is composed of rendering resources. After rendering based on these resources, the target scene is presented to the user. When the target scene is a virtual game scene, players can control a virtual character to move within it. As the virtual character moves within the target scene, various virtual models within the scene need to be rendered based on the character's position.
[0040] In practical applications, dividing the target scene can be understood as layering the target scene. Each layer has its own rendering rules, including rendering precision, number of models rendered, etc. Dividing the target scene can yield multiple scene regions belonging to the target scene. Each scene region includes the same or different virtual models. The accumulation of rendering resources corresponding to the virtual models in each scene region is the rendering resource corresponding to that scene region. Rendering based on this rendering resource can obtain the display screen corresponding to that scene region.
[0041] In one specific embodiment of this application, the target scene is a game scene, which includes virtual models of buildings, vehicles, roads, etc. Dividing the target scene, three scene regions can be obtained: scene region A, scene region B, and scene region C.
[0042] Specifically, the target scene is divided to obtain the scene region of the target scene, including:
[0043] The target scene is segmented based on the line-of-sight information and / or scene attribute information to obtain the segmentation results;
[0044] The scene region of the target scene is determined based on the division results.
[0045] Among these, view distance information can be understood as information about the distance that the virtual character controlled by the player can see, such as... Figure 3 As shown, Figure 3This is a schematic diagram of target scene division provided in an embodiment of this application. If the virtual character controlled by the player is at point A, and the viewing distance information is the distance from point A to point B, then the player can see all virtual models at a maximum distance from point B from point A. It should be noted that the viewing distance information is a circular range with the camera as the center and the viewing distance as the radius. For example, in... Figure 3 In this scenario, if the player-controlled virtual character is at point B, the view distance information should encompass the entire area from point A to point C. Based on this view distance information, the target scene can be divided according to the distance from the camera to the scene area. This allows for different rendering accuracies to be applied to scene areas at different view distances, improving rendering efficiency and reducing memory consumption. Scene attribute information can be understood as the complexity of the scene, the density of virtual models, or the size of the scene area. Dividing the target scene into multiple scene areas based on rendering difficulty can also be effective.
[0046] In practical applications, the target scene can be divided by selecting at least one division standard from view distance information and scene attribute information. When the target scene is divided according to view distance information and scene attribute information, more different scene regions can be divided into the target scene, so that different numbers of scene regions can be selected for rendering later, thereby further improving rendering efficiency.
[0047] In one embodiment of this application, see Figure 3 If the viewing distance is 200 meters (m), then the target scene is divided into three scene regions based on the viewing distance information. Figure 3 Scene area A, scene area B and scene area C are defined, with each scene area spaced 100m apart.
[0048] In another embodiment of this application, the target scene is divided according to scene attribute information, including the size of the scene. If the target scene is 300 square meters, the target scene is divided into two scene areas, namely scene area A and scene area B, and the size of each scene area is 150 square meters.
[0049] Step 204: Adjust the rendering precision of the rendering resources corresponding to the scene area, and generate at least one rendering optimization resource corresponding to the scene area.
[0050] Rendering resources can be understood as the resources needed to render the scene area. Adjusting the rendering precision of rendering resources can be understood as adjusting parameters during rendering based on the rendering resources, resulting in changes to the precision of the rendered model. For example, rendering with initial rendering resources of precision 1 can produce a very realistic virtual model, while rendering with rendering resources of precision 0.5 may result in some details of the virtual model not being displayed. After adjusting the rendering precision of the rendering resources, a lower-precision rendering optimized resource can be generated. This optimized rendering resource is characterized by lower model precision compared to the virtual model rendered with the original rendering resource, meaning it is slightly weaker in some details, but it is faster in rendering time and consumes less client memory.
[0051] In practical applications, the lower the rendering precision of rendering resources, the shorter the rendering process based on those resources, thus reducing rendering time. Therefore, in the target scene, for virtual models outside the user's visible range, the rendering precision can be reduced to decrease the rendering pressure on the client and improve rendering efficiency in complex target scenes. The rendering precision of rendering resources can be pre-set by developers. For example, three rendering precision levels can be pre-set: low, medium, and high, each corresponding to a rendering method. These may differ in the model's texture or its mapping. The specific rendering precision level and the corresponding rendering method for each precision can be determined based on the actual situation, and this application does not impose specific restrictions here.
[0052] In one embodiment of this application, following the example above, the rendering precision of the rendering resources of scene region A is adjusted. The original rendering precision of the rendering resources of scene region A was high. It is adjusted to low rendering precision and medium rendering precision. Then, a rendering optimization resource can be generated according to the low rendering precision and another rendering optimization resource can be generated according to the medium rendering precision.
[0053] Specifically, adjusting the rendering precision of the rendering resources corresponding to the scene region, and generating at least one rendering optimization resource corresponding to the scene region, including:
[0054] Determine the rendering resources corresponding to the scene area, and determine at least one rendering precision level corresponding to the rendering resources;
[0055] Generate rendering optimization resources corresponding to each rendering precision level.
[0056] Among them, the rendering precision level corresponding to the rendering resource can be understood as the level information that distinguishes different rendering precision. Each rendering precision level corresponds to a certain rendering precision, and the virtual model rendered by the rendering resource under different rendering precision levels has different precision.
[0057] In practical applications, the rendering precision level can be divided into three levels: low, medium, and high. It can also be distinguished according to the rendering ratio of the virtual model, such as rendering 100%, rendering 80%, and rendering 50%. When rendering at 100%, the rendered virtual model is a normal virtual model. When rendering at 80%, the rendered virtual model may have some missing textures. When rendering at 50%, the rendered virtual model may only have a model outline. The specific rendering precision level can be determined according to the actual situation.
[0058] In one embodiment of this application, following the example above, the rendering resources corresponding to the scene area are obtained, and the rendering precision level corresponding to the rendering resources is determined to be low, medium, or high. The current rendering resource corresponds to a high rendering precision level, so the corresponding rendering optimization resources are generated based on the low and medium rendering precision levels.
[0059] Specifically, the rendering optimization resources corresponding to any rendering precision level can be generated in the following ways, including:
[0060] Obtain the optimization strategy corresponding to the target rendering precision level;
[0061] The rendering resources are optimized based on the optimization strategy, and the optimized rendering resources corresponding to the rendering precision level are generated.
[0062] In this context, optimization strategies can be understood as strategies for optimizing the rendering method of the model. For example, if a virtual model consists of 100 mesh faces, the number of mesh faces can be reduced to 50, thus optimizing the strategy. Alternatively, an optimization strategy could also be to reduce the number of textures.
[0063] In practical applications, each rendering precision level corresponds to a specific optimization strategy, resulting in different optimized rendering resources for each precision level. Consequently, the rendered virtual model will have varying levels of precision based on these optimized resources. Optimization strategies also include degrees of optimization; for example, a low-precision-level optimization strategy might reduce the total number of mesh faces by 80%, while a mid-precision-level optimization strategy might reduce the total number of mesh faces by 50%.
[0064] In a specific embodiment of this application, following the example above, an optimization strategy corresponding to a low target rendering precision level is obtained. Based on this optimization strategy, the rendering resources of scene region A are optimized to generate rendering optimization resources corresponding to a low rendering precision level. The scene region A rendered according to the rendering resources can see the people in each car in the region. The scene region A rendered according to the rendering optimization resources can only see the outline of each vehicle in the region.
[0065] Specifically, the rendering resources are optimized based on the optimization strategy, and optimized rendering resources corresponding to the rendering precision level are generated, including:
[0066] Obtain the model texture data and model mesh data from the rendering resources;
[0067] The model texture data is merged based on the optimization strategy, and / or the model mesh data is reduced in polygon count based on the optimization strategy;
[0068] Based on the processing results, generate rendering optimized resources corresponding to the rendering precision level.
[0069] In practical applications, when the optimization strategy is merge optimization, the model texture data is merged based on the optimization strategy to obtain optimized model texture data, and the rendering optimization resources corresponding to the rendering precision level are generated based on the optimized model texture data and the model mesh data.
[0070] When the optimization strategy is polygon reduction optimization, the model mesh data is processed by polygon reduction based on the optimization strategy to obtain model mesh optimized data, and rendering optimized resources corresponding to the rendering precision level are generated based on the model mesh optimized data.
[0071] When the optimization strategy is to merge optimization and reduce polygons, the model texture data is merged based on the optimization strategy to obtain optimized model texture data, and the model mesh data is reduced based on the optimization strategy to obtain optimized model mesh data. Then, the rendering optimization resource corresponding to the rendering precision level is generated based on the optimized model texture data and the optimized model mesh data.
[0072] Model texture data can be understood as the texture data on the virtual model. Merging model texture data according to optimization strategies can effectively reduce the client's memory usage during rendering. After merging, optimized model texture data for this rendering precision level can be obtained. Model mesh data can be understood as the mesh of the virtual model. Reducing the number of meshes in the virtual model can also effectively reduce the client's memory usage during rendering. After reduction, optimized model mesh data for this model precision level can be obtained. Based on the optimized model texture data and optimized model mesh data, rendering optimized resources corresponding to this rendering precision level can be generated.
[0073] In practical applications, optimizing texture merging and mesh reduction strategies can effectively lower rendering precision, thereby adjusting the rendering accuracy of rendering resources. It's important to note that multi-threading can be used to implement these optimization strategies, thus increasing the speed of rendering precision adjustments.
[0074] In one embodiment of this application, following the previous example, model texture data from scene region A is obtained. This model texture data contains 100 images. Based on an optimization strategy, the model texture data is merged to obtain optimized model texture data, which contains 50 images. Model mesh data from scene region A is also obtained. This model mesh data contains 100 meshes. Based on an optimization strategy, the model mesh data undergoes polygon reduction processing to obtain optimized model mesh data, which contains 50 meshes. The optimized model texture data and the optimized model mesh data are then used to construct rendering optimization resources corresponding to the model's precision level.
[0075] In practical applications, the optimization strategy can also choose one of texture merging or polygon reduction processing. Specifically, the rendering resources are optimized based on the optimization strategy, and rendering optimized resources corresponding to the rendering precision level are generated, including:
[0076] Obtain the model texture data from the rendering resources, and merge the model texture data based on the optimization strategy to obtain optimized model texture data;
[0077] Obtain the model mesh data from the rendering resource;
[0078] Rendering optimization resources corresponding to the rendering accuracy level are generated based on the model texture optimization data and the model mesh data.
[0079] Specifically, the rendering optimization resources corresponding to the rendering accuracy level are generated based on the optimized model texture data and the initial model mesh data.
[0080] In one embodiment of this application, following the previous example, model texture data from scene region A is obtained. This model texture data consists of 100 images. Based on an optimization strategy, the model texture data is merged to obtain optimized model texture data, which consists of 50 images. Model mesh data from scene region A is also obtained. This model mesh data consists of 100 meshes. Based on the optimized model texture data and the model mesh data, rendering optimization resources corresponding to the model's precision level are constructed.
[0081] Accordingly, the rendering resources are optimized based on the optimization strategy, and rendering optimized resources corresponding to the rendering precision level are generated, including:
[0082] Obtain the model texture data from the rendering resource;
[0083] Obtain the model mesh data from the rendering resource, and perform polygon reduction processing on the model mesh data based on the optimization strategy to obtain optimized model mesh data;
[0084] Rendering optimization resources corresponding to the rendering accuracy level are generated based on the model texture data and the model mesh optimization data.
[0085] Specifically, the rendering optimization resources corresponding to the rendering accuracy level are generated based on the optimized model mesh data and the initial model texture data.
[0086] In one embodiment of this application, following the previous example, model texture data in scene region A is obtained. The model texture data has 100 meshes. Based on an optimization strategy, the model mesh data is reduced to obtain optimized model mesh data, which has 50 meshes. The model texture data in scene region A is then obtained again, and the model mesh data has 100 images. Based on the optimized model mesh data and the model texture data, rendering optimization resources corresponding to the model's precision level are constructed.
[0087] Step 206: In response to the rendering instruction for the target scene, determine the target rendering resource corresponding to the scene area based on the rendering resource and the at least one rendering optimization resource.
[0088] The rendering command can be understood as the command to render the target scene when the user controls the virtual character to enter the target scene, or when the user controls the virtual character to move within the target scene. The rendering command includes the virtual character's position in the target scene and the virtual character's view distance information, i.e., the visible range.
[0089] In practical applications, since each scene region corresponds to rendering resources and at least one rendering optimization resource, when rendering the target scene (i.e., rendering each scene region), it is necessary to determine the rendering resources used for each scene region. These resources must be selected from the existing rendering resources and the rendering optimization resources. In practice, this can be determined based on the distance between the virtual character and the scene region. The smaller the distance, the higher the rendering precision level of the scene region's rendering resources. This means that when the user moves the virtual character closer to the scene region, the model quality in that scene region should be higher, thus presenting a clearer image to the user. Alternatively, it can be determined based on the view distance calculated from the virtual character.
[0090] In one embodiment of this application, in response to a rendering instruction for a target scene, the rendering instruction includes the position information of the virtual character and the visible range information. When the virtual character is located in scene area A, such as... Figure 3 In the scenario, the visible range of the virtual character in scene region A extends to point B. Therefore, the target rendering resource for scene region A is the initial rendering resource, while the target rendering resources for scene regions B and C are the rendering optimization resources.
[0091] Specifically, determining the target rendering resource corresponding to the scene region based on the rendering resource and the at least one rendering optimization resource includes:
[0092] Based on the rendering position information carried in the rendering command, determine the target interval distance corresponding to the scene area;
[0093] The target rendering precision level corresponding to the target interval distance is determined based on the correspondence between the interval distance and the rendering precision level.
[0094] Obtain the target rendering resource corresponding to the target rendering precision level based on the target rendering precision level.
[0095] Rendering position information can be understood as the location of the virtual character within the target scene. This information may also include the virtual character's view distance within the target scene, i.e., the visible range. Based on the rendering position information, the distance between the virtual character and the scene area can be calculated. Subsequently, the rendering precision level corresponding to the target distance can be determined based on the correlation between this distance and the rendering precision level.
[0096] In practical applications, the correspondence between the interval distance and the rendering precision level can be pre-defined by the developers. For example, a high rendering precision level corresponds to an interval distance of 0-50m; a medium rendering precision level corresponds to 51-100m; and a low rendering precision level corresponds to 101-200m. This ensures that the further away the scene area is from the virtual character, the lower the rendering precision level of the rendering resources used during rendering, thereby reducing memory consumption during rendering.
[0097] In a specific embodiment of this application, following the example above, the virtual character is at point A, with an interval distance of 0m to scene area A, an interval distance of 100m to scene area B, and an interval distance of 200m to scene area C. Based on the interval distance and the rendering precision level, the rendering precision level corresponding to the rendering resources used when rendering scene area A is determined to be high, the rendering precision level corresponding to the rendering resources used when rendering scene area B is determined to be medium, and the rendering precision level corresponding to the rendering resources used when rendering scene area C is determined to be low. The rendering resources corresponding to the rendering precision level of each scene area are then obtained.
[0098] Step 208: Render the scene area using the target rendering resource, and generate a display screen of the target scene based on the area rendering result.
[0099] Once the target rendering resources used for rendering each scene area are determined, each scene area can be rendered based on the target rendering resources to generate the display screen of the target scene.
[0100] In a specific embodiment of this application, following the example above, rendering resources with a high rendering precision level are used to render scene region A, and rendering optimization resources with a medium rendering precision level are used to render scene region B, so that rendering optimization resources with a low rendering precision level render scene region B, and the display screen of the target scene is generated based on the region rendering results.
[0101] In practical applications, considering the user's experience with the target scene, virtual resources in the scene area closest to the user's controlled virtual character should be loaded first. Therefore, during the rendering process, rendering resources can be prioritized, and more important rendering resources can be optimized for rendering, thus presenting the corresponding important scenes to the user first. Specifically, rendering the scene area using the target rendering resources includes:
[0102] Based on the rendering precision level corresponding to each scene region, the target rendering resources corresponding to each scene region are added to the rendering queue in descending order of precision.
[0103] Each target rendering resource in the rendering queue is called in descending order to render each scene region.
[0104] Since the rendering resources closer to the user have higher rendering precision, the target rendering resources corresponding to each scene area can be prioritized according to the order of rendering precision and added to the rendering queue. During the later rendering process, the rendering resources in the rendering queue are called in order of rendering precision from high to low, so that the rendering resources with high rendering precision are rendered first, and thus the important images can be displayed to the user first.
[0105] In practical applications, during the rendering of the target scene, the rendering speed is very fast, so users do not feel much difference in the order of each rendering scene. However, in order to avoid the frame rate of important scenes being seriously delayed due to excessive rendering resources, resulting in stuttering for users, while some unimportant resources are loaded first, which is extremely bad for the user experience, the priority of rendering resources can be sorted to avoid the above problems. In specific implementation, sorting can be achieved through multi-threading of the Job.
[0106] In a specific embodiment of this application, following the example above, the rendering resources of scene region A (high rendering precision level), scene region B (medium rendering precision level), and scene region C (low rendering precision level) are sequentially added to the rendering queue in descending order of rendering precision level. During subsequent rendering, the rendering resources corresponding to scene region A are called first, then the rendering resources corresponding to scene region B are called, and finally the rendering resources corresponding to scene region C are called.
[0107] Specifically, before rendering each scene region based on each target rendering resource stored in the rendering queue, the process further includes:
[0108] The idle scene area of the target scene is determined based on the rendering location information;
[0109] Delete the target rendering resources corresponding to the idle scene area in the rendering queue to obtain the target rendering queue;
[0110] Accordingly, each target rendering resource in the rendering queue is invoked in descending order to render each scene region, including:
[0111] Each target rendering resource in the target rendering queue is called in descending order to render each scene region.
[0112] The idle scene area can be understood as a scene area with relatively low rendering precision and low importance, or a scene area outside the view distance of the virtual character. For the idle scene area, since the rendering detail in the scene area is small, and the user may not notice the virtual model in the idle scene area in the current frame, it is possible to choose not to render the virtual model in the scene area, thereby reducing the rendering pressure on the client and reducing memory consumption.
[0113] In one embodiment of this application, following the example above, scene region C is determined to be a restricted scene region based on the rendering location information. The target rendering resources corresponding to scene region C in the rendering queue are deleted, so that when rendering the target scene later, the virtual model in scene region C is not rendered.
[0114] This application provides a resource rendering method, comprising: dividing a target scene to obtain scene regions of the target scene; adjusting the rendering precision of rendering resources corresponding to the scene regions to generate at least one rendering optimized resource corresponding to the scene regions; responding to a rendering command for the target scene, determining a target rendering resource corresponding to the scene regions based on the rendering resources and the at least one rendering optimized resource; rendering the scene regions using the target rendering resource; and generating a display screen of the target scene based on the region rendering result. By dividing the target scene to obtain multiple scene regions, and by adjusting the rendering precision of the rendering resources corresponding to each scene region to obtain rendering resources at different rendering precision levels, during later rendering, the rendering resources at the corresponding rendering precision level can be selected based on the viewing distance information to render the scene regions, thereby reducing memory consumption and improving rendering efficiency. This ensures the number and effect of visible objects at long viewing distances and also improves the running performance during client rendering, significantly enhancing the long viewing distance effect of the target scene.
[0115] Figure 4 A resource rendering method according to an embodiment of this application is shown. The resource rendering method is described using the rendering of a game scene as an example, and includes steps 402 to 420.
[0116] Step 402: Divide the game scene according to the viewing distance information and scene attribute information to obtain scene area A, scene area B and scene area C of the game scene.
[0117] Step 404: Determine the initial rendering resources corresponding to each scene area, and determine the rendering precision level corresponding to the initial rendering resources.
[0118] The rendering precision levels include three levels: low, medium, and high. The initial rendering resource corresponds to the high rendering precision level.
[0119] Step 406: Obtain the model texture data from the initial rendering resources, and merge the model texture data based on the optimization strategy to obtain optimized model texture data.
[0120] Step 408: Obtain the model mesh data in the initial rendering resources, and perform face reduction processing on the model mesh data based on the optimization strategy to obtain optimized model mesh data.
[0121] Step 410: Generate rendering optimization resources corresponding to the rendering accuracy level based on the model texture optimization data and model mesh optimization data.
[0122] This involves generating rendering optimization resources for each scene region, with each scene region corresponding to its own initial rendering resources and two rendering optimization resources.
[0123] Step 412: Determine the target interval distance corresponding to the scene area based on the rendering position information carried in the rendering instruction.
[0124] The rendering position information is the virtual character controlled by the user at point A in scene area A. The target interval distance corresponding to scene area A is determined to be 0m, the target interval distance corresponding to scene area B is determined to be 100m, and the target interval distance corresponding to scene area C is determined to be 200m.
[0125] Step 414: Determine the target rendering precision level corresponding to the target interval distance based on the correspondence between the interval distance and the rendering precision level.
[0126] Specifically, scene region A is designated as high rendering precision, scene region B as medium rendering precision, and scene region C as low rendering precision.
[0127] Step 416: Obtain the target rendering resources corresponding to the target rendering precision level according to the target rendering precision level of each scene region.
[0128] Specifically, the initial rendering resources with a high rendering precision level are obtained for scene region A, the rendering optimized resources with a medium rendering precision level are obtained for scene region B, and the rendering optimized resources with a low rendering precision level are obtained for scene region C.
[0129] Step 418: Based on the rendering precision level corresponding to each scene area, add the target rendering resources corresponding to each scene area to the rendering queue in descending order of precision.
[0130] The sorting result is: initial rendering resources of scene region A - rendering optimized resources of scene region B - rendering optimized resources of scene region C. The rendering resources corresponding to scene region A, scene region B and scene region C are added to the rendering queue in order according to the sorting result.
[0131] Step 420: Call each target rendering resource in the rendering queue in descending order to render each scene region.
[0132] The rendering resources of scene region A are called first, then the rendering resources of scene region B are called, and finally the rendering resources of scene region C are called.
[0133] This application provides a resource rendering method for rendering game scenes. By dividing the target scene, multiple scene regions of the target scene are obtained. By adjusting the rendering precision of the rendering resources corresponding to each scene region, rendering resources at different rendering precision levels are obtained. During later rendering, the rendering resources of the corresponding rendering precision level can be selected according to the view distance information to render the scene region, thereby reducing memory consumption and improving rendering efficiency.
[0134] Corresponding to the above method embodiments, this application also provides resource rendering apparatus embodiments. Figure 5 A schematic diagram of the structure of a resource rendering apparatus according to an embodiment of this application is shown. Figure 5 As shown, the device 500 includes:
[0135] The segmentation module 502 is configured to segment the target scene and obtain the scene region of the target scene;
[0136] The adjustment module 504 is configured to adjust the rendering precision of the rendering resources corresponding to the scene area and generate at least one rendering optimization resource corresponding to the scene area.
[0137] The determination module 506 is configured to determine the target rendering resource corresponding to the scene area based on the rendering resource and the at least one rendering optimization resource in response to the screen rendering instruction for the target scene.
[0138] The generation module 508 is configured to render the scene area using the target rendering resource and generate a display screen of the target scene based on the area rendering result.
[0139] Optionally, the partitioning module 502 is further configured to:
[0140] The target scene is segmented based on the line-of-sight information and / or scene attribute information to obtain the segmentation results;
[0141] The scene region of the target scene is determined based on the division results.
[0142] Optionally, the adjustment module 504 is further configured to:
[0143] Determine the rendering resources corresponding to the scene area, and determine at least one rendering precision level corresponding to the rendering resources;
[0144] Generate rendering optimization resources corresponding to each rendering precision level.
[0145] Optionally, the adjustment module 504 is further configured to:
[0146] Obtain the optimization strategy corresponding to the target rendering precision level;
[0147] The rendering resources are optimized based on the optimization strategy, and the optimized rendering resources corresponding to the rendering precision level are generated.
[0148] Optionally, the adjustment module 504 is further configured to:
[0149] Obtain the model texture data and model mesh data from the rendering resources;
[0150] The model texture data is merged based on the optimization strategy, and / or the model mesh data is reduced in polygon count based on the optimization strategy;
[0151] Based on the processing results, generate rendering optimized resources corresponding to the rendering precision level.
[0152] Optionally, the determining module 506 is further configured to:
[0153] Based on the rendering position information carried in the rendering command, determine the target interval distance corresponding to the scene area;
[0154] The target rendering precision level corresponding to the target interval distance is determined based on the correspondence between the interval distance and the rendering precision level.
[0155] Obtain the target rendering resource corresponding to the target rendering precision level based on the target rendering precision level.
[0156] Optionally, the generation module 508 is further configured to:
[0157] Based on the rendering precision level corresponding to each scene region, the target rendering resources corresponding to each scene region are added to the rendering queue in descending order of precision.
[0158] Each target rendering resource in the rendering queue is called in descending order to render each scene region.
[0159] Optionally, the generation module 508 is further configured to:
[0160] The idle scene area of the target scene is determined based on the rendering location information;
[0161] Delete the target rendering resources corresponding to the idle scene area in the rendering queue to obtain the target rendering queue;
[0162] Accordingly, each target rendering resource in the rendering queue is invoked in descending order to render each scene region, including:
[0163] Each target rendering resource in the target rendering queue is called in descending order to render each scene region.
[0164] This application provides a resource rendering apparatus, comprising: a partitioning module configured to partition a target scene and obtain scene regions of the target scene; an adjustment module configured to adjust the rendering precision of rendering resources corresponding to the scene regions and generate at least one rendering optimized resource corresponding to the scene regions; a determination module configured to, in response to a rendering command for the target scene, determine a target rendering resource corresponding to the scene regions based on the rendering resources and the at least one rendering optimized resource; and a generation module configured to render the scene regions using the target rendering resources and generate a display screen of the target scene based on the region rendering results. By partitioning the target scene to obtain multiple scene regions, and by adjusting the rendering precision of the rendering resources corresponding to each scene region, memory consumption is reduced. Simultaneously, multiple rendering optimized resources with different rendering precisions are generated, allowing for the selection of rendering resources with different precisions during subsequent screen rendering, thereby improving rendering efficiency.
[0165] The above is a schematic scheme of a resource rendering apparatus according to this embodiment. It should be noted that the technical solution of this resource rendering apparatus and the technical solution of the resource rendering method described above belong to the same concept. For details not described in detail in the technical solution of the resource rendering apparatus, please refer to the description of the technical solution of the resource rendering method described above.
[0166] It should be noted that each component in the device claim should be understood as a functional module necessary to implement each step of the program flow or method, and the functional modules are not actual functional divisions or separations. A device claim defined by such a set of functional modules should be understood as a functional module architecture that implements the solution primarily through the computer program described in the specification, and not as a physical device that implements the solution primarily through hardware.
[0167] In one embodiment of this application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the resource rendering method described above.
[0168] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the resource rendering method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the resource rendering method described above.
[0169] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the resource rendering method as described above.
[0170] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the resource rendering method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the resource rendering method described above.
[0171] This application discloses a chip that stores computer instructions, which, when executed by a processor, implement the steps of the resource rendering method described above.
[0172] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0173] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0175] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0176] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A resource rendering method, characterized in that, include: The process of dividing a target scene and obtaining the scene region of the target scene includes: dividing the target scene according to view distance information and / or scene attribute information to obtain a division result; and determining the scene region of the target scene according to the division result. The process of dividing the target scene refers to dividing the target scene into layers, each layer having its own rendering rules. The scene attribute information includes the complexity of the scene in the scene region, the clustering degree of the virtual model, or the size information of the scene region. Adjust the rendering precision of the rendering resources corresponding to the scene area to generate at least one rendering optimized resource corresponding to the scene area. The at least one rendering optimized resource corresponds to different rendering precision levels, and each rendering precision level corresponds to an optimization strategy. The optimization strategies include merging optimization and / or reducing polygons optimization. In response to a rendering instruction for the target scene, a target rendering resource corresponding to the scene region is determined based on the rendering resource and the at least one rendering optimization resource; The scene area is rendered using the target rendering resource, and a display screen of the target scene is generated based on the area rendering result.
2. The method as described in claim 1, characterized in that, Adjusting the rendering precision of the rendering resources corresponding to the scene area, and generating at least one rendering optimized resource corresponding to the scene area, including: Determine the rendering resources corresponding to the scene area, and determine at least one rendering precision level corresponding to the rendering resources; Generate rendering optimization resources corresponding to each rendering precision level.
3. The method as described in claim 2, characterized in that, Rendering optimization resources corresponding to any rendering precision level can be generated in the following ways, including: Obtain the optimization strategy corresponding to the target rendering precision level; The rendering resources are optimized based on the optimization strategy, and the optimized rendering resources corresponding to the rendering precision level are generated.
4. The method as described in claim 3, characterized in that, The rendering resources are optimized based on the optimization strategy, and optimized rendering resources corresponding to the rendering precision level are generated, including: Obtain the model texture data and model mesh data from the rendering resources; The model texture data is merged based on the optimization strategy, and / or the model mesh data is reduced in polygon count based on the optimization strategy; Based on the processing results, generate rendering optimized resources corresponding to the rendering precision level.
5. The method as described in claim 2, characterized in that, Determining the target rendering resource corresponding to the scene region based on the rendering resource and the at least one rendering optimization resource includes: Based on the rendering position information carried in the rendering command, determine the target interval distance corresponding to the scene area; The target rendering precision level corresponding to the target interval distance is determined based on the correspondence between the interval distance and the rendering precision level. Obtain the target rendering resource corresponding to the target rendering precision level based on the target rendering precision level.
6. The method as described in claim 2, characterized in that, Rendering the scene region using the target rendering resource includes: Based on the rendering precision level corresponding to each scene area, the target rendering resources corresponding to each scene area are added to the rendering queue in descending order of precision. Each target rendering resource in the rendering queue is called in descending order to render each scene region.
7. The method as described in claim 6, characterized in that, Before rendering each scene region according to each target rendering resource stored in the rendering queue, the process also includes: The idle scene area of the target scene is determined based on the rendering location information; Delete the target rendering resources corresponding to the idle scene area in the rendering queue to obtain the target rendering queue; Accordingly, each target rendering resource in the rendering queue is invoked in descending order to render each scene region, including: Each target rendering resource in the target rendering queue is called in descending order to render each scene region.
8. A resource rendering apparatus, characterized in that, include: The segmentation module is configured to segment the target scene and obtain the scene region of the target scene. Segmenting the target scene means dividing the target scene into layers, each with its own rendering rules. The segmentation module is further configured to segment the target scene based on view distance information and / or scene attribute information to obtain a segmentation result; and to determine the scene region of the target scene based on the segmentation result, wherein the scene attribute information is the complexity of the scene in the scene region, the clustering degree of the virtual model, or the size information of the scene region. The adjustment module is configured to adjust the rendering precision of the rendering resources corresponding to the scene area and generate at least one rendering optimized resource corresponding to the scene area. The at least one rendering optimized resource corresponds to different rendering precision levels, and each rendering precision level corresponds to an optimization strategy. The optimization strategies include merging optimization and / or reducing polygons optimization. The determination module is configured to, in response to a rendering instruction for the target scene, determine a target rendering resource corresponding to the scene region based on the rendering resource and the at least one rendering optimization resource; The generation module is configured to render the scene area using the target rendering resource and generate a display screen of the target scene based on the area rendering result.
9. A computing device, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer instructions, it implements the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Method for scene visualization
CN101635138A
Model optimization method and device
CN109272567A
Virtual object rendering method and device, equipment and readable storage medium
CN114028807A