Game map rendering methods and systems
By obtaining the coordinates of the game interface edges and analyzing lighting to generate environment textures, the problem of real-time and realism compatibility in game map rendering was solved, achieving fast response and highly realistic rendering effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2026-03-10
AI Technical Summary
Existing game map rendering technologies cannot be compatible with real-time performance and rendering realism. Ray tracing rendering has poor real-time performance, and rasterization rendering has poor realism.
By obtaining the coordinates of the game interface edges, matching the scene model, extracting lighting feature parameters, performing lighting analysis to generate environment maps, and evaluating the rendering realism, only environment maps that meet the threshold are rendered.
It achieves compatibility between real-time and realism in game map rendering, ensuring fast response and high efficiency in the rendering process.
Smart Images

Figure CN116212373B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a game map rendering method and system. BACKGROUND
[0002] Game map rendering refers to a technology of scene rendering according to a real-time interface for player interaction, which is different from rendering of movie and video pictures. The game map needs to perform corresponding rendering tasks according to real-time dynamic changes, and has high requirements for real-time performance and authenticity.
[0003] At present, there are mainly two means for game map rendering. One is ray tracing rendering, which mainly determines game map scene information through completely real ray shooting. The disadvantage is poor real-time performance, and it is mostly implemented offline. The other is rasterization rendering, which mainly defaults that light is refracted only once. The disadvantage is poor rendering authenticity.
[0004] In summary, the game map rendering in the prior art has the technical problem of being unable to compatibly achieve real-time performance and rendering authenticity due to its own limitations. SUMMARY
[0005] The present application provides a game map rendering method and system for solving the technical problem of being unable to compatibly achieve real-time performance and rendering authenticity due to the limitations of the game map rendering in the prior art.
[0006] In view of the above problems, the present application provides a game map rendering method and system.
[0007] In a first aspect of the present application, a game map rendering method is provided, which comprises: obtaining a to-be-cut-in game interface edge coordinate; performing scene model matching according to the to-be-cut-in game interface edge coordinate to obtain a first to-be-rendered model, wherein the first to-be-rendered model is any one of the matched scene models; obtaining an illumination feature parameter, wherein the illumination feature parameter comprises an illumination intensity parameter, an illumination position parameter and an illumination wave frequency parameter; extracting a model material feature, a model geometric feature and a model concave-convex feature according to the first to-be-rendered model; performing illumination analysis on the model material feature, the model geometric feature and the model concave-convex feature based on the illumination intensity parameter, the illumination position parameter and the illumination wave frequency parameter to generate a first to-be-rendered model environment map; performing rendering authenticity evaluation according to the first to-be-rendered model environment map to obtain a rendering authenticity score; and when the rendering authenticity score is greater than or equal to a rendering authenticity score threshold, generating a first rendering instruction to render the first to-be-rendered model.
[0008] In a second aspect of the present application, a rendering system of a game map is provided, comprising: an interface edge coordinate calling module configured to obtain to-be-cut-in game interface edge coordinates; a scene model matching module configured to perform scene model matching according to the to-be-cut-in game interface edge coordinates to obtain a first to-be-rendered model, wherein the first to-be-rendered model is any one of the scene matching models; a lighting feature setting module configured to obtain lighting feature parameters, wherein the lighting feature parameters comprise lighting intensity parameters, lighting position parameters and lighting wave frequency parameters; a model feature calling module configured to extract model material features, model geometric features and model concave-convex features according to the first to-be-rendered model; an environment map analysis module configured to perform lighting analysis on the model material features, the model geometric features and the model concave-convex features based on the lighting intensity parameters, the lighting position parameters and the lighting wave frequency parameters to generate a first to-be-rendered model environment map; a reality score module configured to perform rendering reality evaluation according to the first to-be-rendered model environment map to obtain a rendering reality score; and a model rendering module configured to generate a first rendering instruction to render the first to-be-rendered model when the rendering reality score is greater than or equal to a rendering reality score threshold.
[0009] In a third aspect of the present application, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the steps of the method in the first aspect.
[0010] In a fourth aspect of the present application, a computer readable storage medium is provided, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the method in the first aspect.
[0011] The one or more technical solutions provided in the present application have at least the following technical effects or advantages:
[0012] The embodiment of the application provides a game map rendering method, which comprises the following steps: obtaining a game interface edge coordinate of a scene to be cut in; determining a plurality of models to be rendered in the scene according to the game interface edge coordinate; loading illumination characteristic parameters, including illumination intensity parameters, illumination position parameters and illumination wave frequency parameters; extracting any one of the plurality of models to be rendered as a first model to be rendered, to obtain model material characteristics, model geometric characteristics and model concave-convex characteristics; performing intelligent illumination analysis on the model material characteristics, the model geometric characteristics and the model concave-convex characteristics according to the illumination intensity parameters, the illumination position parameters and the illumination wave frequency parameters, to generate a first model to be rendered environment map corresponding to the first model to be rendered; performing rendering reality evaluation on the first model to be rendered environment map, to obtain a rendering reality score; if the score result meets a threshold value, rendering the first model to be rendered, and the same operation is performed on other models to be rendered, to finally realize the technical scheme of game map rendering of the whole interface.
[0013] The above scheme determines a model set to be rendered through the game interface edge coordinate, that is, the model and the map are bound based on the coordinate, so that the model set to be rendered can be quickly responded and matched, and the rendering real-time performance is ensured. Furthermore, the traditional rendering analysis technology is replaced by illumination analysis, so that the environment map of the model to be rendered can be more efficiently obtained, and the rendering real-time performance is ensured. Furthermore, the environment map of the model to be rendered is scored for reality, and only the environment map meeting the score threshold value can be rendered, so that the rendering reality is ensured. In summary, the game map rendering scheme provided by the embodiment of the application simultaneously realizes the technical effects of rendering real-time performance and reality. BRIEF DESCRIPTION OF DRAWINGS
[0014] Figure 1 A game map rendering method flowchart provided by the application;
[0015] Figure 2 A game map rendering method flowchart provided by the application;
[0016] Figure 3 A game map rendering method flowchart provided by the application;
[0017] Figure 4 A game map rendering system structure diagram provided by the application;
[0018] Figure 5 A game map rendering system structure diagram provided by the application;
[0019] The reference signs are explained as follows: interface edge coordinate calling module 11, scene model matching module 12, illumination feature setting module 13, model feature calling module 14, environment map analysis module 15, reality score module 16, model rendering module 17, computer device 300, memory 301, processor 302, communication interface 303, bus architecture 304. DETAILED DESCRIPTION
[0020] The present application provides a game map rendering method and system, which solves the technical problem that the game map rendering in the prior art cannot be compatible with real-time performance and rendering reality due to its own limitations.
[0021] Embodiment one
[0022] As shown in the drawings, the present application provides a game map rendering method, which comprises the following steps: Figure 1
[0023] S100: Obtain the edge coordinates of the game interface to be cut in;
[0024] Specifically, the game interface to be cut in refers to any interface of any game scene that the player applies to cut in. In any interface, the division of the map area is preferably based on virtual coordinates, which include the horizontal axis coordinate, the vertical axis coordinate, and the height coordinate in the vertical direction, so as to realize the positioning of any pixel point in any interface. The edge coordinate information of the game interface to be cut in refers to the edge coordinate information of any interface of any game scene that the player applies to cut in and needs to be displayed in the player's game interface.
[0025] Further, in any interface of any game scene, before cutting in, the background, foreground, characters, animals, objects, and other scene contents in the range of any interface of the game scene are obtained, and the real-time coordinate information and real-time posture information of the scene contents are determined according to the interaction information of the user and the game. The real-time coordinate information and real-time posture information are bound and stored with the scene contents, so as to facilitate efficient matching during subsequent rendering processing.
[0026] S200: Perform scene model matching according to the edge coordinates of the game interface to be cut in, and obtain a first rendering model, wherein the first rendering model is any scene matching model;
[0027] Further, as shown in the drawings, the step of performing scene model matching according to the edge coordinates of the game interface to be cut in and obtaining a first rendering model, wherein the first rendering model is any scene matching model, comprises the following steps: Figure 2
[0028] S210: match a first scene world map according to the game interface to be cut in;
[0029] S220: regionally segment the first scene world map according to the edge coordinates of the game interface to be cut in, to generate a first scene local map, wherein the first scene local map comprises a plurality of to-be-rendered model coordinate information and a plurality of to-be-rendered model posture information, and the plurality of to-be-rendered model coordinate information and the plurality of to-be-rendered model posture information correspond one by one;
[0030] S230: traverse the plurality of to-be-rendered model coordinate information and the plurality of to-be-rendered model posture information, and match a plurality of scene matching models, wherein the first to-be-rendered model belongs to the plurality of scene matching models.
[0031] Specifically, the first to-be-rendered model refers to any scene model within the edge coordinate range of the game interface to be cut in. Preferably, the determination method is as follows: according to the game interface to be cut in, a first scene world map to which the game interface to be cut in belongs is determined, wherein the first scene world map refers to a macro map including the game interface to be cut in. For example, the game interface is about to be cut into a building in a certain city, at this time the certain city belongs to the first scene world map, and the certain building belongs to the game interface to be cut in. By matching the first scene world map, the game interface to be cut in can be positioned in coordinates, so as to realize quick matching of rendering content.
[0032] The first scene local map refers to a local map scene with coordinate information obtained by range defining the first scene world map according to the edge coordinates of the game interface to be cut in. At this time, the binding storage data of real-time coordinate information and scene content are called, and the scene content within the edge coordinate range of the game interface to be cut in is screened, such as background, foreground, characters, animals, objects, etc.
[0033] Further, the real-time coordinate information and real-time posture information of the scene content are extracted and added to the plurality of to-be-rendered model coordinate information and the plurality of to-be-rendered model posture information. Any one corresponding to-be-rendered model coordinate information and to-be-rendered model posture information is set as a to-be-rendered model and added to the plurality of scene matching models. Through the efficient and quick to-be-rendered model matching process, the efficient game map rendering work is guaranteed, thereby ensuring the real-time performance of the game map rendering.
[0034] S300: obtain illumination feature parameters, wherein the illumination feature parameters include illumination intensity parameters, illumination position parameters, and illumination wave frequency parameters;
[0035] Specifically, since object imaging depends on lighting, it is necessary to set lighting data, or lighting characteristic parameters, for the game map scene. Each game map scene stores pre-defined lighting characteristic parameters, including lighting intensity parameters, lighting position parameters, and lighting frequency parameters. The lighting position parameter refers to the location of the light source; the lighting frequency parameter refers to the wavelength of the light; and the lighting intensity parameter refers to the luminous flux per unit area. These lighting characteristic parameters allow for the simulation of realistic lighting scenes, facilitating highly realistic game map rendering.
[0036] S400: Based on the first model to be rendered, extract the model's material features, geometric features, and bump features;
[0037] Specifically, since the visual impact of light on a material needs to be considered when considering parameters such as the material information, geometric information, and surface roughness information of the material, it is preferable that any first model to be rendered should include at least three basic material information: material features, geometric features, and convexity features, to provide data support for achieving realistic lighting analysis.
[0038] S500: Based on the light intensity parameters, the light position parameters, and the light frequency parameters, perform light analysis on the model material features, the model geometric features, and the model bump features to generate a first environment texture map of the model to be rendered.
[0039] Furthermore, such as Figure 3 As shown, the step S500 involves performing lighting analysis on the model's material features, geometric features, and bump features based on the lighting intensity parameters, lighting position parameters, and lighting frequency parameters to generate a first environment texture map for the model to be rendered. The steps include:
[0040] S510: Obtain the model's refractive index information based on the model's material characteristics;
[0041] S520: Classify the light frequency parameters according to the model refractive index information to generate reflected light frequency and absorbed light frequency, wherein the reflected light frequency is a non-absorbable light frequency;
[0042] S530: Perform diffuse scattering analysis based on the model's concavity and convexity features, the model's geometric features, the illumination intensity parameters, the illumination position parameters, and the reflected light frequency to generate the first environment texture of the model to be rendered.
[0043] Specifically, the light analysis algorithm provided in the embodiments of the present application can efficiently generate the model environment map without traditional rendering analysis, thereby guaranteeing the real-time performance of game map rendering, and the detailed process is as follows:
[0044] The material information of the model is related to the refractive index of the model, the color presented by the model is related to the light wave frequency that can be absorbed, the light wave frequency that can be absorbed is related to the refractive index of the model, and the light intensity parameter is related to the brightness of the object. These are common in the field of game rendering and are basic physical knowledge, which will not be described here.
[0045] The refractive index information of the model is determined according to the material characteristics of the model, and then the light wave frequency parameter is classified according to the refractive index information of the model to obtain the reflected light wave frequency that can be reflected by the first to-be-rendered model and the absorbed light wave frequency that can be absorbed. The color to be rendered is the color presented by the reflected light wave frequency that can be reflected by the first to-be-rendered model. The brightness to be rendered is the brightness of the first to-be-rendered model determined according to the light intensity parameter.
[0046] Further, the surface of the first to-be-rendered model is usually uneven, and light will be diffused on the surface of the first to-be-rendered model, so it is also necessary to perform diffuse analysis on the first to-be-rendered model according to the model uneven feature, the model geometric feature, the light intensity parameter, the light position parameter and the reflected light wave frequency, so as to obtain a more realistic environment map. The environment map here refers to the image obtained by shooting from each position of the first to-be-rendered model, such as up, down, left, right, front and back, and the information obtained by projecting the image onto the six faces of the cube. According to the environment map, the color and brightness to be rendered by each pixel point can be reflected, so as to realize the rendering of the entire model.
[0047] Further, the diffuse analysis according to the model uneven feature, the model geometric feature, the light intensity parameter, the light position parameter and the reflected light wave frequency to generate the environment map of the first to-be-rendered model, step S530 comprises the steps of:
[0048] S531: obtaining a first mirror thickness threshold;
[0049] Further, the step S531 of obtaining the first mirror thickness threshold comprises the steps of:
[0050] S5311: setting a convex thickness threshold according to the reflected light wave frequency, wherein the convex thickness threshold is less than the reflected light wave frequency, and the first size deviation is greater than or equal to a preset deviation;
[0051] S5312: Based on the reflected light frequency, a concave surface depth threshold is set, wherein the concave surface depth threshold is less than the reflected light frequency, and the second size deviation is greater than or equal to the preset deviation.
[0052] S5313: Set the protrusion thickness threshold and the concave depth threshold as the first mirror thickness threshold.
[0053] S532: Based on the first mirror thickness threshold, the first model to be rendered is segmented by traversing the model's concave-convex features and the model's geometric features to generate multiple microscopic model mirrors;
[0054] S533: Based on the illumination position parameters and interface viewpoint position parameters, traverse the multiple microscopic model mirrors to obtain multiple microscopic mirror normal vector information and multiple microscopic mirror distribution information;
[0055] S534: Based on the reflected light frequency and the light intensity parameters, perform diffuse scattering analysis by traversing the distribution information of the multiple micro-mirrors and the normal vector information of the multiple micro-mirrors, and generate the first environment texture of the model to be rendered.
[0056] Specifically, the diffuse scattering analysis algorithm flow of this application embodiment is as follows:
[0057] First step: Model segmentation: Based on the concave and convex features of the first model to be rendered, the first model to be rendered is segmented to obtain multiple microscopic model mirrors. Any microscopic model mirror is regarded as an ideal smooth model surface, that is, within any microscopic model mirror, it is considered that no diffuse scattering will occur.
[0058] Therefore, the key to segmenting the microscopic model mirror lies in how to determine the microscopic model surface that will not cause diffuse scattering. The process is as follows: when the height of the protrusion or the depth of the concave surface of the model is much smaller than the frequency of the reflected light, diffuse scattering will not occur, only reflection will occur. Therefore, it is preferable that an expert pre-sets a preset deviation, which indicates that the height of the protrusion or the depth of the concave surface is less than the frequency of the reflected light, and when the deviation value is greater than or equal to the preset deviation, it is considered that the height of the protrusion or the depth of the concave surface will not cause diffuse scattering.
[0059] Based on the above principles, a convex thickness threshold is set, meaning the convex thickness inside any microscopic model mirror surface cannot be greater than or equal to the convex thickness threshold; and the convex thickness threshold is less than the reflected light frequency, indicating that the first dimensional deviation, representing the absolute value of the dimensional deviation between the convex thickness threshold and the reflected light frequency, is greater than or equal to a preset deviation. Similarly, a concave depth threshold is set, meaning the concave depth inside any microscopic model mirror surface cannot be greater than or equal to the concave depth threshold; and the concave depth threshold is less than the reflected light frequency, indicating that the second dimensional deviation, representing the absolute value of the dimensional deviation between the concave depth threshold and the reflected light frequency, is greater than or equal to a preset deviation. Furthermore, the convex thickness threshold and the concave depth threshold are set as the first mirror thickness threshold, thereby providing comparison benchmark data for the mirror segmentation of the first model to be rendered.
[0060] Based on the first mirror thickness threshold, the model segmentation is performed by traversing the model's concave and convex features and model geometric features, ensuring that the convex thickness of any micro-model mirror is less than the convex thickness threshold and the concave depth is less than the concave depth threshold, thereby generating multiple micro-model mirrors.
[0061] Step 2: Diffuse Scattering Analysis: The interface viewpoint position parameter refers to the position information of the first model to be rendered as seen by the player; the normal vector refers to the vector perpendicular to the vertex surface. Preferably, we take the position of any vertex of any microscopic mirror surface of the first model to be rendered as an example: connecting the vertex position and the interface viewpoint position parameter, and connecting the lighting position parameter and the vertex position, forms an angle. Any normal vector of the multiple microscopic mirror surface normal vectors belongs to the same plane as this angle and is perpendicular to any microscopic mirror surface. The distribution information of multiple microscopic mirror surfaces refers to the information representing the orientation of the distribution of multiple microscopic mirror surfaces, preferably represented by the deviation angle information of the mirror surface from the horizontal and vertical planes, as well as the distribution position information of multiple microscopic mirror surfaces.
[0062] This determines the distribution information and normal vector information of multiple micro-mirrors. Diffuse scattering does not occur inside the micro-mirrors, but diffuse scattering can occur between the micro-mirrors according to the distribution information. Based on the normal vector information of multiple micro-mirrors, the light intensity loss of diffuse scattering between micro-mirrors can be determined, and thus the environment map of multiple micro-mirrors can be obtained. Further integration can yield the overall environment map, ensuring the rendering realism of the first model to be rendered.
[0063] The preferred diffuse scattering analysis procedure is as follows:
[0064] Furthermore, step S534, which involves performing diffuse scattering analysis based on the reflected light frequency and the light intensity parameters, traversing the distribution information of the multiple microscopic mirrors and the normal vector information of the multiple microscopic mirrors, to generate the first environment texture of the model to be rendered, includes the following steps:
[0065] S5341: Perform cluster analysis based on the multiple microscopic mirror distribution information to obtain multiple sets of diffuse scattering microscopic mirror distribution information, wherein any set of the multiple sets of diffuse scattering microscopic mirror distribution information are mutually diffuse scattering microscopic mirrors.
[0066] S5342: Set the reflected light frequency, the light intensity parameter, the light position parameter, and the model material features as scene constraint parameters, and collect diffuse scattering microscopic mirror distribution recording data, microscopic mirror normal vector recording data, and environment texture parameter recording data;
[0067] S5343: Based on the diffuse scattering microscopic mirror distribution recording data, the microscopic mirror normal vector recording data, and the environment map parameter recording data, train an environment map parameter evaluation model, wherein the environment map parameter recording data includes environment map color recording data and environment map brightness recording data;
[0068] S5344: Based on the multiple sets of diffuse scattering micro-mirror distribution information, obtain the nth set of diffuse scattering micro-mirror distribution information and the nth set of micro-mirror normal vector information;
[0069] S5345: Input the nth group of diffuse micro-mirror distribution information and the nth group of micro-mirror normal vector information into the environment map parameter evaluation model to obtain the nth group of environment map parameter evaluation results;
[0070] S5346: Based on the evaluation results of the first set of environment map parameters up to the evaluation results of the nth set of environment map parameters, construct the environment map of the first model to be rendered.
[0071] Specifically, the multi-set diffuse scattering micro-mirror distribution information refers to multiple sets of micro-mirrors obtained by clustering multiple micro-mirrors based on their distribution information. Any set of micro-mirrors can diffusely scatter from each other. The method to determine whether any two mirrors can diffusely reflect each other is as follows: Light is incident at any position on one of the micro-mirrors and reflected based on the normal vector. If the reflected light can be incident on another micro-mirror, then it is considered that any two mirrors diffusely scatter from each other.
[0072] The reflected light frequency, light intensity parameters, light position parameters, and model material characteristics are set as scene constraint parameters. Diffuse scattering microscopic mirror distribution data, microscopic mirror normal vector data, and environment map parameter data are collected. Among them, the diffuse scattering microscopic mirror distribution data, microscopic mirror normal vector data, and environment map parameter data are all recorded data from historical game map rendering. The environment map parameter data includes at least environment map color data representing the color information of each pixel and environment map brightness data representing the brightness of each pixel.
[0073] Preferably, multiple sets of one-to-one corresponding diffuse microscopic mirror distribution recording data, multiple sets of microscopic mirror normal vector recording data, and multiple sets of environment map parameter recording data are divided into a 9:1 ratio, with 90% of the data used as training data and 10% used as validation data. During training or validation of any set of data, the diffuse microscopic mirror distribution recording data and the microscopic mirror normal vector recording data are used as input data, and the environment map parameter recording data is used as identifier data to evaluate the accuracy of the output data. Based on a BP neural network, an environment map parameter evaluation model is trained. When the output accuracy of the training data for a consecutive first preset number of groups is within a set accuracy rate, validation data is used for validation. If the validation output accuracy for a consecutive second preset number of groups is within a set accuracy rate, the environment map parameter evaluation model is considered to have converged; otherwise, training continues using the training data. The second preset number of groups is less than or equal to the first preset number of groups, preferably set by an expert.
[0074] The first set of diffuse scattering microscopic mirror distribution information refers to the first set of microscopic mirror distribution information among multiple sets of diffuse scattering microscopic mirror distribution information; the first set of microscopic mirror normal vector information refers to the microscopic mirror normal vector information corresponding to the first set of diffuse scattering microscopic mirror distribution information.
[0075] The nth group of diffuse scattering microscopic mirror distribution information refers to the last group of microscopic mirror distribution information among multiple groups of diffuse scattering microscopic mirror distribution information; the nth group of microscopic mirror normal vector information refers to the microscopic mirror normal vector information corresponding to the nth group of diffuse scattering microscopic mirror distribution information.
[0076] The first set of diffuse micro-mirror distribution information and the first set of micro-mirror normal vector information are input into the trained environment map parameter evaluation model to obtain the first set of environment map parameter evaluation results, which represent the color and brightness parameters of each pixel within the first set of micro-mirrors. This input is repeated until the nth set of diffuse micro-mirror distribution information and the nth set of micro-mirror normal vector information are input into the trained environment map parameter evaluation model to obtain the nth set of environment map parameter evaluation results, which represent the color and brightness parameters of each pixel within the nth set of micro-mirrors. Based on the first set of environment map parameter evaluation results up to the nth set of environment map parameter evaluation results, the first environment map representing the rendering feature information of the first model to be rendered can be obtained.
[0077] The environment map parameter evaluation model can quickly evaluate the rendering feature information required by the first model to be rendered. The environment map parameter evaluation model can be used offline or online, and can be continuously optimized based on big data. Compared with traditional rendering analysis methods, it is more efficient and has stronger real-time performance.
[0078] S600: Evaluate the rendering realism based on the environment texture of the first model to be rendered, and obtain a rendering realism score;
[0079] Furthermore, the step of evaluating the rendering realism based on the environment texture of the first model to be rendered and obtaining a rendering realism score includes the following steps in step S600:
[0080] S610: Collect real scene image information based on the lighting feature parameters, interface viewpoint position parameters and the first model to be rendered;
[0081] S620: Perform color deviation analysis on the real scene image information using the first environment texture of the model to be rendered, and obtain the color deviation degree;
[0082] S630: Perform brightness deviation analysis on the real scene image information using the first environment texture of the model to be rendered, and obtain the brightness deviation.
[0083] S640: Generate the rendering realism score based on the color deviation and the brightness deviation.
[0084] Specifically, using lighting feature parameters, interface viewpoint position parameters, and the first model to be rendered as scene parameters, based on big data, the real environment of the first model to be rendered is selected and stored as real scene image information; after dividing the real scene image information into regions according to the distribution information of multiple microscopic mirrors, the deviation between the microscopic mirrors and the environment texture of the first model to be rendered is analyzed to obtain the rendering realism score, providing a judgment benchmark information for triggering rendering commands.
[0085] The following are preferred methods for scoring rendering realism:
[0086] A color deviation scoring table is constructed. This table represents the magnitude of the deviation between any two colors. The smaller the deviation between two colors, the higher the color deviation score; conversely, the larger the deviation, the lower the score. This table can be pre-set by an expert group. Based on the color deviation scoring table, color deviation analysis is performed on the environment texture of the first model to be rendered, comparing it with the real-world image information to obtain the color deviation score, thus representing the color deviation score result.
[0087] A brightness deviation scoring table is constructed, which is a data table showing the magnitude of the deviation between any two brightness levels. The smaller the deviation between any two brightness levels, the higher the brightness deviation score; conversely, the larger the deviation, the lower the score. This table can be pre-set by an expert group. Based on the brightness deviation scoring table, brightness deviation analysis is performed on the environment texture of the first model to be rendered and the real scene image information to obtain the brightness deviation score, representing the brightness deviation score result. Furthermore, the color deviation and brightness deviation are linked and stored one-to-one, added to the rendering realism score for easy retrieval in subsequent steps.
[0088] S700: When the rendering realism score is greater than or equal to the rendering realism score threshold, a first rendering instruction is generated to render the first model to be rendered.
[0089] Specifically, the rendering realism score threshold refers to the lowest realism score that can be rendered, including the color deviation score threshold and the brightness deviation score threshold. The color deviation is compared with the color deviation score threshold, and the brightness deviation is compared with the brightness deviation score threshold. In any micro-mirror, it is considered qualified only if the color deviation is greater than or equal to the color deviation score threshold and the brightness deviation is greater than or equal to the brightness deviation score threshold at the same time. When all micro-mirrors are qualified, the first rendering instruction is generated, and the first model to be rendered is rendered based on the environment texture of the first model to be rendered.
[0090] Furthermore, if, within a set period, the rendering realism score is greater than or equal to the rendering realism score threshold in a consecutive preset number of judgments, the game map rendering analysis is considered relatively stable. Therefore, for the remaining time within the set period, no realism judgment is needed, and game map rendering can proceed directly when the first environment texture map of the model to be rendered is generated. This further improves the real-time performance and realism of game map rendering.
[0091] In summary, the embodiments of this application have at least the following technical effects:
[0092] This application embodiment determines the set of models to be rendered by using the coordinates of the game interface edges, that is, binding the models and the map based on coordinates, which facilitates rapid response and matching of the set of models to be rendered, ensuring real-time rendering. Furthermore, by using lighting analysis instead of traditional rendering analysis techniques, the environment textures of the models to be rendered can be obtained more efficiently, ensuring real-time rendering. Even further, the environment textures of the models to be rendered are scored for realism; only environment textures that meet the scoring threshold can be rendered, ensuring rendering realism. In summary, the game map rendering scheme provided by this application embodiment simultaneously achieves the technical effects of both real-time rendering and realism.
[0093] Example 2
[0094] Based on the same inventive concept as the game map rendering method in the foregoing embodiments, such as Figure 4 As shown, this application provides a game map rendering system, which includes:
[0095] Interface edge coordinate retrieval module 11 is used to obtain the edge coordinates of the game interface to be switched to;
[0096] Scene model matching module 12 is used to perform scene model matching based on the edge coordinates of the game interface to be cut into, and obtain a first model to be rendered, wherein the first model to be rendered is any scene matching model.
[0097] The illumination feature setting module 13 is used to acquire illumination feature parameters, wherein the illumination feature parameters include illumination intensity parameters, illumination position parameters, and illumination frequency parameters;
[0098] The model feature retrieval module 14 is used to extract model material features, model geometric features and model concavity and convexity features based on the first model to be rendered;
[0099] The environment texture analysis module 15 is used to perform lighting analysis on the model material features, model geometric features and model bump features based on the lighting intensity parameters, the lighting position parameters and the lighting frequency parameters, and generate a first environment texture of the model to be rendered.
[0100] The realism scoring module 16 is used to evaluate the realism of rendering based on the environment texture of the first model to be rendered and obtain a realism score.
[0101] The model rendering module 17 is used to generate a first rendering instruction to render the first model to be rendered when the rendering realism score is greater than or equal to the rendering realism score threshold.
[0102] Furthermore, the scene model matching module 12 performs the following steps:
[0103] Match the first scene world map based on the game interface to be entered;
[0104] The first scene world map is segmented into regions based on the edge coordinates of the game interface to be entered, and a first scene local map is generated. The first scene local map includes multiple model coordinate information and multiple model pose information to be rendered, and the multiple model coordinate information and the multiple model pose information to be rendered correspond one-to-one.
[0105] The coordinate information and pose information of the multiple models to be rendered are traversed, and multiple scene matching models are matched, wherein the first model to be rendered belongs to the multiple scene matching models.
[0106] Furthermore, the environmental mapping analysis module 15 performs the following steps:
[0107] Based on the material characteristics of the model, obtain the model's refractive index information;
[0108] The light frequency parameters are classified according to the refractive index information of the model to generate reflected light frequency and absorbed light frequency, wherein the reflected light frequency is the non-absorbable light frequency.
[0109] Based on the model's concavity and convexity features, geometric features, illumination intensity parameters, illumination position parameters, and reflected light frequency, diffuse scattering analysis is performed to generate the first environment texture map of the model to be rendered.
[0110] Furthermore, the environmental mapping analysis module 15 performs the following steps:
[0111] Obtain the first mirror thickness threshold;
[0112] Based on the first mirror thickness threshold, the first model to be rendered is segmented by traversing the model's concave and convex features and the model's geometric features to generate multiple microscopic model mirrors.
[0113] Based on the illumination position parameters and interface viewpoint position parameters, the multiple microscopic model mirrors are traversed to obtain multiple microscopic mirror normal vector information and multiple microscopic mirror distribution information;
[0114] Based on the reflected light frequency and the light intensity parameters, diffuse scattering analysis is performed by traversing the distribution information of the multiple microscopic mirrors and the normal vector information of the multiple microscopic mirrors to generate the environment texture of the first model to be rendered.
[0115] Furthermore, the environmental mapping analysis module 15 performs the following steps:
[0116] Cluster analysis is performed based on the distribution information of the multiple micro-mirrors to obtain multiple sets of diffuse scattering micro-mirror distribution information, wherein any set of the multiple sets of diffuse scattering micro-mirror distribution information are mutually diffuse scattering micro-mirrors.
[0117] The reflected light frequency, the light intensity parameter, the light position parameter, and the model material features are set as scene constraint parameters. Diffuse scattering microscopic mirror distribution data, microscopic mirror normal vector data, and environment texture parameter data are collected.
[0118] Based on the diffuse scattering microscopic mirror distribution recording data, the microscopic mirror normal vector recording data, and the environment map parameter recording data, an environment map parameter evaluation model is trained, wherein the environment map parameter recording data includes environment map color recording data and environment map brightness recording data;
[0119] Based on the multiple sets of diffuse scattering micro-mirror distribution information, obtain the nth set of diffuse scattering micro-mirror distribution information and the nth set of micro-mirror normal vector information;
[0120] The nth group of diffuse micro-mirror distribution information and the nth group of micro-mirror normal vector information are input into the environment map parameter evaluation model to obtain the nth group of environment map parameter evaluation results;
[0121] Based on the evaluation results of the first set of environment map parameters up to the evaluation results of the nth set of environment map parameters, construct the environment map of the first model to be rendered.
[0122] Furthermore, the environmental mapping analysis module 15 performs the following steps:
[0123] Based on the reflected light frequency, a protrusion thickness threshold is set, wherein the protrusion thickness threshold is less than the reflected light frequency, and the first size deviation is greater than or equal to a preset deviation;
[0124] Based on the reflected light frequency, a concave surface depth threshold is set, wherein the concave surface depth threshold is less than the reflected light frequency, and the second size deviation is greater than or equal to the preset deviation;
[0125] The protrusion thickness threshold and the concave depth threshold are set as the first mirror thickness threshold.
[0126] Furthermore, the authenticity scoring module 16 performs the following steps:
[0127] Based on the lighting feature parameters, interface viewpoint position parameters, and the first model to be rendered, collect real scene image information;
[0128] The color deviation of the first model environment texture to be rendered is analyzed against the real scene image information to obtain the color deviation degree.
[0129] The brightness deviation of the real scene image information is analyzed by using the environment texture of the first model to be rendered;
[0130] The rendering realism score is generated based on the color deviation and the brightness deviation.
[0131] Example 3
[0132] like Figure 5As shown, based on the same inventive concept as the game map rendering method in the foregoing embodiment, this application also provides a computer device 300, which includes a memory 301 and a processor 302. The memory 301 stores a computer program, and when the computer program is executed by the processor 302, it implements the steps of a method of the embodiment.
[0133] The computer device 300 includes a processor 302, a communication interface 303, and a memory 301. Optionally, the computer device 300 may also include a bus architecture 304. The communication interface 303, processor 302, and memory 301 can be interconnected via the bus architecture 304; the bus architecture 304 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus architecture 304 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0134] Processor 302 may be a CPU, microprocessor, ASIC, or one or more integrated circuits used to control the execution of programs according to the present application.
[0135] Communication interface 303 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), wired access network, etc.
[0136] Memory 301 may be ROM or other types of static storage devices capable of storing static information and instructions, RAM or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory may exist independently and be connected to the processor via bus architecture 304. Memory may also be integrated with the processor.
[0137] The memory 301 stores computer execution instructions for implementing the scheme of this application, and the processor 302 controls the execution. The processor 302 executes the computer execution instructions stored in the memory 301, thereby implementing the game map rendering method provided in the above embodiments of this application.
[0138] Example 4
[0139] Based on the same inventive concept as the game map rendering method in the foregoing embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method in Embodiment 1.
[0140] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. A method for rendering a game map, characterized in that, The method comprises the following steps: obtaining a to-be-cut-in game interface edge coordinate; performing scene model matching according to the to-be-cut-in game interface edge coordinate to obtain a first to-be-rendered model, wherein the first to-be-rendered model is any one of the scene matching models; obtaining a lighting feature parameter, wherein the lighting feature parameter comprises a lighting intensity parameter, a lighting position parameter and a lighting wave frequency parameter; extracting a model material feature, a model geometric feature and a model concave-convex feature according to the first to-be-rendered model; performing lighting analysis on the model material feature, the model geometric feature and the model concave-convex feature based on the lighting intensity parameter, the lighting position parameter and the lighting wave frequency parameter to generate a first to-be-rendered model environment map; performing rendering reality evaluation according to the first to-be-rendered model environment map to obtain a rendering reality score; generating a first rendering instruction when the rendering reality score is greater than or equal to a rendering reality score threshold to render the first to-be-rendered model; The scene model matching according to the to-be-cut-in game interface edge coordinate to obtain the first to-be-rendered model, wherein the first to-be-rendered model is any one of the scene matching models, comprises the following steps: matching a first scene world map according to the to-be-cut-in game interface; performing region segmentation on the first scene world map according to the to-be-cut-in game interface edge coordinate to generate a first scene local map, wherein the first scene local map comprises a plurality of to-be-rendered model coordinate information and a plurality of to-be-rendered model posture information, and the plurality of to-be-rendered model coordinate information and the plurality of to-be-rendered model posture information correspond one by one; traversing the plurality of to-be-rendered model coordinate information and the plurality of to-be-rendered model posture information to match a plurality of scene matching models, wherein the first to-be-rendered model belongs to the plurality of scene matching models.
2. The method of claim 1, wherein, The lighting analysis on the model material feature, the model geometric feature and the model concave-convex feature based on the lighting intensity parameter, the lighting position parameter and the lighting wave frequency parameter to generate the first to-be-rendered model environment map comprises the following steps: obtaining model refractive index information according to the model material feature; classifying the lighting wave frequency parameter according to the model refractive index information to generate a reflected lighting wave frequency and an absorbed lighting wave frequency, wherein the reflected lighting wave frequency is an unabsorbed lighting wave frequency; performing diffuse scattering analysis on the model concave-convex feature, the model geometric feature, the lighting intensity parameter, the lighting position parameter and the reflected lighting wave frequency to generate the first to-be-rendered model environment map.
3. The method of claim 2, wherein, The diffuse scattering analysis on the model concave-convex feature, the model geometric feature, the lighting intensity parameter, the lighting position parameter and the reflected lighting wave frequency to generate the first to-be-rendered model environment map comprises the following steps: obtaining a first mirror thickness threshold value; performing model segmentation on the first to-be-rendered model according to the first mirror thickness threshold value by traversing the model concave-convex feature and the model geometric feature to generate a plurality of microscopic model mirrors; According to the light position parameter and the interface view position parameter, the plurality of microcosmic model mirror surfaces are traversed to obtain a plurality of microcosmic mirror normal vector information and a plurality of microcosmic mirror distribution information; According to the reflected light wave frequency and the light intensity parameter, the plurality of microcosmic mirror distribution information and the plurality of microcosmic mirror normal vector information are traversed for diffuse scattering analysis to generate the first to-be-rendered model environment map.
4. The method of claim 3, wherein, According to the reflected light wave frequency and the light intensity parameter, the plurality of microcosmic mirror distribution information and the plurality of microcosmic mirror normal vector information are traversed for diffuse scattering analysis to generate the first to-be-rendered model environment map. According to the plurality of microcosmic mirror distribution information, clustering analysis is performed to obtain a plurality of groups of diffuse scattering microcosmic mirror distribution information, wherein any one group of the plurality of groups of diffuse scattering microcosmic mirror distribution information is a mutually diffuse scattering microcosmic mirror; The reflected light wave frequency, the light intensity parameter, the light position parameter and the model material characteristics are set as scene constraint parameters, and diffuse scattering microcosmic mirror distribution record data, microcosmic mirror normal vector record data and environment map parameter record data are collected; According to the diffuse scattering microcosmic mirror distribution record data, the microcosmic mirror normal vector record data and the environment map parameter record data, an environment map parameter evaluation model is trained, wherein the environment map parameter record data includes environment map color record data and environment map brightness record data; According to the plurality of groups of diffuse scattering microcosmic mirror distribution information, the n-th group of diffuse scattering microcosmic mirror distribution information and the n-th group of microcosmic mirror normal vector information are obtained; The n-th group of diffuse scattering microcosmic mirror distribution information and the n-th group of microcosmic mirror normal vector information are input into the environment map parameter evaluation model to obtain the n-th group of environment map parameter evaluation results; According to the first group of environment map parameter evaluation results to the n-th group of environment map parameter evaluation results, the first to-be-rendered model environment map is constructed.
5. The method of claim 1, wherein, The rendering reality evaluation according to the first to-be-rendered model environment map includes: According to the light feature parameter, the interface view position parameter and the first to-be-rendered model, real scene image information is collected; The first to-be-rendered model environment map is subjected to color deviation analysis on the real scene image information to obtain a color deviation degree; The first to-be-rendered model environment map is subjected to brightness deviation analysis on the real scene image information to obtain a brightness deviation degree; According to the color deviation degree and the brightness deviation degree, the rendering reality score is generated.
6. A rendering system of a game map, characterized in that, It includes: An interface edge coordinate calling module is configured to obtain to-be-cut-in game interface edge coordinates; A scene model matching module is configured to perform scene model matching according to the to-be-cut-in game interface edge coordinates to obtain a first to-be-rendered model, wherein the first to-be-rendered model is any one scene matching model; A light feature setting module is configured to obtain a light feature parameter, wherein the light feature parameter includes a light intensity parameter, a light position parameter and a light wave frequency parameter; The model feature extraction module is configured to extract model material features, model geometric features, and model concave-convex features from the first model to be rendered. The environment map analysis module is configured to perform illumination analysis on the model material features, the model geometric features, and the model concave-convex features based on the light intensity parameter, the light position parameter, and the light wave frequency parameter, and generate a first model-to-be-rendered environment map. The reality score module is configured to perform rendering reality evaluation based on the first model-to-be-rendered environment map, and obtain a rendering reality score. The model rendering module is configured to generate a first rendering instruction when the rendering reality score is greater than or equal to a rendering reality score threshold, and render the first model to be rendered. The scene model matching based on the edge coordinates of the game interface to be cut into obtains a first model to be rendered, wherein the first model to be rendered is any one of scene matching models, and includes the following steps: Matching a first scene world map according to the game interface to be cut into; Segmenting the first scene world map according to the edge coordinates of the game interface to be cut into to generate a first scene local map, wherein the first scene local map includes a plurality of model-to-be-rendered coordinate information and a plurality of model-to-be-rendered posture information, and the plurality of model-to-be-rendered coordinate information and the plurality of model-to-be-rendered posture information are in one-to-one correspondence; Traversing the plurality of model-to-be-rendered coordinate information and the plurality of model-to-be-rendered posture information to match a plurality of scene matching models, wherein the first model to be rendered belongs to the plurality of scene matching models.
7. A computer device, comprising: The computer device includes a memory and a processor, and the memory stores a computer program, which, when executed by the processor, implements the steps of the method of any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which, when executed by the processor, implements the steps of the method of any one of claims 1-5.
Citation Information
Patent Citations
Model rendering method, device and equipment and storage medium
CN112316420A
Game scene rendering method and device and electronic equipment
CN113192168A