Game scene optimization method and system based on dynamic rendering
By obtaining real-time rendering status data of the game scene and using pre-trained models to analyze rendering demand characteristics, a dynamic optimization strategy is generated, which solves the problems of resource waste and insufficient performance in traditional rendering optimization methods and achieves improvements in game picture quality and performance.
Patent Information
- Application Number
- CN202511086382.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-05
AI Technical Summary
Traditional game scene rendering optimization methods cannot be dynamically adjusted according to the actual situation during game runtime, resulting in problems such as screen freezes and frame drops. It is also difficult to fully consider the importance of scene elements and the sensitivity differences of rendering resources, resulting in resource waste and affecting game smoothness and efficiency.
By obtaining the real-time rendering status data of the game scene, calling the pre-trained rendering demand analysis model to analyze the rendering demand characteristics of the scene elements, generating dynamic optimization strategies, adjusting rendering parameters, and achieving accurate allocation and rational utilization of resources.
It improves the quality of game graphics and running performance, provides a smoother gaming experience, reduces hardware requirements, and improves game compatibility.
Smart Images

Figure CN120586387B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game development technology, and in particular to a game scene optimization method and system based on dynamic rendering. Background Art
[0002] In the field of game development, with the continuous improvement of game graphics quality and the increasing complexity of game scenes, balancing the aesthetics of the game and runtime performance has become a pressing issue. Traditional game scene rendering optimization methods primarily rely on static optimization, presetting rendering parameters for each scene element, such as texture quality and model level of detail, during the game development phase. However, these methods have significant limitations. First, statically set rendering parameters cannot be dynamically adjusted to the actual game runtime. When a large number of elements appear in the game scene or the player's perspective changes rapidly, fixed rendering parameters can cause problems such as screen freezes and frame drops, seriously affecting game smoothness and the player experience. Second, static optimization methods fail to fully account for the importance of different scene elements in the game and their varying sensitivity to rendering resources. For some visually less important elements that consume a lot of rendering resources, they are still rendered using fixed, high parameters, resulting in a waste of rendering resources and reducing the overall game efficiency. Summary of the Invention
[0003] In view of the above-mentioned problems, in combination with the first aspect of the present invention, an embodiment of the present invention provides a game scene optimization method based on dynamic rendering, the method comprising:
[0004] Obtaining a real-time rendering status data set of the current game scene, wherein the real-time rendering status data set includes rendering resource occupancy information of scene elements and picture frame rendering time parameters;
[0005] Calling a pre-trained rendering requirement analysis model to perform rendering requirement analysis on the real-time rendering state data set to obtain a rendering requirement feature set of the scene element, wherein the rendering requirement feature set includes an element visual importance feature and a rendering resource sensitivity feature;
[0006] generating a scene element dynamic optimization strategy based on the rendering requirement feature set, wherein the scene element dynamic optimization strategy includes element detail level adjustment rules and rendering resource allocation priority parameters;
[0007] Performing a rendering parameter adjustment operation on a target scene element in the game scene according to the scene element dynamic optimization strategy to generate adjusted scene rendering configuration data;
[0008] The scene rendering configuration data is input into the game rendering pipeline for real-time rendering processing, and an optimized game scene frame sequence is output.
[0009] On the other hand, an embodiment of the present invention also provides a game scene optimization system based on dynamic rendering, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium is connected to the processor, the machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.
[0010] Based on the above aspects, the embodiment of the present invention obtains the real-time rendering status data set of the current game scene, comprehensively grasps the key information such as the rendering resource occupancy of the scene elements and the rendering time of the picture frame, calls the pre-trained rendering requirement analysis model to analyze the real-time rendering status data set, and obtains a rendering requirement feature set including the element visual importance feature and the rendering resource sensitivity feature. It can deeply explore the characteristics of each scene element, generate a dynamic optimization strategy for the scene element based on the rendering requirement feature set, formulate element detail level adjustment rules and rendering resource allocation priority parameters according to the different characteristics of the elements, realize the accurate allocation and reasonable utilization of rendering resources, perform rendering parameter adjustment operations on the target scene elements according to the dynamic optimization strategy, generate adjusted scene rendering configuration data, which can adapt to changes in the game scene in real time, and finally input the scene rendering configuration data into the game rendering pipeline for real-time rendering processing, and output the optimized game scene picture frame sequence, effectively improving the quality and running performance of the game picture, bringing players a smoother and more exquisite game experience, while reducing the game's requirements for hardware equipment and improving the game's compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic diagram of the execution flow of the game scene optimization method based on dynamic rendering provided by an embodiment of the present invention.
[0012] Figure 2 Schematic diagram of exemplary hardware and software components of a game scene optimization system based on dynamic rendering provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] The present invention will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of a game scene optimization method based on dynamic rendering provided by an embodiment of the present invention. The game scene optimization method based on dynamic rendering is introduced in detail below.
[0014] Step S110: Obtain a real-time rendering state data set of the current game scene, which contains rendering resource occupation information of scene elements and picture frame rendering time consumption parameters.
[0015] In this embodiment, a forest scene of an open-world role-playing game is taken as an example, which contains various scene elements, such as different types of trees, rocks with different shapes, babbling brooks, distant mountains, flying birds in the sky, moss on the ground, and interactive props around the player, etc.
[0016] To obtain the real-time rendering state data set, the data collection component in the game engine is connected to the rendering pipeline of the game engine, which can monitor and extract relevant data in real time.
[0017] For the rendering resource occupation information of scene elements, each scene element is implemented individually. For example, for a cypress tree, the data collection component records the number of polygons contained in the model, the relevant data of the trunk and leaf texture, the complexity information of the shader used to render the cypress tree, etc. For a piece of green stone, the corresponding polygon number, texture information and shader complexity information are also collected.
[0018] The collection of picture frame rendering time consumption parameters covers the rendering process of each frame of the entire scene. After the game engine completes the rendering of each frame of picture, the data collection component records the time consumed in the process, which is in milliseconds. This parameter will change in real time with the changes of elements in the scene, player operations and other dynamic factors.
[0019] The collected data is summarized and arranged to form a real-time rendering state data set containing rendering resource occupation information of all scene elements and continuous multi-frame picture frame rendering time consumption parameters. The set is stored in the form of a data list, and the information of each scene element is distinguished by a unique identifier, which facilitates accurate correspondence to specific scene elements in subsequent processing.
[0020] Step S120: Call the pre-trained rendering requirement analysis model to analyze the rendering requirement of the real-time rendering state data set, and obtain a rendering requirement feature set of the scene elements, which contains element visual importance features and rendering resource sensitivity features.
[0021] In this embodiment, after obtaining the real-time rendering state data set, the pre-trained rendering requirement analysis model is called to process it. The rendering requirement analysis model is trained based on a large amount of historical rendering data of forest scenes and other similar game scenes, and can analyze the rendering requirement features of each scene element from the input data.
[0022] The rendering demand analysis model takes as input a real-time rendering status dataset and outputs a rendering demand feature set consisting of element visual importance features and rendering resource sensitivity features. During processing, the model first extracts and processes features from the input data, then calculates the two features separately through different sub-networks, and finally integrates the results to form the rendering demand feature set.
[0023] Step S121: performing structured parsing processing on the scene element rendering resource occupancy information in the real-time rendering status data set to obtain a resource occupancy feature vector including polygon quantity parameters, texture resolution parameters, and shader complexity parameters.
[0024] In this embodiment, the structured parsing process is intended to extract standardized feature parameters from the original rendering resource usage information. Taking a fir tree in a forest scene as an example, the parsing process is as follows.
[0025] Step S1211: traverse the scene element identification list in the real-time rendering status data set to determine the storage path of the rendering resource occupancy information corresponding to each scene element.
[0026] The scene element identifier list is a list containing the unique identifiers of all elements in the current scene, such as "cedar 002", "rock 018", "stream 005", etc. The traversal starts from the first identifier in the list and reads each identifier in turn.
[0027] For each identifier, a pre-set mapping table is queried. This mapping table records the correspondence between each scene element identifier and the storage path of its real-time rendering resource usage information. For example, when traversing to "fir tree 002", the mapping table shows that its rendering resource usage information is stored in the path " / game / scene / forest / elements / fir002 / resources"; when traversing to "rock 018", the corresponding storage path is " / game / scene / forest / elements / rock018 / resources".
[0028] Step S1212: reading the mesh data file of the scene element according to the storage path, parsing the vertex index list and triangle face data in the mesh data file, and counting the total number of triangle faces as a polygon number parameter.
[0029] Taking "fir tree 002" as an example, according to the determined storage path " / game / scene / forest / elements / fir002 / resources", the mesh data file under the storage path is read. The mesh data file is usually stored in a set format, such as FBX format or OBJ format.
[0030] When parsing the mesh data file, we first extract the vertex index list and triangle face data. The vertex index list records the numbers and coordinates of each vertex that makes up the tree model, while the triangle face data records which vertices constitute a triangle face. Each triangle face is identified by three vertex indices. We traverse the triangle face data and count the total number of triangle faces contained in it. This total number becomes the polygon count parameter for "Fir Tree 002."
[0031] Step S1213: Read the texture resource file of the scene element, parse the header information of the texture resource file, extract the width parameter and height parameter of the texture, and use the product of the width parameter and the height parameter as the texture resolution parameter.
[0032] Taking "cedar 002" as an example, the texture resource file is read in the storage path of its rendering resource occupancy information. The file may be an image file in PNG format or JPEG format.
[0033] Parse the header information of the texture resource file, which contains various texture properties such as width, height, and number of color channels. Extract the width and height parameters and multiply them together to obtain the texture resolution parameter for "Fir Tree 002."
[0034] The above processing is performed on the leaf texture and trunk texture of "Fir Tree 002" respectively to obtain their respective texture resolution parameters. Then, based on the importance of the texture in rendering, these parameters are further integrated or recorded separately.
[0035] Step S1214: Read the shader configuration file of the scene element, parse the number of instruction sets, the number of samplers and the computational complexity tag in the shader configuration file, perform weighted summation processing on the number of instruction sets, the number of samplers and the computational complexity tag according to a preset complexity scoring rule, and obtain the shader complexity parameter.
[0036] Taking "Fir Tree 002" as an example, read its shader configuration file, which is usually written in a shader language such as GLSL or HLSL.
[0037] Parse the shader configuration file and count the number of instruction sets contained therein, that is, the total number of various calculation instructions required during the execution of the shader; count the number of samplers, that is, the number of samplers used to sample textures in the shader; extract the computational complexity tag, which is a pre-set identifier based on the logical complexity of the shader, such as simple, medium, complex, etc. Different tags correspond to different values.
[0038] The default complexity scoring rule assigns weights to the number of instruction sets, the number of samplers, and the computational complexity flag. The shader complexity parameter for "Fir Tree 002" is calculated by multiplying the number of instruction sets by their weights, the number of samplers by their weights, and the value of the computational complexity flag by their weights. These three products are then added together.
[0039] Step S1215: Arrange the polygon number parameter, the texture resolution parameter, and the shader complexity parameter according to a preset feature dimension order to generate a resource occupancy feature vector with three-dimensional feature dimensions.
[0040] After obtaining the polygon number parameter, texture resolution parameter and shader complexity parameter of "Fir Tree 002", these three parameters are arranged in the preset feature dimension order, that is, the polygon number parameter first, then the texture resolution parameter, and finally the shader complexity parameter, to form a three-dimensional vector.
[0041] Other elements in the scene, such as "Rock 018", also generate their own resource occupation feature vectors in the same way.
[0042] Step S1216: normalizing each characteristic parameter in the resource occupancy characteristic vector so that the value range of each characteristic parameter is mapped to a preset standard numerical range.
[0043] The preset standard value range is 0 to 1. For the resource usage feature vector of "cedar 002", the polygon number parameter, texture resolution parameter and shader complexity parameter are normalized respectively.
[0044] Taking the polygon count parameter as an example, collect the polygon count parameters of all scene elements such as trees and rocks, find the maximum and minimum values, subtract the minimum value from the polygon count parameter, and then divide it by the difference between the maximum and minimum values to get the normalized polygon count parameter.
[0045] Similarly, the texture resolution parameter and shader complexity parameter are processed similarly. In this way, after the resource usage feature vector of "Fir Tree 002" is normalized, each element has a value between 0 and 1.
[0046] Step S122: performing time domain distribution analysis on the frame rendering time parameters in the real-time rendering state data set to generate a rendering time distribution feature matrix including a frame time mean parameter, a frame time fluctuation variance parameter, and a time peak occurrence frequency parameter.
[0047] In this embodiment, the temporal distribution analysis process aims to extract parameters that reflect the distribution characteristics of the consecutive frame rendering time parameters. Taking the consecutive rendering process of a forest scene as an example, the following process is performed.
[0048] Step S1221: extracting a preset number of consecutive frame rendering time parameters from the real-time rendering status data set to form a time domain time sequence.
[0049] The preset number is determined based on the game's frame rate and rendering performance monitoring requirements. The frame rendering time parameters for several consecutive frames are extracted and recorded in the order of the time each frame is rendered.
[0050] From the real-time rendering state data set, these time-consuming parameters are extracted in chronological order to form a sequence, namely the time-domain time-consuming sequence.
[0051] Step S1222: Calculate the arithmetic mean of all the time consumption parameters in the time domain time consumption sequence, and use the arithmetic mean as the frame time consumption mean parameter.
[0052] For a time-domain timing sequence, calculate its arithmetic mean. Add up all the timing parameters in the sequence to get the total, then divide the total by the number of parameters. The result is the mean frame timing parameter, which reflects the average level of frame rendering time during this period.
[0053] Step S1223: Calculate the arithmetic mean of the squares of the differences between each time consumption parameter in the time domain time consumption sequence and the frame time consumption mean parameter, and use the arithmetic mean as the frame time consumption fluctuation variance parameter.
[0054] After obtaining the frame time average parameter, for each time consumption parameter in the time domain time consumption sequence, the difference between the parameter and the frame time average parameter is calculated, and then the difference is squared.
[0055] Add up all these square values to get the total, and then divide the total by the number of parameters. The result is the frame time fluctuation variance parameter. The frame time fluctuation variance parameter reflects the degree of fluctuation in the frame rendering time. The larger the variance, the more severe the time fluctuation.
[0056] Step S1224: setting a time consumption peak threshold parameter, traversing the time domain time consumption sequence, counting the ratio of the number of frames whose time consumption parameter is greater than the time consumption peak threshold parameter to the total number of frames, and using the ratio as the time consumption peak occurrence frequency parameter.
[0057] The peak time threshold parameter is set according to the target frame rate of the game. Traverse the time sequence of the time domain and count the number of frames whose time parameter is greater than the peak time threshold parameter.
[0058] Calculate the ratio of the number of frames to the total number of frames. This ratio is the peak time occurrence frequency parameter, which reflects the frequency of rendering time exceeding the peak threshold.
[0059] Step S1225: construct a two-dimensional feature matrix, wherein the first row elements of the two-dimensional feature matrix are the frame time mean parameters, the second row elements are the frame time fluctuation variance parameters, and the third row elements are the time peak occurrence frequency parameters, to generate a rendering time distribution feature matrix.
[0060] The two-dimensional feature matrix has 3 rows and 1 column. The calculated frame duration mean parameter is used as the element in the first row, the frame duration fluctuation variance parameter is used as the element in the second row, and the duration peak frequency parameter is used as the element in the third row. The two-dimensional feature matrix constructed in this way is the rendering duration distribution feature matrix.
[0061] Step S1226: performing row vector normalization processing on the rendering time distribution feature matrix so that the module length of each row element in the rendering time distribution feature matrix is equal to a preset unit module length value.
[0062] The default unit modulus value is 1. Normalize each row of the rendering time distribution matrix. Take the first row's mean frame time parameter as an example and calculate its modulus. Since it is a single element, the modulus is the absolute value of the parameter. Divide this parameter by the modulus to obtain the normalized mean frame time parameter.
[0063] Similarly, similar processing is performed on the frame duration fluctuation variance parameter in the second row and the duration peak occurrence frequency parameter in the third row. After processing, the modulus length of each row element in the rendering time distribution feature matrix is 1.
[0064] Step S123: Input the resource occupancy feature vector and the rendering time distribution feature matrix into the feature fusion layer of the rendering demand analysis model, calculate the association weight coefficient of the resource feature and the time consumption feature through the feature channel attention mechanism, and generate a fusion association feature tensor.
[0065] In this embodiment, the feature fusion layer is used to fuse the resource occupancy feature vector and the rendering time distribution feature matrix to obtain a fused correlation feature tensor that can comprehensively reflect the information of the two.
[0066] For example, the resource usage feature vector of "Fir Tree 002" and the rendering time distribution feature matrix of the forest scene are input into the feature fusion layer. The feature channel attention mechanism analyzes each channel of these two features and calculates the correlation weight coefficient between the resource feature and the rendering time feature.
[0067] The calculation process of the association weight coefficient is to perform multiple convolution and pooling operations on the resource usage feature vector and the rendering time distribution feature matrix to extract the key features of both. Then, the degree of association between each channel is calculated through a fully connected layer to obtain a series of weight coefficients. The weight coefficients reflect the strength of association between each dimension of the resource usage feature and each dimension of the rendering time distribution feature.
[0068] Based on these correlation weights, a weighted fusion is performed on the resource usage feature vector and the rendering time distribution feature matrix. Each element of the resource usage feature vector is multiplied by the corresponding weight coefficient, and each element of the rendering time distribution feature matrix is also multiplied by the corresponding weight coefficient. The weighted results are then concatenated along the set dimensions to form a fused correlation feature tensor. This fused correlation feature tensor contains information on both resource usage and rendering time, and reflects the correlation between the two.
[0069] Step S124: Call the visual importance assessment subnetwork of the rendering demand analysis model to perform spatial attention calculation processing on the fused correlation feature tensor, extract the visual focus area ratio parameters and the player's perspective stay time ratio parameters of the scene elements in the game screen, and perform weighted combination of the visual focus area ratio parameters and the player's perspective stay time ratio parameters to obtain the element visual importance features.
[0070] In this embodiment, the visual importance assessment sub-network is specifically used to assess the visual importance of scene elements. Taking the fused correlation feature tensor of "cedar 002" as an example, it is input into the visual importance assessment sub-network for processing.
[0071] Spatial attention calculation and processing determines the visual focus area of scene elements in the game screen by analyzing and fusing information related to spatial position in the associated feature tensor. The visual focus area is the area of the game screen that easily attracts the player's attention, such as the center of the screen or areas with strong color contrast.
[0072] The ratio of the number of pixels of a scene element in the visual focus area to the total number of pixels of that element is extracted as the visual focus area ratio parameter. For example, the ratio of the number of pixels of "cedar tree 002" in the visual focus area to the total number of pixels is the visual focus area ratio parameter of the cedar tree.
[0073] At the same time, the ratio of the player's perspective dwell time on the scene element to the total game time is extracted as the player's perspective dwell time ratio parameter. For example, the ratio of the player's perspective dwell time on "cedar tree 002" to the total game time is the player's perspective dwell time ratio parameter for that cedar tree.
[0074] Then, the visual focus area proportion parameter and the player view angle stay duration proportion parameter are combined by weighting. The two parameters are respectively set with weights, the visual focus area proportion parameter is multiplied by its weight, the player view angle stay duration proportion parameter is multiplied by its weight, and then the two products are added to obtain the element visual importance feature. The element visual importance feature corresponding to "Pine Tree 002" is obtained through the above processing.
[0075] Step S125: The resource sensitivity analysis subnetwork of the rendering requirement analysis model is called to perform resource influence degree evaluation processing on the fusion correlation feature tensor, and a ratio parameter of a resource occupation change amount and a rendering time consumption change amount of the scene element is calculated, and the ratio parameter is taken as a rendering resource sensitivity feature.
[0076] In this embodiment, the resource sensitivity analysis subnetwork is used to analyze the sensitivity of the scene element to resource changes. Taking the fusion correlation feature tensor of "Pine Tree 002" as an example, it is input into the subnetwork for processing.
[0077] The resource influence degree evaluation processing evaluates the influence degree of the resource occupation change on the rendering time consumption by analyzing the correlation information of the resource occupation and the rendering time consumption in the fusion correlation feature tensor. Specifically, the change amount of the resource occupation, such as the change amount of the polygon number, the change amount of the texture resolution, etc., is determined first, then the change amount of the corresponding rendering time consumption is determined, and then the change amount of the resource occupation is divided by the change amount of the rendering time consumption to obtain the ratio parameter, which is the rendering resource sensitivity feature. The rendering resource sensitivity feature of "Pine Tree 002" is obtained through the above calculation.
[0078] Step S126: The element visual importance feature and the rendering resource sensitivity feature are associated and stored according to the unique identifier of the scene element to form a rendering requirement feature set of the scene element.
[0079] In this embodiment, the element visual importance feature and the rendering resource sensitivity feature of each scene element are associated with the unique identifier of the element. For example, the element visual importance feature and the rendering resource sensitivity feature of "Pine Tree 002" are both associated with the unique identifier "Pine Tree 002", and the element visual importance feature and the rendering resource sensitivity feature of "Rock 018" are both associated with the unique identifier "Rock 018".
[0080] All the associated information is integrated and stored to form a rendering requirement feature set of the scene element, which facilitates the quick query and use of the rendering requirement feature of each scene element in the subsequent steps.
[0081] Step S130: generating a scene element dynamic optimization strategy based on the rendering requirement feature set, wherein the scene element dynamic optimization strategy includes element detail level adjustment rules and rendering resource allocation priority parameters.
[0082] In this embodiment, a dynamic optimization strategy for each scene element is generated based on the element visual importance feature and the rendering resource sensitivity feature in the rendering requirement feature set.
[0083] Step S131: determining detail level adjustment threshold parameters of scene elements based on the element visual importance characteristics, wherein the detail level adjustment threshold parameters include a high visual importance threshold interval, a medium visual importance threshold interval, and a low visual importance threshold interval.
[0084] In this embodiment, the threshold intervals for detail level adjustment are divided according to the visual importance features of the elements.
[0085] Step S1311: collecting element visual importance features of all scene elements in the rendering requirement feature set to form a visual importance feature set.
[0086] The element visual importance features of all scene elements in the rendering requirement feature set are collected to form a visual importance feature set, which includes the element visual importance features of all scene elements such as trees, rocks, streams, etc. in the forest scene.
[0087] Step S1312: sorting the visual importance feature set in descending order to obtain a sorted visual importance feature sequence.
[0088] All element visual importance features in the visual importance feature set are sorted in descending order to obtain a sorted visual importance feature sequence.
[0089] Step S1313: Divide the sorted visual importance feature sequence into three consecutive subsequences according to a preset ratio, wherein the first subsequence contains the first preset percentage of feature elements, the second subsequence contains the middle preset percentage of feature elements, and the third subsequence contains the last preset percentage of feature elements.
[0090] According to a preset ratio, such as the first 30%, the middle 40%, and the last 30%, the sorted visual importance feature sequence is divided into three consecutive subsequences, that is, the first subsequence contains the first 30% of the feature elements in the sorted visual importance feature sequence, the second subsequence contains the middle 40% of the feature elements, and the third subsequence contains the last 30% of the feature elements. For example, if the sorted visual importance feature sequence has a total of 100 feature elements, then the first subsequence contains the first 30 feature elements, the second subsequence contains the 31st to 70th feature elements, and the third subsequence contains the 71st to 100th feature elements.
[0091] Step S1314: extracting the minimum eigenvalue in the first subsequence as the lower limit of the high visual importance threshold interval, and setting the upper limit of the high visual importance threshold interval as the theoretical maximum value of the element visual importance feature.
[0092] Of the three subsequences, find the minimum eigenvalue for the first subsequence. Since the first subsequence is the largest in the sorted visual importance feature sequence, its minimum eigenvalue is also relatively large. This minimum eigenvalue is used as the lower limit of the high visual importance threshold interval.
[0093] The theoretical maximum value of an element's visual importance feature is an upper limit determined by the feature's definition and calculation method. For example, when an element's visual importance feature is weighted by multiple weighting parameters, the theoretical maximum value is the maximum value. The upper limit of the high visual importance threshold interval is set to the theoretical maximum value, so that the high visual importance threshold interval consists of the lower limit and the theoretical maximum value.
[0094] Step S1315: extracting the minimum eigenvalue in the second subsequence as the lower limit of the medium visual importance threshold interval, and extracting the minimum eigenvalue in the first subsequence as the upper limit of the medium visual importance threshold interval.
[0095] For the second subsequence, the minimum eigenvalue is extracted and used as the lower limit of the medium visual importance threshold interval. The upper limit of the medium visual importance threshold interval is the minimum eigenvalue in the first subsequence, so that the medium visual importance threshold interval is connected to the high visual importance threshold interval and is below it.
[0096] For example, if the minimum eigenvalue of the first subsequence is A and the minimum eigenvalue of the second subsequence is B, then the visual importance threshold interval is from B to A.
[0097] Step S1316: extracting the minimum eigenvalue in the third subsequence as the lower limit of the low visual importance threshold interval, and extracting the minimum eigenvalue in the second subsequence as the upper limit of the low visual importance threshold interval.
[0098] For the third subsequence, the minimum eigenvalue is extracted and used as the lower limit of the low visual importance threshold interval. The upper limit of the low visual importance threshold interval is the minimum eigenvalue in the second subsequence, so that the low visual importance threshold interval is connected to the medium visual importance threshold interval.
[0099] If the minimum eigenvalue of the second subsequence is B and the minimum eigenvalue of the third subsequence is C, then the low visual importance threshold interval is from C to B.
[0100] Step S1317: combining the high visual importance threshold interval, the medium visual importance threshold interval, and the low visual importance threshold interval into a detail level adjustment threshold parameter.
[0101] The determined high visual importance threshold interval, medium visual importance threshold interval and low visual importance threshold interval are integrated together to form the detail level adjustment threshold parameter.
[0102] Step S132: Classify the scene elements according to the threshold parameters adjusted according to the detail level, mark the scene elements whose visual importance characteristics fall into the high visual importance threshold interval as core visual elements, mark those falling into the medium visual importance threshold interval as secondary visual elements, and mark those falling into the low visual importance threshold interval as background visual elements.
[0103] In this embodiment, the threshold parameter is adjusted according to the detail level to classify each scene element in the forest scene.
[0104] The visual importance characteristics of each scene element are obtained one by one to determine which threshold range the characteristic falls into. If the element visual importance characteristic falls into the high visual importance threshold range, then the scene element is marked as a core visual element, such as a quest NPC near the player, a tree at a key plot trigger point, etc.; if it falls into the medium visual importance threshold range, it is marked as a secondary visual element, such as ordinary trees and rocks within a certain range around the player; if it falls into the low visual importance threshold range, it is marked as a background visual element, such as mountains in the distance, clouds in the sky, etc.
[0105] Step S133: Calculate the resource allocation priority parameter of the scene element based on the rendering resource sensitivity feature, and the resource allocation priority parameter is obtained by multiplying the sensitivity coefficient and the visual importance weight, wherein the sensitivity coefficient is the normalized result of the rendering resource sensitivity feature, and the visual importance weight is the normalized result of the element visual importance feature.
[0106] In this embodiment, the resource allocation priority parameter is calculated by using the rendering resource sensitivity feature and the element visual importance feature.
[0107] Step S1331: collecting rendering resource sensitivity features of all scene elements in the rendering requirement feature set to form a resource sensitivity feature set.
[0108] The rendering resource sensitivity features of all scene elements in the rendering requirement feature set are collected to form a resource sensitivity feature set, which includes the rendering resource sensitivity features of all scene elements such as trees, rocks, streams, etc. in the forest scene.
[0109] Step S1332: normalizing the resource sensitivity feature set, mapping the value of each rendering resource sensitivity feature to a preset sensitivity value range, and obtaining a sensitivity coefficient.
[0110] In this embodiment, the preset sensitivity value range is 0 to 1. Each feature value in the resource sensitivity feature set is normalized.
[0111] Taking one of the rendering resource sensitivity features as an example, we collect the maximum and minimum values in the resource sensitivity feature set. Then, we subtract the minimum value from the feature value, and divide it by the difference between the maximum and minimum values. The result is the sensitivity coefficient corresponding to the rendering resource sensitivity feature. In this way, all rendering resource sensitivity features are mapped to the range of 0 to 1.
[0112] Step S1333: collecting element visual importance features of all scene elements in the rendering requirement feature set to form a visual importance feature set.
[0113] The element visual importance features of all scene elements in the rendering requirement feature set are collected again to form a visual importance feature set, which is the same as the visual importance feature set formed in step S1311.
[0114] Step S1334: normalizing the visual importance feature set, mapping the value of each element's visual importance feature to a preset weight value range, and obtaining a visual importance weight.
[0115] The preset weight value range is 0 to 1. The visual importance feature of each element in the visual importance feature set is normalized.
[0116] Taking the visual importance feature of one element as an example, we find the maximum and minimum values in the visual importance feature set. We subtract the minimum value from the feature value, and then divide it by the difference between the maximum and minimum values. The result is the visual importance weight corresponding to the visual importance feature of the element. After processing, the visual importance features of all elements are within the range of 0 to 1.
[0117] Step S1335: traverse each scene element, perform a product operation on the sensitivity coefficient of the scene element and the visual importance weight, and obtain the resource allocation priority parameter of the scene element.
[0118] Traverse each scene element in the forest scene, obtain the corresponding sensitivity coefficient and visual importance weight for each scene element, multiply these two values, and the product obtained is the resource allocation priority parameter of the scene element.
[0119] For example, the sensitivity coefficient of "cedar 002" is 0.6 and the visual importance weight is 0.7, so its resource allocation priority parameter is 0.6 multiplied by 0.7.
[0120] Step S1336: normalizing the resource allocation priority parameters of all scene elements so that the value range of the resource allocation priority parameters is mapped to a preset priority value interval.
[0121] The preset priority value range is 0 to 1. Collect the resource allocation priority parameters of all scene elements, find the maximum and minimum values, and then for each resource allocation priority parameter, subtract the minimum value from the parameter, and then divide it by the difference between the maximum and minimum values to obtain the normalized resource allocation priority parameter so that its value is in the range of 0 to 1.
[0122] Step S134: formulating a first level of detail adjustment rule for the core visual element, wherein the first level of detail adjustment rule includes a strategy of maintaining the highest level of detail parameter and prioritizing the allocation of rendering resources.
[0123] In this embodiment, core visual elements have a significant impact on the visual effects of the game screen and require high rendering quality. Therefore, the first level of detail adjustment rule formulated for core visual elements stipulates that the level of detail parameters of core visual elements are maintained at the highest level, including the polygon count parameter, texture resolution parameter, and shader complexity parameter, all of which are at the highest value, and they enjoy priority in rendering resource allocation.
[0124] Step S135: Formulate a second detail level adjustment rule for the secondary visual element, wherein the second detail level adjustment rule includes a strategy for dynamically adjusting detail level parameters according to real-time rendering time, lowering one detail level when the rendering time exceeds a preset threshold, and raising one detail level when the rendering time is lower than the preset threshold.
[0125] Secondary visual elements are of medium visual importance, and their level of detail parameters can be dynamically adjusted based on the real-time rendering situation. The second level of detail adjustment rule stipulates that when the real-time rendering time exceeds a certain preset threshold, it indicates that the current rendering pressure is high, and the level of detail parameters of the secondary visual elements need to be lowered to reduce the rendering burden. When the real-time rendering time is below a certain preset threshold, the rendering pressure is low, and the level of detail parameters of the secondary visual elements can be increased to improve image quality.
[0126] Step S136: formulating a third level of detail adjustment rule for the background visual element, wherein the third level of detail adjustment rule includes a strategy of fixing a minimum level of detail parameter and delaying allocation of rendering resources.
[0127] Background visual elements play a secondary role in the game's visuals and have little impact on the visuals. The third level of detail adjustment rule stipulates that the level of detail parameters of background visual elements are fixed at the lowest level, and rendering resource allocation is delayed to ensure that core and secondary visual elements have sufficient rendering resources.
[0128] Step S137: Integrate the first detail level adjustment rule, the second detail level adjustment rule, the third detail level adjustment rule, and the resource allocation priority parameter to generate a scene element dynamic optimization strategy.
[0129] The LOD adjustment rules for core, secondary, and background visual elements, along with the resource allocation priority parameters for all scene elements, are integrated into a complete scene element dynamic optimization strategy. This scene element dynamic optimization strategy specifies the LOD adjustment method and resource allocation order for each scene element.
[0130] Step S140: performing a rendering parameter adjustment operation on a target scene element in the game scene according to the scene element dynamic optimization strategy to generate adjusted scene rendering configuration data.
[0131] In this embodiment, according to the scene element dynamic optimization strategy, the rendering parameters of the target scene elements in the forest scene are adjusted to optimize the rendering effect and performance.
[0132] Step S141: parse the element detail level adjustment rules in the scene element dynamic optimization strategy to determine the detail level adjustment rule type corresponding to the target scene element, where the detail level adjustment rule type includes a first detail level adjustment rule, a second detail level adjustment rule, and a third detail level adjustment rule.
[0133] Parse the element detail level adjustment rules in the scene element dynamic optimization strategy to identify the rule type corresponding to each target scene element. This is done by querying the scene element's tag, such as core visual elements corresponding to the first detail level adjustment rule, secondary visual elements corresponding to the second detail level adjustment rule, and background visual elements corresponding to the third detail level adjustment rule.
[0134] Step S142: When the LOD adjustment rule type corresponding to the target scene element is the first LOD adjustment rule, the polygon number parameter, texture resolution parameter, and shader complexity parameter of the target scene element are kept at the highest value.
[0135] For target scene elements that are core visual elements, the first level of detail adjustment rules are followed, and their existing maximum polygon count parameters, maximum texture resolution parameters, and maximum shader complexity parameters are not changed to ensure that they are presented in the highest quality on the screen.
[0136] For example, an iconic ancient tree near the quest NPC, as a core visual element, has its polygon count parameter kept at the highest, texture resolution parameter at the highest, and shader complexity parameter at the highest to ensure that players can clearly see the details of the ancient tree.
[0137] Step S143: When the detail level adjustment rule type corresponding to the target scene element is the second detail level adjustment rule, obtain the current picture frame rendering time parameter. If the current picture frame rendering time parameter exceeds the preset first time threshold, the polygon number parameter of the target scene element is reduced by a preset ratio, the texture resolution parameter is reduced by a preset ratio, and the shader complexity parameter is reduced by a preset level; if the current picture frame rendering time parameter is lower than the preset second time threshold, the polygon number parameter of the target scene element is increased by a preset ratio, the texture resolution parameter is increased by a preset ratio, and the shader complexity parameter is increased by a preset level; wherein the first time threshold is greater than the second time threshold.
[0138] In this embodiment, for the secondary visual elements, their rendering parameters are adjusted according to the time consumption of real-time rendering.
[0139] For example, step S1431: extracting the rendering time parameter of the current picture frame from the real-time rendering state data set as the rendering time parameter of the current picture frame.
[0140] From the real-time rendering status data set, the rendering time parameter of the latest frame is obtained. The rendering time parameter reflects the current rendering performance status.
[0141] Step S1432: Compare the current frame rendering time parameter with a preset first time threshold.
[0142] The current frame rendering time parameter is compared with a first time threshold to determine whether the current rendering time exceeds the threshold.
[0143] Step S1433: When the current frame rendering time parameter exceeds a preset first time threshold, obtain the current polygon number parameter of the target scene element, calculate the product of the polygon number parameter and the preset reduction ratio, and use the product as the adjusted polygon number parameter.
[0144] If the current frame rendering time exceeds the first time threshold, it indicates that the rendering pressure is high. The current polygon count parameter of the target scene element is obtained and multiplied by the preset reduction ratio (which is less than 1) to obtain the adjusted polygon count parameter to reduce the polygon count and reduce the rendering burden.
[0145] For example, if the current polygon count parameter of the target scene element is a certain value and the preset reduction ratio is 0.8, then the adjusted polygon count parameter is the result of multiplying the value by 0.8.
[0146] Step S1434: obtaining the current texture resolution parameter of the target scene element, calculating the product of the texture resolution parameter and a preset reduction ratio, and using the product as the adjusted texture resolution parameter.
[0147] Similarly, the current texture resolution parameter of the target scene element is obtained, multiplied by the preset reduction ratio, and the adjusted texture resolution parameter is obtained to reduce the clarity of the texture to reduce rendering resource consumption.
[0148] Step S1435: obtaining the current shader complexity parameter of the target scene element, reducing the shader complexity parameter by a preset level, and obtaining an adjusted shader complexity parameter.
[0149] Reduce the current shader complexity parameters of the target scene element to a preset level, such as from a complex level to a medium level, to simplify the shader's calculation logic and reduce rendering complexity.
[0150] Step S1436: When the current frame rendering time parameter is lower than the preset second time threshold, obtain the current polygon number parameter of the target scene element, calculate the product of the polygon number parameter and the preset improvement ratio, and use the product as the adjusted polygon number parameter.
[0151] If the current frame rendering time parameter is lower than the second time threshold, it indicates that the rendering pressure is low. The current polygon count parameter of the target scene element is multiplied by the preset increase ratio (the ratio is greater than 1) to obtain the adjusted polygon count parameter, increasing the polygon count and improving the picture details.
[0152] Step S1437: obtaining the current texture resolution parameter of the target scene element, calculating the product of the texture resolution parameter and a preset improvement ratio, and using the product as the adjusted texture resolution parameter.
[0153] Multiply the current texture resolution parameter of the target scene element by the preset improvement ratio to obtain the adjusted texture resolution parameter, thereby improving the clarity of the texture and enhancing the picture quality.
[0154] Step S1438: obtaining the current shader complexity parameter of the target scene element, and increasing the shader complexity parameter to a preset level to obtain an adjusted shader complexity parameter.
[0155] Increase the current shader complexity parameters of the target scene element to a preset level, such as from a medium level to a complex level, to increase the shader's calculation logic and improve the rendering effect.
[0156] Step S144: When the LOD adjustment rule type corresponding to the target scene element is the third LOD adjustment rule, the polygon number parameter of the target scene element is fixed to the lowest value, the texture resolution parameter is fixed to the lowest value, and the shader complexity parameter is fixed to the lowest value.
[0157] For background visual elements, the polygon count, texture resolution, and shader complexity parameters are fixed at the lowest level according to the third level of detail adjustment rules, so that they are rendered with minimal resource consumption.
[0158] For example, for the mountains in the distance, set their polygon count parameters to the lowest, texture resolution parameters to the lowest, and shader complexity parameters to the lowest, because players will not pay too much attention to their details during normal gameplay.
[0159] Step S145: parsing the resource allocation priority parameters in the scene element dynamic optimization strategy, and allocating rendering thread resources and video memory resources to the target scene element in descending order of the resource allocation priority parameters.
[0160] The resource allocation priority parameters in the scene element dynamic optimization strategy are parsed to determine the priority of each target scene element. Rendering thread resources and video memory resources are allocated to target scene elements in descending order of priority. Scene elements with higher priorities are allocated sufficient resources first to ensure smooth rendering.
[0161] Step S146: Integrate the adjusted polygon number parameters, texture resolution parameters, shader complexity parameters and resource allocation results into scene rendering configuration data, wherein the scene rendering configuration data includes an associated mapping relationship between the unique identifier of each target scene element and the corresponding adjusted parameters.
[0162] The adjusted polygon count, texture resolution, shader complexity, and resource allocation results for each target scene element are combined to form scene rendering configuration data. In this data, the unique identifier of each target scene element is associated with its corresponding adjusted parameters, making it easier for the game rendering pipeline to perform rendering processing based on this data.
[0163] Step S150: inputting the scene rendering configuration data into the game rendering pipeline for real-time rendering processing, and outputting an optimized game scene frame sequence.
[0164] In this embodiment, the adjusted scene rendering configuration data is input into the game rendering pipeline for real-time rendering to obtain an optimized game scene screen.
[0165] Step S151: parsing the scene rendering configuration data, extracting the unique identifier of each target scene element and the corresponding adjusted polygon number parameter, adjusted texture resolution parameter, adjusted shader complexity parameter and resource allocation result.
[0166] The scene rendering configuration data is parsed to extract the unique identifier of each target scene element, as well as the corresponding adjusted polygon number parameters, texture resolution parameters, shader complexity parameters and resource allocation results.
[0167] Step S152: According to the unique identifier of the target scene element, the adjusted polygon number parameter, the adjusted texture resolution parameter, and the adjusted shader complexity parameter are updated to the rendering attribute configuration table of the game scene element.
[0168] Based on the unique identifier of the target scene element, the corresponding record is found in the rendering property configuration table of the game scene element, and the adjusted polygon number parameter, texture resolution parameter and shader complexity parameter are updated to the record so that the rendering property configuration table reflects the latest rendering parameter settings.
[0169] Step S153: Allocate corresponding rendering thread resources and video memory resources to each target scene element according to the resource allocation result, and establish an association allocation table between scene elements and resources.
[0170] According to the resource allocation results, corresponding rendering thread resources and video memory resources are allocated to each target scene element, and an associated allocation table is established to record the correspondence between each scene element and the allocated resources to ensure clear and orderly resource allocation.
[0171] Step S154: calling the resource loading module of the game rendering pipeline to load the adjusted mesh data, adjusted texture resources and adjusted shader program of the target scene element according to the rendering attribute configuration table and the association allocation table.
[0172] In this embodiment, the resource loading module of the game rendering pipeline is responsible for acquiring and loading the adjusted resources for each target scene element based on the determined rendering attribute configuration table and associated allocation table. For example, for "cedar tree 002" in the forest scene, after the rendering parameters have been adjusted, its mesh data, texture resources, and shader program have all been updated.
[0173] The resource loading module first reads the adjusted polygon count, texture resolution, and shader complexity parameters for "Fir Tree 002" from the rendering attribute configuration table. Based on these parameters, the module locates the adjusted mesh data file corresponding to the fir tree from the game's resource repository. This mesh data file contains data such as vertex coordinates and triangle connectivity information that matches the new polygon count.
[0174] Next, based on the adjusted texture resolution parameters, the resource loading module finds texture resource files that match the resolution. These files include tree trunk textures, leaf textures, etc., whose pixel sizes are consistent with the adjusted texture resolution parameters, ensuring that the corresponding level of detail can be presented during rendering.
[0175] For the adjusted shader program, the resource loading module calls the corresponding shader program from the shader library based on the adjusted shader complexity parameter. The number of instruction sets and sampler usage of this shader program are all matched to the adjusted complexity, meeting the rendering requirements while adapting to resource allocation constraints.
[0176] During the loading process, the resource loading module also refers to the association allocation table and stores the loaded mesh data, texture resources, and shader programs to the specified memory area according to the rendering thread resources and memory resources allocated for “Pine Tree 002” and assigns them to the corresponding rendering threads for processing. For other target scene elements in the forest scene, such as “Rock 018” and “Stream 005”, the resource loading module also loads the adjusted resources of each element according to the same process to ensure that the resources of each element can be accurately and timely called by the rendering pipeline.
[0177] Step S155: Call the draw command generation module of the game rendering pipeline to generate a draw command sequence for each target scene element based on the loaded adjusted mesh data, adjusted texture resources, and adjusted shader programs.
[0178] In this embodiment, the role of the draw command generation module is to convert the loaded resources into executable draw commands for the rendering pipeline. Taking “Pine Tree 002” as an example, after loading its adjusted mesh data, texture resources, and shader programs, the draw command generation module begins to generate the corresponding draw command sequence.
[0179] First, the module generates a vertex buffer binding command according to the vertex information in the mesh data to specify the source of the vertex data used during rendering. Then, for the texture resources, a texture sampler setting command is generated to determine the filtering method, addressing mode, and other parameters of the texture to ensure that the texture can be correctly mapped to the mesh surface during rendering.
[0180] For the shader program, the draw command generation module generates a shader binding command to associate the adjusted shader program with the current rendering state and sets the uniform variables required in the shader, such as light source position, material properties, etc. The values of these variables are dynamically adjusted according to the real-time lighting conditions and element properties of the forest scene.
[0181] In addition, the draw command sequence also includes draw range commands to specify the range of triangle faces that need to be rendered to avoid invalid rendering of invisible parts, and rendering state setting commands, such as enabling or disabling depth testing, blending mode, etc., to ensure that “Pine Tree 002” can correctly occlude and blend with other elements in the forest scene.
[0182] For other target scene elements in the forest scene, the draw command generation module also generates their respective draw command sequences according to a similar process, each sequence being customized for the adjusted resources and rendering requirements of the element to ensure the accuracy and efficiency of the rendering process.
[0183] Step S156: input the drawing command sequences into an execution queue of the game rendering pipeline in order of the resource allocation priority parameters from high to low, and execute real-time rendering processing.
[0184] In this embodiment, the resource allocation priority parameter determines the execution order of the drawing command sequences in the rendering pipeline. In the forest scene, core visual elements such as key trees near the player and important interactive rocks have higher resource allocation priority parameters, while background visual elements such as distant mountains and the sky have lower priority parameters.
[0185] After the drawing command generation module generates the drawing command sequences of all target scene elements, the sequences can be sorted according to the corresponding resource allocation priority parameters. The drawing command sequence with the highest priority parameter is placed at the front end of the execution queue first, followed by the sequence with the second highest priority parameter, and so on, forming an execution order arranged in order of priority from high to low.
[0186] The execution queue of the game rendering pipeline takes out the drawing command sequences in this order and executes them one by one. For example, the drawing command sequence of “Pine Tree 002” with the highest priority is executed first, ensuring that it can obtain more computing resources during rendering to present it with higher quality. The drawing command sequence of the distant mountains with a lower priority is executed later, and its rendering precision can be appropriately reduced when resources are scarce, but it will not affect the player's visual experience of the core elements.
[0187] During execution, the rendering pipeline monitors resource usage in real time. If there is a resource conflict or shortage, scheduling can be performed according to the priority order of the execution queue to prioritize the execution of high-priority command sequences, thereby maintaining the overall rendering quality and smoothness of the forest scene.
[0188] Step S157: collect continuous picture frame data output by the game rendering pipeline, sort them in order of time stamp, and generate an optimized game scene picture frame sequence.
[0189] In this embodiment, after the game rendering pipeline executes the drawing command sequences, it can output continuous picture frame data, each of which contains pixel information, depth information, and other information of the forest scene at that time. The collection module collects these picture frame data in real time and records the time stamp corresponding to each frame, which is accurate to the millisecond level and used to mark the generation time of the frame.
[0190] After collection is complete, the picture frame data can be sorted in order of time stamp from early to late to ensure the time continuity of the frame sequence. For example, the picture frame with a time stamp of t1 is placed at the front, followed by the picture frame with a time stamp of t2 (t2 > t1), and so on, forming a continuous sequence arranged in time order.
[0191] This optimized game scene frame sequence can be directly used by the game engine for display output. The forest scene viewed by the player on their device is a continuous playback of frame data from this sequence. By dynamically optimizing the rendering parameters of scene elements during the generation process, this frame sequence maintains the quality of core visual elements while reducing unnecessary resource consumption. This allows the game to run smoothly on devices of varying performance without noticeable lag or frame drops.
[0192] In this embodiment, training the rendering requirements analysis model is a critical prerequisite. Only through sufficient training can the rendering requirements analysis model accurately analyze the real-time rendering status data set and output a reliable rendering requirements feature set. The training process includes multiple steps, including data preparation, model construction, parameter setting, training execution, and model evaluation.
[0193] Step S211: Collect a training data set, where the training data set includes rendering status data of multiple historical game scenes and corresponding annotated rendering requirement features.
[0194] In this embodiment, the quality of the training data set directly affects the model's training effectiveness. The collected historical game scenes include various types of forest scenes, forest scenes under different time and weather conditions, and forest scenes containing different numbers and types of elements, to ensure that the model has good generalization capabilities.
[0195] For each historical game scene, its rendering status data is collected. The rendering status data is consistent with the structure of the real-time rendering status data set described in step S110, and includes the rendering resource occupancy information of the scene elements and the time-consuming parameters of the screen frame rendering. At the same time, professional game graphics engineers annotate the rendering requirement characteristics of each scene element, including the visual importance characteristics of the elements and the rendering resource sensitivity characteristics. During the annotation process, engineers will comprehensively consider factors such as the visual proportion of the scene elements in the picture, the player's attention level, and the impact of resource changes on the rendering effect to ensure the accuracy of the annotation results.
[0196] The collected rendering status data and the corresponding annotated rendering requirement features are divided according to a set ratio. One part is used as a training set for model parameter learning; another part is used as a validation set for evaluating the performance of the model during the training process; and another part is used as a test set for the final performance test after the model training is completed.
[0197] Step S212: constructing a network structure of a rendering requirement analysis model, wherein the network structure includes a feature fusion layer, a visual importance assessment subnetwork, and a resource sensitivity analysis subnetwork.
[0198] In this embodiment, the network structure of the rendering demand analysis model is constructed using a deep learning framework. The feature fusion layer uses a convolutional neural network structure, consisting of multiple convolutional layers and pooling layers. The convolutional layers are used to extract local correlation information from the input features, while the pooling layers are used to reduce feature dimensionality and computational complexity. The input of the feature fusion layer is the resource usage feature vector and the rendering time distribution feature matrix, and the output is the fused correlation feature tensor.
[0199] The visual importance assessment subnetwork consists of multiple fully connected layers and attention layers. The fully connected layers perform nonlinear transformations on the fused, correlated feature tensors to extract higher-level features. The attention layers focus on regions of interest related to visual importance, increasing the weight of important features. The output of this visual importance assessment subnetwork is the element's visual importance feature.
[0200] The resource sensitivity analysis subnetwork also includes multiple fully connected layers and dropout layers to prevent model overfitting. By analyzing the fused associated feature tensors, the subnetwork learns the mapping between changes in resource usage and rendering time, and outputs rendering resource sensitivity features.
[0201] During the network construction process, parameters such as the number of neurons and activation function type are set for each layer. For example, the first convolutional layer of the feature fusion layer uses a set number of convolution kernels and the ReLU function as the activation function. The number of neurons in the fully connected layer is adjusted based on the dimensionality of the input features, and the activation function also uses the ReLU function. The output layer uses an appropriate activation function based on the range of feature values.
[0202] Step S213: setting model training parameters, which include learning rate, number of iterations, batch size and loss function.
[0203] In this embodiment, the learning rate determines the step size of the model parameter update and is set to a small initial value. It is dynamically adjusted according to the performance of the validation set during the training process. When the loss of the validation set no longer decreases, the learning rate is appropriately reduced.
[0204] The number of iterations refers to the number of times the model completes training on the training set. It is set according to the size of the training set and the complexity of the model to ensure that the model can fully learn the patterns in the data.
[0205] Batch size refers to the number of samples input into the model at each iteration. When setting the batch size, you need to consider memory capacity and training efficiency. Too large a batch size will occupy too much memory, while too small a batch size will lead to unstable training.
[0206] The loss function is used to measure the difference between the model's predicted value and the annotated true value. For the prediction of element visual importance features and rendering resource sensitivity features, the mean square error loss function is used to calculate the average of the squares of the differences between the predicted value and the true value as the optimization target for model training.
[0207] Step S214: inputting the training set in the training data set into the constructed rendering demand analysis model, performing model training according to the set model training parameters, and updating the model parameters through the back propagation algorithm.
[0208] In this embodiment, the rendering state data in the training set is input into the constructed rendering demand analysis model, which outputs predicted rendering demand features. The predicted rendering demand features are compared with the annotated actual rendering demand features, and the loss value is calculated using a loss function.
[0209] Using the backpropagation algorithm, starting from the output layer of the model according to the loss value, the gradient of the parameters of each layer to the loss value is calculated layer by layer, and then the parameters of each layer are updated according to the learning rate and gradient value to gradually reduce the loss value.
[0210] During training, after each set number of iterations, the model is evaluated using the validation set and the loss on the validation set is calculated. If the validation set loss does not decrease for several consecutive times, the model may be overfitting. In this case, training can be stopped early or model parameters can be adjusted, such as increasing the dropout layer's dropout rate.
[0211] During the training process, the changes in the model's loss values on the training set and validation set, as well as the update records of the model parameters, will be recorded to facilitate subsequent analysis of the model's training process and performance.
[0212] Step S215: When the model training reaches a preset stop condition, the training is stopped and the trained rendering demand analysis model is saved.
[0213] In this embodiment, the preset stopping conditions include the number of iterations reaching the set maximum number of iterations, the loss value on the verification set reaching the preset minimum loss threshold, or the loss value of the verification set no longer decreasing in a set number of consecutive iterations.
[0214] When any of the stopping conditions is met, model training stops. The trained model parameters, including the weights and biases of each layer of the feature fusion layer, visual importance assessment subnetwork, and resource sensitivity analysis subnetwork, are saved to the specified storage path to form a pre-trained rendering demand analysis model for use in step S120.
[0215] The saved model will also be compressed and optimized to reduce the model's storage space and loading time while ensuring that the model's inference performance is not affected.
[0216] Step S310: a step of performing quality assessment on the optimized game scene frame sequence.
[0217] In this embodiment, in order to ensure that the quality of the optimized game scene meets the requirements, it is necessary to perform a quality assessment on the output picture frame sequence.
[0218] Step S311: extracting key frames from the optimized game scene frame sequence.
[0219] From the optimized game scene frame sequence, extract keyframes at set intervals, for example, extracting one keyframe every set number of frames. The keyframes selected should cover various dynamic changes in the scene, such as player movement, lighting changes, and element interactions.
[0220] Step S312: Calculating visual quality assessment indicators of the key frame images, wherein the visual quality assessment indicators include peak signal-to-noise ratio, structural similarity index, and visual information fidelity.
[0221] The peak signal-to-noise ratio (PSNR) is used to measure the difference between the key frame image and the original high-quality image. The calculation process is to first calculate the mean square error between the two, and then calculate the PSNR based on the peak signal value and the mean square error. The larger the value, the better the image quality.
[0222] The structural similarity index evaluates quality by comparing the similarity of brightness, contrast, and structural information between the key frame image and the original image. The value range is between 0 and 1. The closer it is to 1, the higher the structural similarity and the better the image quality.
[0223] The fidelity of visual information is based on the characteristics of the human visual system and evaluates the fidelity of the visual information conveyed by the key frame image and the original image. Similarly, the larger the value, the better the quality.
[0224] Step S313: Compare the calculated visual quality evaluation index with a preset quality threshold to determine whether the optimized game scene image quality meets the standard.
[0225] The preset quality thresholds are set according to the visual quality requirements of the game, including peak signal-to-noise ratio threshold, structural similarity index threshold, and visual information fidelity threshold.
[0226] The calculated visual quality evaluation indicators are compared with the corresponding threshold values respectively. If all indicators are greater than or equal to the corresponding threshold values, it is considered that the optimized game scene picture quality meets the standard. If any one of the indicators is less than the corresponding threshold value, it is considered that the picture quality does not meet the standard, and the scene element dynamic optimization strategy needs to be adjusted again. The process of steps S130 to S150 is repeated until the picture quality meets the standard.
[0227] Step S314: If the optimized game scene picture quality meets the standard, record the scene element dynamic optimization strategy used this time and the corresponding visual quality evaluation indicators. If it does not meet the standard, generate quality improvement suggestions for guiding the next optimization process.
[0228] For the case of quality meeting the standard, the element detail level adjustment rule, resource allocation priority parameter and other scene element dynamic optimization strategies used this time are stored in the optimization history record together with the corresponding visual quality evaluation indicators.
[0229] For the case of quality not meeting the standard, analyze the reasons why each visual quality evaluation indicator does not meet the standard. For example, if the structural similarity index is low, it may be due to the fact that the detail level of some core visual elements is adjusted too much. According to the analysis results, generate quality improvement suggestions such as increasing the detail level of core visual elements, adjusting the resource allocation priority parameter, etc. to guide the next optimization process and improve the optimization effect.
[0230] Figure 2 A schematic diagram of exemplary hardware and software components of the dynamic rendering based game scene optimization system 100 provided by some embodiments of the present application is shown, which can implement the idea of the present application. For example, the processor 120 can be used in the dynamic rendering based game scene optimization system 100 and used to execute the functions in the present application.
[0231] The dynamic rendering based game scene optimization system 100 can be a general server or a special purpose server, both of which can be used to implement the dynamic rendering based game scene optimization method of the present application. Although only one server is shown in the present application, for the sake of convenience, the functions described in the present application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0232] For example, the game scene optimization system 100 based on dynamic rendering can include a network port 110 connected to the network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the game scene optimization system 100 based on dynamic rendering can also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The game scene optimization system 100 based on dynamic rendering also includes an I / O interface 150 between a computer and other input and output devices.
[0233] For ease of explanation, only one processor is described in the game scene optimization system 100 based on dynamic rendering. However, it should be noted that the game scene optimization system 100 based on dynamic rendering in the present application may also include multiple processors, so the steps performed by one processor described in the present application may also be performed jointly or individually by multiple processors. For example, if the processor of the game scene optimization system 100 based on dynamic rendering executes step A and step B, it should be understood that step A and step B may also be performed jointly by two different processors or individually in one processor. For example, the first processor executes step A, the second processor executes step B, or the first processor and the second processor execute steps A and B together.
[0234] In addition, an embodiment of the present invention further provides a readable storage medium, in which computer-executable instructions are preset. When a processor executes the computer-executable instructions, the above-mentioned game scene optimization method based on dynamic rendering is implemented.
[0235] It should be noted that in order to simplify the description of the present invention and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, multiple features are sometimes combined into one embodiment, figure or description thereof.
Claims
1. A game scene optimization method based on dynamic rendering, characterized in that: The method comprises: Obtaining a real-time rendering status data set of the current game scene, wherein the real-time rendering status data set includes rendering resource occupancy information of scene elements and picture frame rendering time parameters; Calling a pre-trained rendering requirement analysis model to perform rendering requirement analysis on the real-time rendering state data set to obtain a rendering requirement feature set of the scene element, wherein the rendering requirement feature set includes an element visual importance feature and a rendering resource sensitivity feature; generating a scene element dynamic optimization strategy based on the rendering requirement feature set, wherein the scene element dynamic optimization strategy includes element detail level adjustment rules and rendering resource allocation priority parameters; Performing a rendering parameter adjustment operation on a target scene element in the game scene according to the scene element dynamic optimization strategy to generate adjusted scene rendering configuration data; Inputting the scene rendering configuration data into the game rendering pipeline for real-time rendering processing, and outputting an optimized game scene frame sequence; The calling of the pre-trained rendering requirement analysis model to perform rendering requirement analysis on the real-time rendering state data set to obtain a rendering requirement feature set of the scene element includes: Performing structured parsing processing on the scene element rendering resource occupancy information in the real-time rendering state data set to obtain a resource occupancy feature vector including polygon number parameters, texture resolution parameters, and shader complexity parameters; Performing time domain distribution analysis on the frame rendering time parameters in the real-time rendering state data set to generate a rendering time distribution feature matrix including a frame time mean parameter, a frame time fluctuation variance parameter, and a time peak occurrence frequency parameter; Input the resource occupancy feature vector and the rendering time distribution feature matrix into the feature fusion layer of the rendering demand analysis model, calculate the correlation weight coefficient of the resource feature and the time consumption feature through the feature channel attention mechanism, and generate a fused correlation feature tensor; Calling the visual importance assessment subnetwork of the rendering demand analysis model to perform spatial attention calculation processing on the fused correlation feature tensor, extracting the visual focus area ratio parameters and the player's perspective stay duration ratio parameters of the scene element in the game screen, and performing a weighted combination of the visual focus area ratio parameters and the player's perspective stay duration ratio parameters to obtain the element visual importance feature; Calling the resource sensitivity analysis subnetwork of the rendering demand analysis model to perform resource impact assessment processing on the fused correlation feature tensor, calculating a ratio parameter of a change in resource usage of scene elements to a change in rendering time, and using the ratio parameter as a rendering resource sensitivity feature; The element visual importance feature and the rendering resource sensitivity feature are associated and stored according to the unique identifier of the scene element to form a rendering requirement feature set of the scene element; Generating a dynamic optimization strategy for scene elements based on the rendering requirement feature set includes: Determining a detail level adjustment threshold parameter of a scene element based on the element visual importance feature, wherein the detail level adjustment threshold parameter includes a high visual importance threshold interval, a medium visual importance threshold interval, and a low visual importance threshold interval; Classifying scene elements according to the threshold parameter of the detail level adjustment, marking scene elements whose visual importance characteristics fall within a high visual importance threshold interval as core visual elements, marking scene elements whose visual importance characteristics fall within a medium visual importance threshold interval as secondary visual elements, and marking scene elements whose visual importance characteristics fall within a low visual importance threshold interval as background visual elements; Calculating a resource allocation priority parameter of the scene element based on the rendering resource sensitivity feature, wherein the resource allocation priority parameter is obtained by multiplying a sensitivity coefficient by a visual importance weight, wherein the sensitivity coefficient is a normalized result of the rendering resource sensitivity feature, and the visual importance weight is a normalized result of the element visual importance feature; formulating a first level of detail adjustment rule for the core visual element, wherein the first level of detail adjustment rule includes a strategy of maintaining a highest level of detail parameter and prioritizing allocation of rendering resources; Formulate a second level of detail adjustment rule for the secondary visual element, the second level of detail adjustment rule including a strategy for dynamically adjusting level of detail parameters based on real-time rendering time, lowering the level of detail by one when the rendering time exceeds a preset threshold, and raising the level of detail by one when the rendering time falls below the preset threshold; formulating a third level of detail adjustment rule for the background visual element, wherein the third level of detail adjustment rule includes a strategy of fixing a minimum level of detail parameter and delaying allocation of rendering resources; Integrating the first level of detail adjustment rule, the second level of detail adjustment rule, the third level of detail adjustment rule, and the resource allocation priority parameter to generate a scene element dynamic optimization strategy; The performing a rendering parameter adjustment operation on the target scene element in the game scene according to the scene element dynamic optimization strategy to generate adjusted scene rendering configuration data includes: parsing the element detail level adjustment rules in the scene element dynamic optimization strategy to determine the detail level adjustment rule type corresponding to the target scene element, where the detail level adjustment rule type includes a first detail level adjustment rule, a second detail level adjustment rule, and a third detail level adjustment rule; When the LOD adjustment rule type corresponding to the target scene element is the first LOD adjustment rule, the polygon count parameter, texture resolution parameter, and shader complexity parameter of the target scene element are kept at the highest value. When the level of detail adjustment rule type corresponding to the target scene element is the second level of detail adjustment rule, obtaining a current screen frame rendering time parameter; if the current screen frame rendering time parameter exceeds a preset first time threshold, reducing a polygon number parameter of the target scene element by a preset ratio, reducing a texture resolution parameter by a preset ratio, and reducing a shader complexity parameter by a preset level; if the current screen frame rendering time parameter is lower than a preset second time threshold, increasing a polygon number parameter of the target scene element by a preset ratio, increasing a texture resolution parameter by a preset ratio, and increasing a shader complexity parameter by a preset level; wherein the first time threshold is greater than the second time threshold; When the LOD adjustment rule type corresponding to the target scene element is the third LOD adjustment rule, the polygon count parameter, texture resolution parameter, and shader complexity parameter of the target scene element are fixed to the lowest value. Parsing the resource allocation priority parameters in the scene element dynamic optimization strategy, and allocating rendering thread resources and video memory resources to the target scene element in descending order of the resource allocation priority parameters; The adjusted polygon number parameters, texture resolution parameters, shader complexity parameters and resource allocation results are integrated into scene rendering configuration data, wherein the scene rendering configuration data includes an associated mapping relationship between a unique identifier of each target scene element and the corresponding adjusted parameters.
2. The game scene optimization method based on dynamic rendering according to claim 1, characterized in that: The structured parsing process is performed on the scene element rendering resource occupancy information in the real-time rendering state data set to obtain a resource occupancy feature vector including polygon quantity parameters, texture resolution parameters, and shader complexity parameters, including: Traversing the scene element identification list in the real-time rendering state data set to determine a storage path for rendering resource occupancy information corresponding to each scene element; Reading a mesh data file of a scene element according to the storage path, parsing a vertex index list and triangle face data in the mesh data file, and counting the total number of triangle faces as a polygon number parameter; Reading a texture resource file of a scene element, parsing header information of the texture resource file, extracting a width parameter and a height parameter of the texture, and using the product of the width parameter and the height parameter as a texture resolution parameter; Reading a shader configuration file of a scene element, parsing the number of instruction sets, the number of samplers, and a computational complexity flag in the shader configuration file, performing weighted summation processing on the number of instruction sets, the number of samplers, and the computational complexity flag according to a preset complexity scoring rule, to obtain a shader complexity parameter; Arranging the polygon number parameter, the texture resolution parameter, and the shader complexity parameter in a preset feature dimension order to generate a resource occupancy feature vector having a three-dimensional feature dimension; Normalization is performed on each characteristic parameter in the resource occupancy characteristic vector so that the value range of each characteristic parameter is mapped to a preset standard value interval.
3. The game scene optimization method based on dynamic rendering according to claim 1, characterized in that: The time domain distribution analysis processing is performed on the frame rendering time parameters in the real-time rendering state data set to generate a rendering time distribution feature matrix including a frame time mean parameter, a frame time fluctuation variance parameter, and a time peak occurrence frequency parameter, including: Extracting a preset number of continuous frame rendering time parameters from the real-time rendering state data set to form a time domain time sequence; Calculating the arithmetic mean of all time consumption parameters in the time domain time consumption sequence, and using the arithmetic mean as the frame time consumption mean parameter; Calculating the arithmetic mean of the squares of the differences between each time consumption parameter in the time domain time consumption sequence and the frame time consumption mean parameter, and using the arithmetic mean as the frame time consumption fluctuation variance parameter; Setting a time consumption peak threshold parameter, traversing the time domain time consumption sequence, counting the ratio of the number of frames whose time consumption parameter is greater than the time consumption peak threshold parameter to the total number of frames, and using the ratio as the time consumption peak occurrence frequency parameter; Constructing a two-dimensional feature matrix, wherein the first row element of the two-dimensional feature matrix is the frame time mean parameter, the second row element is the frame time fluctuation variance parameter, and the third row element is the time peak occurrence frequency parameter, to generate a rendering time distribution feature matrix; Performing row vector normalization processing on the rendering time distribution feature matrix so that the module length of each row element in the rendering time distribution feature matrix is equal to a preset unit module length value.
4. The game scene optimization method based on dynamic rendering according to claim 1, characterized in that: The determining of a detail level adjustment threshold parameter of a scene element based on the element visual importance feature includes: Collecting element visual importance features of all scene elements in the rendering requirement feature set to form a visual importance feature set; Sorting the visual importance feature set in descending order to obtain a sorted visual importance feature sequence; Dividing the sorted visual importance feature sequence into three consecutive subsequences according to a preset ratio, wherein the first subsequence contains a first preset percentage of feature elements, the second subsequence contains a middle preset percentage of feature elements, and the third subsequence contains a last preset percentage of feature elements; Extracting the minimum eigenvalue in the first subsequence as the lower limit of the high visual importance threshold interval, and setting the upper limit of the high visual importance threshold interval as the theoretical maximum value of the element visual importance feature; Extracting the minimum eigenvalue in the second subsequence as the lower limit of the medium visual importance threshold interval, and extracting the minimum eigenvalue in the first subsequence as the upper limit of the medium visual importance threshold interval; Extracting the minimum eigenvalue in the third subsequence as the lower limit of the low visual importance threshold interval, and extracting the minimum eigenvalue in the second subsequence as the upper limit of the low visual importance threshold interval; The high visual importance threshold interval, the medium visual importance threshold interval, and the low visual importance threshold interval are combined into a level of detail adjustment threshold parameter.
5. The game scene optimization method based on dynamic rendering according to claim 1, characterized in that: The calculating of the resource allocation priority parameter of the scene element based on the rendering resource sensitivity feature includes: Collecting rendering resource sensitivity features of all scene elements in the rendering requirement feature set to form a resource sensitivity feature set; Normalizing the resource sensitivity feature set, mapping the value of each rendering resource sensitivity feature to a preset sensitivity value range, and obtaining a sensitivity coefficient; Collecting element visual importance features of all scene elements in the rendering requirement feature set to form a visual importance feature set; Normalizing the visual importance feature set, mapping the value of each element's visual importance feature to a preset weight value interval to obtain a visual importance weight; Traverse each scene element, multiply the sensitivity coefficient of the scene element by the visual importance weight to obtain the resource allocation priority parameter of the scene element; The resource allocation priority parameters of all scene elements are normalized so that the value range of the resource allocation priority parameters is mapped to the preset priority value range.
6. The game scene optimization method based on dynamic rendering according to claim 1, characterized in that: The step of inputting the scene rendering configuration data into the game rendering pipeline for real-time rendering processing and outputting an optimized game scene frame sequence includes: Parsing the scene rendering configuration data, extracting a unique identifier of each target scene element and a corresponding adjusted polygon count parameter, adjusted texture resolution parameter, adjusted shader complexity parameter, and resource allocation result; According to the unique identifier of the target scene element, the adjusted polygon number parameter, the adjusted texture resolution parameter, and the adjusted shader complexity parameter are updated to the rendering attribute configuration table of the game scene element; According to the resource allocation results, corresponding rendering thread resources and video memory resources are allocated to each target scene element, and an association allocation table between scene elements and resources is established; Calling a resource loading module of a game rendering pipeline to load the adjusted mesh data, adjusted texture resources, and adjusted shader program of a target scene element according to the rendering attribute configuration table and the association allocation table; Calling the drawing command generation module of the game rendering pipeline to generate a drawing command sequence for each target scene element based on the loaded adjusted mesh data, adjusted texture resources, and adjusted shader program; Input the drawing command sequence into the execution queue of the game rendering pipeline in descending order of resource allocation priority parameters to perform real-time rendering processing; Collect continuous frame data output by the game rendering pipeline, sort them in timestamp order, and generate an optimized game scene frame sequence.
7. A game scene optimization system based on dynamic rendering, characterized in that: It includes a processor and a memory, the memory is connected to the processor, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the game scene optimization method based on dynamic rendering as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Joint neural denoising of surfaces and volumes
US20240112308A1
Generating a rendered image of a three-dimensional object
WO2024241063A1