Resource processing method
By dividing scene resources to dynamic and static resource levels and further divided into size and functional levels, the problem of low rendering efficiency is solved, and efficient management and rendering of scene resources is achieved.
Patent Information
- Application Number
- CN202411160889.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, when rendering large scenes, the rendering efficiency is low due to the wide variety of resources, and the resource classification method changes the storage structure of scene resources, which cannot effectively solve the problem of low rendering efficiency.
By determining the scene resources of the initial scene and allocating dynamic resources to the dynamic resource level, static resources are allocated to the static resource level, static resources are allocated to at least two size levels according to the resource size, and dynamic resources are allocated to at least two functions according to the resource function. hierarchy, generate resource-level information for resource-level conversion.
It realizes standardized management and storage of scene resources, improves editing efficiency, and can process scene resources in sequence during subsequent rendering, improving rendering efficiency.
Smart Images

Figure CN119091022A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource processing method. Background Art
[0002] Rendering technology is usually used in scenes such as animation and game production. Large scenes generally use a large number of different types of resources. When considering scene optimization, some secondary processing will be performed on the resources corresponding to the scene, such as model rendering batch merging, model merging, and removal of redundant resources. If these operations are saved for the original scene, it will be difficult to edit them again. From the perspective of scene rendering, when directly rendering the scene resources corresponding to the large scene, due to the wide variety of resources, the rendering efficiency will also be affected by the type of resources.
[0003] In the prior art, resources are usually classified in the original scene corresponding to the large scene. However, this classification method directly changes the resource storage structure of the scene resources, and the requirements for resource classification are also high. In order to solve the problem of low rendering efficiency, the engine used for rendering the scene is usually upgraded. However, this method cannot solve the problem of low rendering efficiency from the resource dimension. Therefore, a more effective resource processing method is urgently needed to solve the above problems. Summary of the invention
[0004] In view of this, the embodiment of the present application provides a resource processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a resource processing device, a computing device, a computer-readable storage medium, and a computer program product.
[0005] According to a first aspect of an embodiment of the present application, a resource processing method is provided, including:
[0006] Determine scene resources corresponding to the initial scene, and allocate dynamic resources in the scene resources to the dynamic resource level, and allocate static resources in the scene resources to the static resource level;
[0007] Allocating the static resources in the static resource level to at least two size levels according to resource size, and allocating the dynamic resources in the dynamic resource level to at least two function levels according to resource function;
[0008] Resource level information is generated based on the static resource level, the dynamic resource level, the at least two size levels and the at least two function levels, and the resource level information is used to perform resource level conversion for the initial scenario.
[0009] Optionally, determining the scene resources corresponding to the initial scene includes:
[0010] Determine an initial scene resource corresponding to the initial scene, and determine a lighting resource and a logic resource in the initial scene resource;
[0011] The lighting resources and the logic resources are eliminated from the initial scene resources to obtain the scene resources, and the lighting resources and the logic resources are allocated to a resource level.
[0012] Optionally, allocating the static resources in the static resource level to at least two size levels according to resource sizes includes:
[0013] Determining large-size static resources, medium-size static resources, and small-size static resources in the static resource hierarchy;
[0014] The large-size static resources are allocated to a large-size layer, the medium-size static resources are allocated to a medium-size layer, and the small-size static resources are allocated to a small-size layer.
[0015] Optionally, after allocating the static resources in the static resource level to at least two size levels according to resource sizes, the method further includes:
[0016] The processing of any one of the at least two size levels includes:
[0017] Determining, by resource type, static resources, destructible resources, semi-transparent resources, and decal resources in the target size level;
[0018] The static resources are allocated to a static resource level, the destructible resources are allocated to a destructible resource level, the semi-transparent resources are allocated to a semi-transparent resource level, and the decal resources are allocated to a decal resource level.
[0019] Optionally, before allocating the static resources in the static resource level to at least two size levels according to resource sizes, the method further includes:
[0020] Determining a static marking resource associated with static resource marking information among the static resources included in the static resource level;
[0021] The statically marked resources are allocated to a statically marked resource level.
[0022] Optionally, allocating the dynamic resources in the dynamic resource level to at least two functional levels according to resource functions includes:
[0023] Determining dynamic model resources, dynamic destructible resources, dynamic animation resources, and dynamic special effect resources in the dynamic resource hierarchy;
[0024] The dynamic model resources are allocated to a dynamic model resource level, the dynamic destructible resources are allocated to a dynamic destructible resource level, the dynamic animation resources are allocated to a dynamic animation resource level, and the dynamic special effect resources are allocated to a dynamic special effect resource level.
[0025] Optionally, before allocating the dynamic resources in the dynamic resource level to at least two functional levels according to resource functions, the method further includes:
[0026] Determine, from the dynamic resources included in the dynamic resource level, a dynamic marking model resource associated with dynamic model marking information and a dynamic marking special effect resource associated with dynamic special effect marking information;
[0027] The dynamic marking model resources are allocated to the dynamic marking model resource level, and the dynamic marking special effect resources are allocated to the dynamic marking special effect resource level.
[0028] Optionally, before determining the scene resources corresponding to the initial scene, the method further includes:
[0029] Identify the scenarios to be processed;
[0030] When the scene to be processed meets the scene division condition, the scene to be processed is divided into at least one initial scene according to the scene division rule.
[0031] Optionally, after generating resource hierarchy information based on the static resource hierarchy, the dynamic resource hierarchy, the at least two size hierarchies and the at least two function hierarchies, the method further includes:
[0032] A target scene corresponding to the initial scene is rendered based on the resource level information.
[0033] According to a second aspect of an embodiment of the present application, there is provided a resource processing device, including:
[0034] A determination module is configured to determine scene resources corresponding to the initial scene, and allocate dynamic resources in the scene resources to the dynamic resource level, and allocate static resources in the scene resources to the static resource level;
[0035] an allocation module configured to allocate the static resources in the static resource level to at least two size levels according to resource size, and allocate the dynamic resources in the dynamic resource level to at least two function levels according to resource function;
[0036] The conversion module is configured to generate resource level information based on the static resource level, the dynamic resource level, the at least two size levels and the at least two function levels, wherein the resource level information is used to perform resource level conversion for the initial scenario.
[0037] According to a third aspect of an embodiment of the present application, a computing device is provided, including:
[0038] Memory and processor;
[0039] The memory is used to store computer-executable instructions, and the processor implements the steps of the resource processing method when executing the computer-executable instructions.
[0040] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the resource processing method are implemented.
[0041] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the resource processing method when executed by the chip.
[0042] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions, which implement the steps of the above-mentioned resource processing method when executed by a processor.
[0043] The resource processing method provided in the present application determines the scene resources corresponding to the initial scene, and allocates the dynamic resources in the scene resources to the dynamic resource level, and allocates the static resources in the scene resources to the static resource level. The static resources in the static resource level are allocated to at least two size levels according to the resource size, and the dynamic resources in the dynamic resource level are allocated to at least two function levels according to the resource function. After the scene resources corresponding to the initial scene are hierarchically divided, the scene resources are divided into different levels according to the type. Standardized management and storage of scene resources are realized. When the scene resources are edited twice, the editing efficiency is also higher. Resource hierarchy information is generated based on the static resource level, the dynamic resource level, at least two size levels and at least two function levels, and the resource hierarchy information is used to perform resource hierarchy conversion for the initial scene. The resource hierarchy conversion is performed on the initial scene that does not have a resource hierarchy relationship, so that when the initial scene is rendered later, the scene resources corresponding to the initial scene can be rendered in sequence to improve the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a structural diagram of a resource processing method provided by an embodiment of the present application;
[0045] Figure 2 is a flow chart of a resource processing method provided by an embodiment of the present application;
[0046] Figure 3It is a processing flow chart of a resource processing method applied to game scene resource conversion provided by an embodiment of the present application;
[0047] Figure 4 It is a scene conversion flow chart of a resource processing method provided by an embodiment of the present application;
[0048] Figure 5 is a structural diagram of a resource processing device provided by an embodiment of the present application;
[0049] Figure 6 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0050] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0051] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0052] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0053] Figure 1 is a schematic diagram of a resource processing method provided by an embodiment of the present application; Figure 1As shown, the scene resources corresponding to the initial scene are determined, and the dynamic resources in the scene resources are allocated to the dynamic resource level, and the static resources in the scene resources are allocated to the static resource level. The static resources in the static resource level are allocated to at least two size levels according to the resource size, the static resources with low importance marks in the static resource level are allocated to the static mark level, and the dynamic resources in the dynamic resource level are allocated to at least two function levels according to the resource function, and the dynamic resources with low importance marks in the dynamic resource level are allocated to the dynamic mark level. After the scene resources corresponding to the initial scene are hierarchically divided, the scene resources are divided into different levels according to type. Standardized management and storage of scene resources are achieved. When the scene resources are edited for the second time, the editing efficiency is also higher. Based on the static resource level, the dynamic resource level, at least two size levels, at least two function levels, the static mark level and the dynamic mark level, the resource level information is generated, and the resource level information is used to convert the resource level for the initial scene. The resource hierarchy is converted for the initial scene that does not have a resource hierarchy relationship, so that when the initial scene is subsequently rendered, the scene resources corresponding to the initial scene can be rendered in sequence, thereby improving rendering efficiency.
[0054] In the present application, a resource processing method is provided. The present application also relates to a resource processing device, a computing device, a computer-readable storage medium, and a computer program product. The following embodiments will describe them in detail one by one.
[0055] Figure 2 A flowchart of a resource processing method provided according to an embodiment of the present application is shown, which specifically includes the following steps:
[0056] Step 202: Determine the scene resources corresponding to the initial scene, and allocate dynamic resources in the scene resources to the dynamic resource level, and allocate static resources in the scene resources to the static resource level.
[0057] Specifically, the initial scene can be a game scene, or an animation scene or a video scene; the scene resources can be environmental resources, architectural resources, cultural resources, etc. contained in the initial scene, and the scene resources are the data resources required for rendering the initial scene. The scene resources can be edited and set according to the scene type of the initial scene. When the initial scene is a natural landscape, the scene resources include natural things such as mountains, trees, and rivers. Dynamic resources refer to resources that can produce dynamic effects in the game or animation screen corresponding to the initial scene, such as animals and insects in the mountains and forests. Static resources refer to resources that will not produce dynamic effects in the game or animation screen corresponding to the initial scene, such as mountains, houses, etc. Correspondingly, the dynamic resource level is used to store dynamic resources, and dynamic resources are divided into dynamic levels; the static resource level is used to store static resources, and static resources are divided into static levels, so as to classify and hierarchically store scene resources according to the dynamic and static nature of the resources.
[0058] Based on this, determine the scene resources corresponding to the initial scene, and determine the dynamic resources and static resources contained in the scene resources. Allocate dynamic resources to the dynamic resource level, and allocate static resources in the scene resources to the static resource level. Classify scene resources according to their dynamic or static resource status.
[0059] In actual applications, in addition to dividing scene resources into dynamic resources and static resources, resources such as vegetation, small objects, and pendants are stored in the form of data and stored in data files. Vegetation and objects associated with the vegetation system are stored in data files to reduce the complexity of the scene hierarchy. The importance of resources is marked in the data file for rendering optimization.
[0060] Furthermore, considering that the initial scene includes resources without visual attributes such as lighting and scene logic in addition to visual resources such as objects, it is necessary to perform hierarchical allocation for such resources without visual attributes. The specific implementation is as follows:
[0061] Determine initial scene resources corresponding to an initial scene, and determine lighting resources and logic resources in the initial scene resources; remove the lighting resources and the logic resources from the initial scene resources to obtain the scene resources, and allocate the lighting resources and the logic resources to a resource level.
[0062] Specifically, the initial scene resources are all the scene resources corresponding to the initial scene, the lighting resources are the light environment resources in the initial scene resources, and the logical resources refer to the logical relationship resources between resources. The resource level is used to store lighting resources and logical resources that do not have visual attributes.
[0063] Based on this, determine the initial scene resources corresponding to the initial scene. Determine the lighting resources and logic resources that do not have visual attributes in the initial scene resources. Eliminate the lighting resources and logic resources in the initial scene resources to obtain scene resources. Allocate the lighting resources and logic resources to the resource level. The lighting resources and logic resources can form a separate, reusable scene.
[0064] For example, when the initial scene is an animation scene, the initial scene can be a forest scene, which contains lush trees, houses, various animals, and other things. Before the initial scene starts to render, the lighting resources and logic resources in the initial scene are determined, and the lighting resources and logic resources are divided into resource levels. After the lighting resources and logic resources are removed from the initial scene resources, the obtained resources are the scene resources.
[0065] In summary, lighting resources and logic resources are allocated to the resource level, and other resources constitute scene resources. This allows the separation of environmental resources from scene resources with visual attributes, making it easier to manage resources later.
[0066] Furthermore, considering that the scene to be processed may have a high scene complexity, when processing the resources in the scene to be processed, the scene to be processed may be divided first to obtain a smaller initial scene, which is specifically implemented as follows:
[0067] Determine a scene to be processed; and if the scene to be processed meets a scene division condition, divide the scene to be processed into at least one initial scene according to a scene division rule.
[0068] Specifically, the scene to be processed may be a full scene. When the scene to be processed is an animation scene, the scene to be processed may be a larger scene under a wide angle. The scene division condition may be the size of the scene. When the size of the scene to be processed is greater than the size threshold, it indicates that the scene to be processed satisfies the scene division condition. The scene division rule may be determined according to the size of the scene to be processed, and the scene to be processed may be evenly divided according to the screen area of the scene to be processed. For example, a 16k*16k scene to be processed may be divided into 256 1k*1k initial scenes.
[0069] Based on this, the scene to be processed and the size information of the scene to be processed are determined. If it is determined based on the size information that the scene to be processed meets the scene division condition, a scene division rule is determined according to the size information of the scene to be processed, and the scene to be processed is divided into at least one initial scene based on the scene division rule.
[0070] Using the above example, when the scene to be processed is 4k*4k, the size threshold can be 1k*1k. Since the size of the scene to be processed is greater than the size threshold, the scene to be processed needs to be divided. The scene division rule can be set to divide the scene to be processed into 1k*1k initial scenes. Based on this, the scene to be processed can be divided to obtain 16 1k*1k initial scenes.
[0071] In summary, when the scene to be processed meets the scene division condition, the scene to be processed is divided into at least one initial scene according to the scene division rule, and then resource processing is performed on each initial scene respectively, thereby improving the efficiency and accuracy of resource processing.
[0072] Step 204: Allocate the static resources in the static resource level to at least two size levels according to resource size, and allocate the dynamic resources in the dynamic resource level to at least two function levels according to resource function.
[0073] Specifically, after determining the scene resources corresponding to the initial scene as mentioned above, allocating the dynamic resources in the scene resources to the dynamic resource level, and allocating the static resources in the scene resources to the static resource level, the static resources in the static resource level can be allocated to at least two size levels according to the resource size, and the dynamic resources in the dynamic resource level can be allocated to at least two function levels according to the resource functions, wherein the resource size refers to the size of the resource in the initial scene, and the resource size can be calculated based on the resource length and width; the size level stores static resources of different sizes; and the function level stores dynamic resources of different functions.
[0074] Based on this, after determining the scene resources corresponding to the initial scene, allocating the dynamic resources in the scene resources to the dynamic resource level, and allocating the static resources in the scene resources to the static resource level, determine the size division rule, divide the static resources in the static resource level according to the resource size according to the size division rule, and allocate the static resources to at least two size levels according to the size division rule. Determine the function division rule, divide the dynamic resources in the dynamic resource level according to the function type according to the function division rule, and allocate the dynamic resources to at least two function levels according to the function division rule.
[0075] Furthermore, considering that static resources have various types and different sizes, static resources can be divided into three size levels according to their sizes. The specific implementation is as follows:
[0076] Determine large-size static resources, medium-size static resources and small-size static resources in the static resource hierarchy; allocate the large-size static resources to the large-size hierarchy, allocate the medium-size static resources to the medium-size hierarchy, and allocate the small-size static resources to the small-size hierarchy.
[0077] Specifically, large-size static resources refer to static resources with larger object sizes among static resources, medium-size static resources refer to static resources with relatively medium object sizes among static resources, and small-size static resources refer to static resources with smaller object sizes among static resources.
[0078] Based on this, large-size static resources with larger resource sizes, medium-size static resources with relatively medium resource sizes, and small-size static resources with smaller resource sizes are determined in the static resource hierarchy. Large-size static resources are allocated to the large-size hierarchy, medium-size static resources are allocated to the medium-size hierarchy, and small-size static resources are allocated to the small-size hierarchy. This achieves hierarchical division of static resources according to their sizes.
[0079] Using the above example, when the initial scene is a forest scene, the forest scene contains lush trees, houses, cliffs, water bodies, and various animals. Static resources are divided into levels according to the importance of the objects in the initial scene and the size of the space they occupy. Decorative gravel, tree stumps and other resources are assigned to the low importance level; static resources such as cliffs and water bodies with an area greater than 20 meters are assigned to the large size level; static resources such as trees and houses with an area greater than 5 meters and less than 20 meters are assigned to the medium size level; static resources such as road signs and flowers with an area less than 5 meters are assigned to the small size level.
[0080] In summary, the static resources under the static resource level are allocated hierarchically according to their sizes, which facilitates the subsequent hierarchical rendering and loading of scenes.
[0081] Furthermore, considering that after the static resources under the static resource level are divided into at least one size level according to size, each size level also includes multiple types of static resources, the static resources can be further divided into levels under each size level, which is specifically implemented as follows:
[0082] The processing of any one of the at least two size levels includes: determining static resources, destructible resources, semi-transparent resources and decal resources in the target size level according to resource types; allocating the static resources to the static resource level, allocating the destructible resources to the destructible resource level, allocating the semi-transparent resources to the semi-transparent resource level, and allocating the decal resources to the decal resource level.
[0083] Specifically, the target size level can be any one of the large size level, medium size level and small size level. Static resources can be static resources such as mountains, cliffs, and buildings; destructible resources can be resources corresponding to objects such as walls and houses that can be destroyed by external forces. Translucent resources can be resources with a certain degree of transparency such as water and glass; decal resources can be resources with texture characteristics such as patterns and car marks.
[0084] Based on this, the static resources in any one of the at least two size levels can be further divided into different levels. According to the resource type or the resource attribute information of the static resources, the static resources, the destructible resources, the semi-transparent resources and the decal resources are determined in the target size level. The static resources are allocated to the static resource level, the destructible resources are allocated to the destructible resource level, the semi-transparent resources are allocated to the semi-transparent resource level, and the decal resources are allocated to the decal resource level.
[0085] Using the above example, when the target size level is a large size level, static resources (mountains, cliffs, building bodies), destructible resources (houses, vehicles), semi-transparent resources (water bodies), and decal resources can be determined from the static resources contained in the large size level. Accordingly, the medium size level and the small size level can also be divided into a static resource level, a destructible resource level, a semi-transparent resource level, and a decal resource level according to the resource type or resource attribute information of the static resources.
[0086] In summary, static resources in at least two size levels are further divided into a static resource level, a destructible resource level, a semi-transparent resource level, and a decal resource level according to resource types, thereby increasing the diversity of resource levels and facilitating the management of static resources.
[0087] Furthermore, if there are static resources with associated tag information in the static resources included in the static resource level, such static resources can be allocated to a resource level, which is specifically implemented as follows:
[0088] Determine statically marked resources associated with static resource marking information from the static resources included in the static resource level; and allocate the statically marked resources to the static marked resource level.
[0089] Specifically, the static resource marking information is used to indicate the resource importance of the static resource. The static resource associated with the static resource marking information is a low-importance static resource, which is allocated to a low-importance level, that is, a static marking resource level.
[0090] Based on this, the static resource level includes static resources that are not associated with any tag information and static resources associated with static resource tag information. Static resources associated with static resource tag information are regarded as static tag resources. Static tag resources are allocated to the static tag resource level to complete the hierarchical division of static resources.
[0091] Using the above example, for the static resources in the static resource hierarchy, it is necessary not only to divide the hierarchy according to the size of the static resources, but also to divide the hierarchy according to the association of the tag information of the static resources. The static resource hierarchy contains static resources with low importance tags. Such static resources can be divided into the static tag resource hierarchy parallel to the size hierarchy to achieve multi-level division of static resources. Among them, low-importance static resources can be low-importance static resources such as stones used to enrich the visual effects of the animation scene.
[0092] In summary, the static tagged resources contained in the static resource level are allocated to the static tagged resource level to realize multi-level division of static resources, which is convenient for the management of static resources and subsequent scene rendering.
[0093] Furthermore, considering that the dynamic resources in the dynamic resource hierarchy have multiple different functions, in order to facilitate the management of dynamic resources, the dynamic resources under the dynamic resource hierarchy can be further divided into hierarchies according to the functions of the dynamic resources, which is specifically implemented as follows:
[0094] Determine dynamic model resources, dynamic destructible resources, dynamic animation resources and dynamic special effect resources in the dynamic resource level; allocate the dynamic model resources to the dynamic model resource level, allocate the dynamic destructible resources to the dynamic destructible resource level, allocate the dynamic animation resources to the dynamic animation resource level, and allocate the dynamic special effect resources to the dynamic special effect resource level.
[0095] Specifically, dynamic model resources can be dynamic common model resources among dynamic resources, and dynamic model resources can be divided into common model resources with low dynamic importance and common model resources with high dynamic importance. Dynamic destructible resources can be destructible objects containing special effects. Dynamic animation resources can be animation resources with animation effects. Dynamic special effect resources can be dynamic special effects such as skill special effects and behavior special effects, and dynamic special effect resources can be divided into special effect resources with high importance and special effect resources with low importance.
[0096] Based on this, dynamic model resources, dynamic destructible resources, dynamic animation resources, and dynamic special effects resources are determined in the dynamic resource level. Dynamic model resources are allocated to the dynamic model resource level, dynamic destructible resources are allocated to the dynamic destructible resource level, dynamic animation resources are allocated to the dynamic animation resource level, and dynamic special effects resources are allocated to the dynamic special effects resource level. The dynamic resources in the dynamic model resource level are further divided into hierarchical levels according to the importance of the resources, and the dynamic model resources in the dynamic model resource level are divided into dynamic high-importance model resources and dynamic low-importance model resources, and the dynamic high-importance model resources are allocated to the high-importance level, and the dynamic low-importance model resources are allocated to the low-importance level. The dynamic special effects resources in the dynamic special effects resource level can also be divided into hierarchical levels according to their importance, and the high-importance dynamic special effects resources in the dynamic special effects resources are allocated to the high-importance dynamic special effects resource level, and the low-importance dynamic special effects resources are allocated to the low-importance dynamic special effects resource level.
[0097] Using the above example, in the dynamic resource level, dynamic model resources can be containers with dynamic paths that can be moved by collision; dynamic destructible resources can be objects such as crystals that can be destroyed; dynamic animation resources can be animations with skins; and dynamic special effects resources can be light effects around crystals. The dynamic resource level is further divided according to the function of the resource.
[0098] In summary, the resources in the dynamic resource level are further divided into the dynamic model resource level, the dynamic destructible resource level, the dynamic animation resource level, and the dynamic special effect resource level according to the functions of the dynamic resources. This improves the level diversity of dynamic resources and facilitates the rendering and loading of resources.
[0099] Furthermore, if there are dynamic resources with associated tag information in the dynamic resources included in the dynamic resource level, the corresponding dynamic resources can be divided into resource levels according to the functions of such dynamic resources, which is specifically implemented as follows:
[0100] Determine dynamic tag model resources associated with dynamic model tag information and dynamic tag special effect resources associated with dynamic special effect tag information among the dynamic resources included in the dynamic resource level; allocate the dynamic tag model resources to the dynamic tag model resource level, and allocate the dynamic tag special effect resources to the dynamic tag special effect resource level.
[0101] Specifically, the dynamic model marking information is used to indicate the resource importance of dynamic resources, and the dynamic resources associated with the dynamic model marking information are low-importance dynamic model resources; the dynamic special effect marking information is used to indicate the resource importance of dynamic resources, and the dynamic resources associated with the dynamic special effect marking information are low-importance dynamic special effect resources.
[0102] Based on this, the dynamic resource level includes dynamic resources that are not associated with any tag information and dynamic resources that are associated with different tag information. Dynamic resources associated with dynamic model tag information are treated as dynamic tag model resources, and dynamic resources associated with dynamic special effect tag information are treated as dynamic tag special effect resources. Dynamic tag model resources are allocated to the dynamic tag model resource level, and dynamic tag special effect resources are allocated to the dynamic tag special effect resource level, completing the hierarchical division of dynamic resources.
[0103] Continuing with the above example, for the dynamic resources in the dynamic resource hierarchy, it is necessary not only to divide the hierarchy according to the functions of the dynamic resources, but also to divide the hierarchy of dynamic resources according to the association of different tag information of the dynamic resources. The dynamic resource hierarchy contains dynamic resources with low importance tags, and low importance tags are marked on dynamic model resources and dynamic special effect resources. Therefore, it is necessary to divide the dynamic resources under the dynamic resource hierarchy according to the functions and low importance tags of dynamic resources. Dynamic model resources with low importance tags in dynamic resources can be allocated to the dynamic tag model resource hierarchy, and dynamic special effect resources with low importance tags in dynamic resources can be allocated to the dynamic tag special effect resource hierarchy to realize the hierarchical division of dynamic resources. Low importance model resources and low importance special effect resources are used to enrich the dynamic visual effects in animation scenes and improve the realism of the picture.
[0104] In summary, the dynamic tag model resources contained in the dynamic resource level are allocated to the dynamic tag model resource level, and the dynamic tag special effect resources are allocated to the dynamic tag special effect resource level. This realizes the multi-level division of dynamic resources, which is convenient for the management of dynamic resources and subsequent scene rendering.
[0105] Step 206: Generate resource level information based on the static resource level, the dynamic resource level, the at least two size levels and the at least two function levels, wherein the resource level information is used to perform resource level conversion for the initial scenario.
[0106] Specifically, after allocating the static resources in the static resource level to at least two size levels according to the resource size, and allocating the dynamic resources in the dynamic resource level to at least two function levels according to the resource functions, resource level information can be generated based on the static resource level, the dynamic resource level, at least two size levels and at least two function levels. The resource level information is used to perform resource level conversion for the initial scene, wherein the resource level information refers to the resource level distribution information of the initial scene.
[0107] Based on this, after allocating the static resources in the static resource level to at least two size levels according to the resource size, and allocating the dynamic resources in the dynamic resource level to at least two function levels according to the resource functions, the static resources contained in the static resource level, the dynamic resources contained in the dynamic resource level, the resources respectively contained in at least two size levels, and the resources respectively contained in at least two function levels are determined to generate resource level information. The resource level information is used to perform resource level conversion for the initial scene, and to perform level division on the scene resources in the initial scene that does not have a scene level distribution.
[0108] Furthermore, after the resource level information is generated, scene rendering can be performed for the initial scene according to the resource level information, which is specifically implemented as follows:
[0109] A target scene corresponding to the initial scene is rendered based on the resource level information.
[0110] Based on this, the resource level division corresponding to the initial scene can be determined based on the resource level information, and the scene rendering can be performed level by level according to the inclusion relationship between the resource levels to render the target scene corresponding to the initial scene.
[0111] Using the above example, based on the resource level information, it can be determined that the scene resources corresponding to the initial scene are divided into static resource levels and dynamic resource levels, and the static resource levels and dynamic resource levels are further divided into resource levels. Therefore, the scene rendering can be started from each size level contained in the static resource level and the resource type level contained in the size level, until the rendering of the scene resources is completed, and the target scene can be obtained.
[0112] In summary, the target scene corresponding to the initial scene is rendered based on the resource level information. Scene rendering can be performed level by level, and the target scene is finally rendered to improve the rendering efficiency of the target scene.
[0113] The resource processing method provided in the present application determines the scene resources corresponding to the initial scene, and allocates the dynamic resources in the scene resources to the dynamic resource level, and allocates the static resources in the scene resources to the static resource level. The static resources in the static resource level are allocated to at least two size levels according to the resource size, and the dynamic resources in the dynamic resource level are allocated to at least two function levels according to the resource function. After the scene resources corresponding to the initial scene are hierarchically divided, the scene resources are divided into different levels according to the type. Standardized management and storage of scene resources are realized. When the scene resources are edited twice, the editing efficiency is also higher. Resource hierarchy information is generated based on the static resource level, the dynamic resource level, at least two size levels and at least two function levels, and the resource hierarchy information is used to perform resource hierarchy conversion for the initial scene. The resource hierarchy conversion is performed on the initial scene that does not have a resource hierarchy relationship, so that when the initial scene is rendered later, the scene resources corresponding to the initial scene can be rendered in sequence to improve the rendering efficiency.
[0114] The following combination Figure 3 Taking the application of the resource processing method provided in this application to the conversion of game scene resources as an example, the resource processing method is further explained. Figure 3 A processing flow chart of a resource processing method for game scene resource conversion provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0115] Step 302: When the scene to be processed meets the scene division condition, the scene to be processed is divided into at least one initial scene according to the scene division rule.
[0116] In large-scale game scenes, for scenes larger than 4k*4k, you can first divide the scene into regions, and then further divide it into hierarchical regions. Divide objects into 1k*1k regional scenes according to coordinates. For example, a 16k*16k scene will be divided into 256 1k*1k regions, and the corresponding regions will be divided according to size and type. Large objects can correspond to one regional data according to 1k*1k, so 16k*16k will correspond to 256 regional data; medium-sized objects can correspond to 4 regional data according to 1k*1k, so 16k*16k will correspond to 1024 regional data.
[0117] Step 304: Eliminate lighting resources and logic resources from the initial scene resources to obtain scene resources, and allocate the lighting resources and logic resources to resource levels.
[0118] The resource level contains lighting-related resources such as reflection probes, GI data, voxel shadow data, weather system depth maps, etc.
[0119] Step 306: Determine the scene resources corresponding to the initial scene, and allocate the dynamic resources in the scene resources to the dynamic resource level, and allocate the static resources in the scene resources to the static resource level.
[0120] Figure 4 In the scene conversion flow chart shown, for the original scene, the resources corresponding to the scene are first divided into static and dynamic categories. Dynamic and static objects are divided according to type, dynamic objects are divided into dynamic resource levels, and static objects are divided into static resource levels.
[0121] Step 308: Determine large-size static resources, medium-size static resources, small-size static resources, and static low-importance resources in the static resource hierarchy.
[0122] Step 310: allocate large-size static resources to the static large-size level, allocate medium-size static resources to the static medium-size level, allocate small-size static resources to the static small-size level, and allocate static low-importance static resources to the static low-importance level.
[0123] Static resources are further classified according to size and importance. Static resources with low importance are classified into the static low importance level; static resources with a size greater than 30 meters are classified into the static large size level; static resources with a size greater than 10 meters and less than 30 meters are classified into the static medium size level; static resources with a size less than 10 meters are classified into the static small size level.
[0124] Step 312: Determine the target level, and determine static resources, destructible resources, semi-transparent resources, and decal resources in the target level according to resource types.
[0125] Any level can be used as the target level to continue resource classification.
[0126] Step 314: Allocate static resources to the static resource level, allocate destructible resources to the destructible resource level, allocate semi-transparent resources to the semi-transparent resource level, and allocate decal resources to the decal resource level.
[0127] Separate completely static assets from the Static Assets hierarchy into the Static Models hierarchy, static destructible assets into the Static Destructible hierarchy, static translucent assets into the Static Translucent hierarchy, and static decal assets into the Static Decal hierarchy.
[0128] Step 316: Store the building's accessory accessories, vegetation, and objects associated with the vegetation system in a data file.
[0129] The attached pendant resources are restored in the form of data and directly taken over by the rendering. For vegetation and small object resources, they are also restored in the form of data, and the importance of the resources is marked in the data file. The resources are directly taken over by the rendering to reduce the complexity of the scene level.
[0130] Step 318: Determine dynamic model resources, dynamic destructible resources, dynamic animation resources, dynamic special effect resources, and dynamic low importance resources in the dynamic resource hierarchy.
[0131] Dynamic resources are classified according to their functions. Dynamic resources are divided into the following categories: dynamic model resources, dynamic destructible resources, dynamic animation resources, and dynamic special effect resources. Dynamic model resources include ordinary model resources with low dynamic importance and ordinary model resources with high dynamic importance. Dynamic special effect resources include special effect resources with low importance and special effect resources with low importance.
[0132] Step 320: Allocate dynamic model resources to the dynamic model resource level, allocate dynamic destructible resources to the dynamic destructible resource level, allocate dynamic animation resources to the dynamic animation resource level, allocate dynamic special effect resources to the dynamic special effect resource level, and allocate dynamic low importance resources to the dynamic low importance level.
[0133] After further classification of dynamic resources, scene configuration can be performed. The low-importance level will only appear in high-definition. Scene configuration includes destructible object manager and interaction manager. Dynamic destructible resources and static destructible resources can be configured by the destructible object manager. Low-importance dynamic resources are classified into the dynamic low-importance level.
[0134] In summary, the above hierarchical division is performed on the original scene, and the original scene is converted into a new scene. An independent new scene is generated for runtime use. The hierarchical planning in the new scene meets the optimization conditions and can be quickly optimized. When the original scene of the art is modified, only one scene conversion is required on the pipeline to synchronize the update to the runtime scene. The size planning, function planning and importance planning of resources are carried out to facilitate the optimization of rendering and loading strategies for large and small objects during optimization.
[0135] Corresponding to the above method embodiment, the present application also provides a resource processing device embodiment, Figure 5 FIG. 1 shows a schematic diagram of the structure of a resource processing device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:
[0136] The determination module 502 is configured to determine the scene resources corresponding to the initial scene, and allocate the dynamic resources in the scene resources to the dynamic resource level, and allocate the static resources in the scene resources to the static resource level;
[0137] an allocation module 504, configured to allocate the static resources in the static resource level to at least two size levels according to resource size, and allocate the dynamic resources in the dynamic resource level to at least two function levels according to resource function;
[0138] The conversion module 506 is configured to generate resource level information based on the static resource level, the dynamic resource level, the at least two size levels and the at least two function levels, wherein the resource level information is used to perform resource level conversion for the initial scenario.
[0139] In an optional embodiment, the determining module 502 is further configured to:
[0140] Determine initial scene resources corresponding to an initial scene, and determine lighting resources and logic resources in the initial scene resources; remove the lighting resources and the logic resources from the initial scene resources to obtain the scene resources, and allocate the lighting resources and the logic resources to a resource level.
[0141] In an optional embodiment, the allocation module 504 is further configured to:
[0142] Determine large-size static resources, medium-size static resources and small-size static resources in the static resource hierarchy; allocate the large-size static resources to the large-size hierarchy, allocate the medium-size static resources to the medium-size hierarchy, and allocate the small-size static resources to the small-size hierarchy.
[0143] In an optional embodiment, the allocation module 504 is further configured to:
[0144] The processing of any one of the at least two size levels includes: determining static resources, destructible resources, semi-transparent resources and decal resources in the target size level according to resource types; allocating the static resources to the static resource level, allocating the destructible resources to the destructible resource level, allocating the semi-transparent resources to the semi-transparent resource level, and allocating the decal resources to the decal resource level.
[0145] In an optional embodiment, the allocation module 504 is further configured to:
[0146] Determine statically marked resources associated with static resource marking information from the static resources included in the static resource level; and allocate the statically marked resources to the static marked resource level.
[0147] In an optional embodiment, the allocation module 504 is further configured to:
[0148] Determine dynamic model resources, dynamic destructible resources, dynamic animation resources and dynamic special effect resources in the dynamic resource level; allocate the dynamic model resources to the dynamic model resource level, allocate the dynamic destructible resources to the dynamic destructible resource level, allocate the dynamic animation resources to the dynamic animation resource level, and allocate the dynamic special effect resources to the dynamic special effect resource level.
[0149] In an optional embodiment, the allocation module 504 is further configured to:
[0150] Determine dynamic tag model resources associated with dynamic model tag information and dynamic tag special effect resources associated with dynamic special effect tag information among the dynamic resources included in the dynamic resource level; allocate the dynamic tag model resources to the dynamic tag model resource level, and allocate the dynamic tag special effect resources to the dynamic tag special effect resource level.
[0151] In an optional embodiment, the determining module 502 is further configured to:
[0152] Determine a scene to be processed; and if the scene to be processed meets a scene division condition, divide the scene to be processed into at least one initial scene according to a scene division rule.
[0153] In an optional embodiment, the conversion module 506 is further configured to:
[0154] A target scene corresponding to the initial scene is rendered based on the resource level information.
[0155] The resource processing method provided in the present application determines the scene resources corresponding to the initial scene, and allocates the dynamic resources in the scene resources to the dynamic resource level, and allocates the static resources in the scene resources to the static resource level. The static resources in the static resource level are allocated to at least two size levels according to the resource size, and the dynamic resources in the dynamic resource level are allocated to at least two function levels according to the resource function. After the scene resources corresponding to the initial scene are hierarchically divided, the scene resources are divided into different levels according to the type. Standardized management and storage of scene resources are realized. When the scene resources are edited twice, the editing efficiency is also higher. Resource hierarchy information is generated based on the static resource level, the dynamic resource level, at least two size levels and at least two function levels, and the resource hierarchy information is used to perform resource hierarchy conversion for the initial scene. The resource hierarchy conversion is performed on the initial scene that does not have a resource hierarchy relationship, so that when the initial scene is rendered later, the scene resources corresponding to the initial scene can be rendered in sequence to improve the rendering efficiency.
[0156] The above is a schematic scheme of a resource processing device of this embodiment. It should be noted that the technical scheme of the resource processing device and the technical scheme of the resource processing method mentioned above belong to the same concept. For details not described in detail in the technical scheme of the resource processing device, please refer to the description of the technical scheme of the resource processing method mentioned above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0157] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present application is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.
[0158] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. 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 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0159] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0160] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.
[0161] The processor 620 is used to execute computer executable instructions of the resource processing method.
[0162] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the resource processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the resource processing method described above.
[0163] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used in a resource processing method when executed by a processor.
[0164] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the resource processing method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the resource processing method described above.
[0165] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the resource processing method when executed by the chip.
[0166] An embodiment of the present specification also provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned resource processing method when executed by a processor.
[0167] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the resource processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical scheme of the resource processing method described above.
[0168] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0169] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased 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 do not include electric carrier signals and telecommunication signals.
[0170] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0171] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0172] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A resource processing method, It is characterized in that include: Determine scene resources corresponding to the initial scene, and allocate dynamic resources in the scene resources to the dynamic resource level, and allocate static resources in the scene resources to the static resource level; Allocating the static resources in the static resource level to at least two size levels according to resource size, and allocating the dynamic resources in the dynamic resource level to at least two function levels according to resource function; Resource level information is generated based on the static resource level, the dynamic resource level, the at least two size levels and the at least two function levels, and the resource level information is used to perform resource level conversion for the initial scenario.
2. The resource processing method according to claim 1, It is characterized in that The step of determining the scene resources corresponding to the initial scene includes: Determine an initial scene resource corresponding to the initial scene, and determine a lighting resource and a logic resource in the initial scene resource; The lighting resources and the logic resources are eliminated from the initial scene resources to obtain the scene resources, and the lighting resources and the logic resources are allocated to a resource level.
3. The resource processing method according to claim 1, It is characterized in that The allocating the static resources in the static resource level to at least two size levels according to resource size includes: Determining large-size static resources, medium-size static resources, and small-size static resources in the static resource hierarchy; The large-size static resources are allocated to a large-size layer, the medium-size static resources are allocated to a medium-size layer, and the small-size static resources are allocated to a small-size layer.
4. The resource processing method according to claim 1, It is characterized in that After allocating the static resources in the static resource level to at least two size levels according to resource size, the method further includes: The processing of any one of the at least two size levels includes: Determining, by resource type, static resources, destructible resources, semi-transparent resources, and decal resources in the target size level; The static resources are allocated to a static resource level, the destructible resources are allocated to a destructible resource level, the semi-transparent resources are allocated to a semi-transparent resource level, and the decal resources are allocated to a decal resource level.
5. The resource processing method according to claim 1, It is characterized in that Before allocating the static resources in the static resource level to at least two size levels according to resource sizes, the method further includes: Determining a static marking resource associated with static resource marking information among the static resources included in the static resource level; The statically marked resources are allocated to a statically marked resource level.
6. The resource processing method according to claim 1, It is characterized in that The allocating the dynamic resources in the dynamic resource level to at least two functional levels according to resource functions includes: Determining dynamic model resources, dynamic destructible resources, dynamic animation resources, and dynamic special effect resources in the dynamic resource hierarchy; The dynamic model resources are allocated to a dynamic model resource level, the dynamic destructible resources are allocated to a dynamic destructible resource level, the dynamic animation resources are allocated to a dynamic animation resource level, and the dynamic special effect resources are allocated to a dynamic special effect resource level.
7. The resource processing method according to claim 1, It is characterized in that Before allocating the dynamic resources in the dynamic resource level to at least two functional levels according to resource functions, the method further includes: Determine, from the dynamic resources included in the dynamic resource level, a dynamic marking model resource associated with dynamic model marking information and a dynamic marking special effect resource associated with dynamic special effect marking information; The dynamic marking model resources are allocated to the dynamic marking model resource level, and the dynamic marking special effect resources are allocated to the dynamic marking special effect resource level.
8. The resource processing method according to claim 1, It is characterized in that Before determining the scene resources corresponding to the initial scene, the method further includes: Identify the scenarios to be processed; When the scene to be processed meets the scene division condition, the scene to be processed is divided into at least one initial scene according to the scene division rule.
9. The resource processing method according to claim 1, It is characterized in that After the resource hierarchy information is generated based on the static resource hierarchy, the dynamic resource hierarchy, the at least two size hierarchies and the at least two function hierarchies, the method further includes: A target scene corresponding to the initial scene is rendered based on the resource level information.
10. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the resource processing method according to any one of claims 1 to 9.
11. A computer-readable storage medium storing computer instructions, It is characterized in that When the instruction is executed by the processor, the steps of the resource processing method described in any one of claims 1 to 9 are implemented.
12. A computer program product comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the steps of the resource processing method described in any one of claims 1 to 9 are implemented.
