Rendering methods, devices, electronic equipment, and computer-readable media for terrain

By obtaining the world coordinates and texture map coordinates of the rendering points, sampling the terrain material properties, and using grayscale sampling to obtain the terrain transition factor and proportion parameters, a natural transition of the game terrain is achieved. This solves the problems of high performance consumption and cumbersome operation in existing technologies, and improves the realism and efficiency of the game performance.

CN115591236BActive Publication Date: 2026-05-26NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-10-18
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies require traversing all objects to generate static materials when changing terrain in games, resulting in high performance consumption and cumbersome operation, which affects the realism and performance of the game.

Method used

By obtaining the world coordinates and texture map coordinates of the rendering points, sampling the terrain material properties, and using grayscale sampling to obtain the terrain transition factor and proportion parameters, a natural transition of terrain materials is achieved, reducing the traversal of objects and the generation of static materials.

Benefits of technology

It achieves a natural transition effect between different terrain appearances, reduces game performance overhead, improves operational efficiency, and solves the problem of abrupt changes in terrain texture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115591236B_ABST
    Figure CN115591236B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, electronic device, and computer-readable medium for rendering terrain in games, belonging to the field of game rendering technology. The method includes: sampling first and second terrain material textures using texture map coordinates of rendering points to obtain terrain material attributes; sampling a sample grayscale image multiple times using multiple different grayscale sampling coordinates to obtain grayscale channel sampling values; obtaining a terrain transition factor based on the grayscale channel sampling values, and determining a terrain material proportion parameter based on the terrain transition factor and a proportion adjustment parameter; obtaining a blended terrain material attribute based on the first and second terrain material attributes and the proportion parameter, and rendering based on the blended terrain material attribute of each rendering point. This disclosure, by writing multiple terrain representations into the same terrain material and using a proportion adjustment parameter to adjust the proportion of different terrain materials, can achieve transition effects between different terrain representations and reduce game performance overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of game rendering technology, and more specifically, to a method for rendering terrain in a game, a device for rendering terrain in a game, an electronic device, and a computer-readable medium. Background Technology

[0002] In games, terrain transformation primarily involves altering the appearance of the terrain in accordance with weather changes, which can greatly enhance the game's immersion. Currently, to change the appearance of the terrain based on weather, it is often necessary to traverse all objects in the scene, generate a target terrain material for each object, and finally replace the original material with the target material.

[0003] From a game performance perspective, the above solution requires generating a static material for each object when changing the terrain, which is very performance-intensive. If there are many objects, stuttering may occur. Furthermore, the solution needs to iterate through all objects to determine which need to be changed and which don't, making the process cumbersome. In terms of game presentation, directly replacing the original material with the target material results in a sudden change in terrain, significantly impacting the game's realism.

[0004] Therefore, there is an urgent need in this field for a terrain rendering method that can achieve transition effects between different terrain representations and reduce the performance overhead of the game.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a method for rendering terrain in a game, a device for rendering terrain in a game, an electronic device, and a computer-readable medium, thereby enabling, at least to some extent, the transition effect between different representations of terrain and reducing the performance overhead of the game.

[0007] According to the first aspect of this disclosure, a method for rendering terrain in a game is provided, comprising:

[0008] Obtain the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points;

[0009] The first terrain material map and the second terrain material map are sampled using the texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes.

[0010] Based on the world coordinates of the rendering point, multiple different grayscale sampling coordinates are obtained, and the sample grayscale image is sampled multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sampling values.

[0011] The terrain transition factor corresponding to the rendering point is obtained based on the sampled values ​​of multiple grayscale channels, and the proportion parameter between the first terrain material and the second terrain material is determined based on the terrain transition factor and the proportion adjustment parameter.

[0012] The blended terrain material attributes are obtained based on the first terrain material attribute, the second terrain material attribute, and the proportion parameter, and the terrain in the game is rendered based on the blended terrain material attributes corresponding to each rendering point.

[0013] In one exemplary embodiment of this disclosure, the step of sampling the first terrain material map and the second terrain material map using the texture map coordinates to obtain the first terrain material attribute and the second terrain material attribute includes:

[0014] The color map, normal map, and roughness map of the first and second terrain materials are sampled using the texture map coordinates to obtain the color parameters, normal parameters, and roughness parameters of the first and second terrain materials.

[0015] The color parameters, normal parameters, and roughness parameters of the first and second terrain materials are integrated by establishing a function based on material properties to obtain the first and second terrain material properties.

[0016] In one exemplary embodiment of this disclosure, obtaining the corresponding texture map coordinates based on the world coordinates of the rendering point includes:

[0017] Based on the values ​​of the red and green channels of the world coordinates of the rendering point, a two-dimensional vector corresponding to the world coordinates is obtained;

[0018] The texture map coordinates corresponding to the world coordinates are obtained by multiplying the two-dimensional vector with the coordinate tuning constant.

[0019] In one exemplary embodiment of this disclosure, obtaining multiple different grayscale sampling coordinates based on the world coordinates of the rendering point includes:

[0020] Based on the two-dimensional vector corresponding to the world coordinates of the rendering point and multiple sets of different coordinate offset adjustment parameters, multiple different grayscale sampling coordinates are obtained.

[0021] In one exemplary embodiment of this disclosure, the step of sampling the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sample values ​​includes:

[0022] The red channel of the sample grayscale image is sampled multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sample values.

[0023] In one exemplary embodiment of this disclosure, obtaining the terrain transition factor corresponding to the rendering point based on the sampled values ​​of the plurality of grayscale image channels includes:

[0024] The terrain transition factor corresponding to the rendering point is obtained by weighting the sampled values ​​of multiple grayscale image channels according to preset weight parameters.

[0025] In one exemplary embodiment of this disclosure, obtaining the fused landform material attribute based on the first landform material attribute, the second landform material attribute, and the proportion parameter includes:

[0026] The first landform material attribute and the second landform material attribute are fused according to the proportion parameter using the material fusion function to obtain the fused landform material attribute.

[0027] According to a second aspect of this disclosure, a rendering apparatus for game terrain is provided, comprising:

[0028] The rendering coordinate acquisition module is used to acquire the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points;

[0029] The terrain material sampling module is used to sample the first terrain material map and the second terrain material map respectively through the texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes.

[0030] The grayscale channel sampling module is used to obtain multiple different grayscale sampling coordinates based on the world coordinates of the rendering point, and to sample the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale channel sampling values.

[0031] The proportion parameter determination module is used to obtain the terrain transition factor corresponding to the rendering point based on the sampling values ​​of multiple grayscale channels, and to determine the proportion parameter between the first terrain material and the second terrain material based on the terrain transition factor and the proportion adjustment parameter.

[0032] The blended material rendering module is used to obtain blended terrain material attributes based on the first terrain material attributes, the second terrain material attributes, and the proportion parameters, and to render the terrain in the game based on the blended terrain material attributes corresponding to each rendering point.

[0033] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the game terrain rendering method described in any of the preceding claims by executing the executable instructions.

[0034] According to a fourth aspect of this disclosure, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method for rendering terrain in a game as described in any of the preceding claims.

[0035] The exemplary embodiments disclosed herein can have the following beneficial effects:

[0036] In the game terrain rendering method of the exemplary implementation of this disclosure, the first terrain material map and the second terrain material map are sampled respectively by the texture map coordinates of the rendering point to obtain the first terrain material attribute and the second terrain material attribute. The grayscale image is sampled multiple times by the grayscale sampling coordinates of the rendering point to obtain multiple grayscale image channel sampling values. Then, the terrain transition factor corresponding to the rendering point is obtained according to the multiple grayscale image channel sampling values. The proportion parameter between the first terrain material and the second terrain material is determined according to the terrain transition factor and the proportion adjustment parameter. Finally, the blended terrain material attribute is obtained according to the first terrain material attribute, the second terrain material attribute and the proportion parameter. The terrain in the game is rendered according to the blended terrain material attribute corresponding to each rendering point. The game terrain rendering method in the exemplary embodiments of this disclosure, on the one hand, by writing multiple terrain representations into the same terrain material and using proportion adjustment parameters to adjust the proportion of different terrain materials, can achieve a natural transition effect between different terrain representations. It can change the terrain representation in real time according to weather changes in the game, solve the problem of abrupt changes in terrain materials, and achieve a real-time gradient effect. On the other hand, when changing the terrain material, it is not necessary to traverse the objects in the scene, generate static materials for the objects, or modify each terrain component separately. It is only necessary to modify the proportion adjustment parameters according to the requirements, which solves the problems of high performance overhead and low operation efficiency.

[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0039] Figure 1 A flowchart illustrating a method for rendering game terrain according to an exemplary embodiment of this disclosure is shown.

[0040] Figure 2 A schematic diagram illustrating the sampling process of a first terrain texture map and a second terrain texture map according to an exemplary embodiment of the present disclosure is shown.

[0041] Figure 3 A sample grayscale image is schematically shown in one specific embodiment of the present disclosure;

[0042] Figure 4 The illustration schematically shows a terrain transition effect obtained by a terrain rendering method according to a specific embodiment of the present disclosure.

[0043] Figure 5 The illustration schematically shows another terrain transition effect obtained by a terrain rendering method according to a specific embodiment of the present disclosure;

[0044] Figure 6 A block diagram of a game terrain rendering apparatus according to an exemplary embodiment of the present disclosure is shown;

[0045] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure is shown. Detailed Implementation

[0046] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of these specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0047] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0048] In the game, changes in terrain mainly involve changes in terrain materials. This means that changes in the external environment in the game can be reflected in the terrain materials through code and other means, allowing the terrain to transition from one material to another.

[0049] This example implementation first provides a method for rendering terrain in a game. (See references) Figure 1 As shown, the terrain rendering method in the above game may include the following steps:

[0050] Step S110. Obtain the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points.

[0051] Step S120. Sample the first terrain material map and the second terrain material map respectively using texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes.

[0052] Step S130. Obtain multiple different grayscale sampling coordinates based on the world coordinates of the rendering point, and sample the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sampling values.

[0053] Step S140. Obtain the terrain transition factor corresponding to the rendering point based on the sampling values ​​of multiple grayscale channels, and determine the proportion parameter between the first terrain material and the second terrain material based on the terrain transition factor and the proportion adjustment parameter.

[0054] Step S150. Obtain the blended terrain material attribute based on the first terrain material attribute, the second terrain material attribute, and the proportion parameter, and render the terrain in the game based on the blended terrain material attribute corresponding to each rendering point.

[0055] In the game terrain rendering method of the exemplary implementation of this disclosure, the first terrain material map and the second terrain material map are sampled respectively by the texture map coordinates of the rendering point to obtain the first terrain material attribute and the second terrain material attribute. The grayscale image is sampled multiple times by the grayscale sampling coordinates of the rendering point to obtain multiple grayscale image channel sampling values. Then, the terrain transition factor corresponding to the rendering point is obtained according to the multiple grayscale image channel sampling values. The proportion parameter between the first terrain material and the second terrain material is determined according to the terrain transition factor and the proportion adjustment parameter. Finally, the blended terrain material attribute is obtained according to the first terrain material attribute, the second terrain material attribute and the proportion parameter. The terrain in the game is rendered according to the blended terrain material attribute corresponding to each rendering point. The game terrain rendering method in the exemplary embodiments of this disclosure, on the one hand, by writing multiple terrain representations into the same terrain material and using proportion adjustment parameters to adjust the proportion of different terrain materials, can achieve a natural transition effect between different terrain representations. It can change the terrain representation in real time according to weather changes in the game, solve the problem of abrupt changes in terrain materials, and achieve a real-time gradient effect. On the other hand, when changing the terrain material, it is not necessary to traverse the objects in the scene, generate static materials for the objects, or modify each terrain component separately. It is only necessary to modify the proportion adjustment parameters according to the requirements, which solves the problems of high performance overhead and low operation efficiency.

[0056] Below, in conjunction with Figures 2 to 5 The steps described above in this example implementation will be explained in more detail.

[0057] In step S110, the world coordinates of each rendering point in the game are obtained, and the corresponding texture map coordinates are obtained based on the world coordinates of the rendering points.

[0058] In this example implementation, the world coordinates of the rendering point refer to the coordinates of the rendering point on the X, Y, Z axes of the world coordinate system. The corresponding texture map coordinates can be obtained from the world coordinates of the rendering point. The texture map coordinates are the UV coordinates used to sample the terrain material map.

[0059] In this example implementation, the two-dimensional vector corresponding to the world coordinates can be obtained based on the values ​​of the red and green channels of the world coordinates of the rendering point. Then, the texture map coordinates corresponding to the world coordinates can be obtained by multiplying the two-dimensional vector with the coordinate tuning constant.

[0060] Convert the world coordinates of the current rendering point to meters, then take the R channel (red channel) and G channel (green channel) of the converted world coordinates to form a two-dimensional vector, denoted as WPUV. Multiply the two-dimensional vector WPUV by a manually configured constant (which can be obtained through debugging) to obtain the texture map coordinates corresponding to the world coordinates of the rendering point, denoted as TextureUV.

[0061] In step S120, the first terrain material map and the second terrain material map are sampled by texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes.

[0062] In this example implementation, the terrain texture map may include color maps, normal maps, and roughness maps corresponding to the terrain material. For example... Figure 2 As shown, the first and second terrain textures are sampled using texture map coordinates to obtain the first and second terrain texture attributes. This process can include the following steps:

[0063] Step S210. Sample the color map, normal map, and roughness map of the first and second terrain materials respectively using texture map coordinates to obtain the color parameters, normal parameters, and roughness parameters of the first and second terrain materials.

[0064] The color map, normal map, and roughness map of the first terrain material are sampled using TextureUV coordinates to obtain the color parameter BaseColor1, normal parameter Normal1, and roughness parameter Roughness1 of the first terrain material. Simultaneously, the color map, normal map, and roughness map of the second terrain material are sampled using TextureUV coordinates to obtain the color parameter BaseColor2, normal parameter Normal2, and roughness parameter Roughness2 of the first terrain material.

[0065] Step S220. Integrate the color parameters, normal parameters, and roughness parameters of the first and second terrain materials respectively through the material property establishment function to obtain the first and second terrain material properties.

[0066] The color parameter BaseColor1, normal parameter Normal1, and roughness parameter Roughness1 of the first terrain material are integrated and calculated using the MakeMaterialAttributes function (material attribute creation function) to obtain the first terrain material attribute, denoted as LandA. Here, the terrain material attribute is the attribute set corresponding to the terrain material. Simultaneously, the color parameter BaseColor1, normal parameter Normal1, and roughness parameter Roughness1 of the second terrain material are also integrated and calculated using the MakeMaterialAttributes function to obtain the second terrain material attribute, denoted as LandB.

[0067] In step S130, multiple different grayscale sampling coordinates are obtained based on the world coordinates of the rendering point, and the sample grayscale image is sampled multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sampling values.

[0068] In this example implementation, grayscale sampling coordinates are UV coordinates used to sample the grayscale image. By adjusting parameters based on the two-dimensional vector corresponding to the world coordinates of the rendering point and multiple sets of different coordinate offsets, multiple different grayscale sampling coordinates can be obtained.

[0069] Multiplying the 2D vector WPUV corresponding to the world coordinates by a pre-configured parameter S1, and then adding an offset SUV1, yields a grayscale sampling coordinate, expressed by the following formula:

[0070] SampleUV1 = WPUV * S1 + SUV1

[0071] Where S1 is a manually configured constant, SUV1 is a manually configured two-dimensional vector, and SampleUV1 is the UV value required for sampling.

[0072] For multiple sets of different parameters S2, SUV2 and S3, SUV3, grayscale sampling coordinates SampleUV2 and SampleUV3 with different offsets can be calculated.

[0073] In this example implementation, multiple grayscale channel sampling values ​​can be obtained by sampling the red channel of the sample grayscale image multiple times using grayscale sampling coordinates.

[0074] like Figure 3 The diagram shows a sample grayscale image according to a specific embodiment of this disclosure. By sampling the R channel of the sample grayscale image using grayscale sampling coordinates SampleUV1, SampleUV2, and SampleUV3, the corresponding grayscale image channel sampling values ​​R1, R2, and R3 can be obtained. The grayscale image channel sampling values ​​range from 0 to 1.

[0075] In step S140, the terrain transition factor corresponding to the rendering point is obtained based on the sampling values ​​of multiple grayscale channels, and the proportion parameter between the first terrain material and the second terrain material is determined based on the terrain transition factor and the proportion adjustment parameter.

[0076] In this example implementation, the sampled values ​​of multiple grayscale image channels can be weighted and averaged according to preset weight parameters to obtain the terrain transition factor corresponding to the rendering point.

[0077] By multiplying the sampled values ​​R1, R2, and R3 of the grayscale image channels by different weight parameters and then performing a weighted average, the terrain transition factor corresponding to the rendered point can be obtained. The specific formula is as follows:

[0078] TransitionFactor=(I1*R1+I2*R2+I3*R3) / (I1+I2+I3)

[0079] Among them, I1, I2 and I3 are all manually configured constants.

[0080] In this example implementation, the sample grayscale image is sampled multiple times using world coordinates with different offsets, and the sampled values ​​are weighted and averaged to obtain a terrain transition factor with very low redundancy. This allows the two terrain materials to be irregularly blended, resulting in a more natural terrain transition.

[0081] In this example implementation, a material parameter set, denoted as MPC (Material Parameter Collection), can be created. The material parameter set MPC contains a percentage adjustment parameter P. By changing the variables of the material parameter set, all associated materials can be adjusted synchronously.

[0082] The formula for calculating the ratio parameter Alpha between the first and second landform materials is as follows:

[0083] Alpha=Power(Clamp((TransitionFactor-(1-P)) / S3),S4)

[0084] S3 and S4 are manually configured parameters. Clamp is a commonly used rendering function that can restrict a value to between 0 and 1. Power is also a commonly used rendering function; Power(a,b) is equivalent to a^b.

[0085] In step S150, the blended terrain material attributes are obtained based on the first terrain material attributes, the second terrain material attributes, and the proportion parameters, and the terrain in the game is rendered based on the blended terrain material attributes corresponding to each rendering point.

[0086] In this example implementation, the first and second landform material attributes are fused according to the proportion parameter using a material fusion function to obtain the fused landform material attributes.

[0087] The material properties of the blended terrain material that transitions between two terrain materials can be calculated using the following formula:

[0088] LandMaterial=BlendMaterialAttributes(LandA,LandB,Alpha)

[0089] The `BlendMaterialAttributes(A,B,Alpha)` function is used to blend two terrain materials. The `BlendMaterialAttribute` function calculates the blending of two terrain materials. The `Alpha` parameter controls the transition ratio between the two materials; the closer `Alpha` is to 1, the closer the blended material is to `B`, and the closer `Alpha` is to 0, the closer the blended material is to `A`. `LandMaterial` represents the final material representation of the terrain.

[0090] Figure 4 and Figure 5 The illustration shows two terrain transition effect diagrams obtained by a terrain rendering method according to a specific embodiment of this disclosure. During game runtime, by reading the material parameter set MPC and then modifying the P value in real time through code according to weather changes, such as from cloudy to sunny, the transition gradient effect of all relevant terrain materials can be achieved.

[0091] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0092] Furthermore, this disclosure also provides a rendering device for game terrain. (See reference) Figure 6 As shown, the terrain rendering device in this game may include a rendering coordinate acquisition module 610, a terrain material sampling module 620, a grayscale channel sampling module 630, a proportion parameter determination module 640, and a blended material rendering module 650. Wherein:

[0093] The rendering coordinate acquisition module 610 can be used to acquire the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points;

[0094] The terrain material sampling module 620 can be used to sample the first terrain material map and the second terrain material map respectively through texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes.

[0095] The grayscale channel sampling module 630 can be used to obtain multiple different grayscale sampling coordinates based on the world coordinates of the rendering point, and to sample the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale channel sampling values.

[0096] The proportion parameter determination module 640 can be used to obtain the terrain transition factor corresponding to the rendering point based on the sampling values ​​of multiple grayscale channels, and determine the proportion parameter between the first terrain material and the second terrain material based on the terrain transition factor and the proportion adjustment parameter.

[0097] The blended material rendering module 650 can be used to obtain blended terrain material attributes based on the first terrain material attributes, the second terrain material attributes, and the proportion parameters, and to render the terrain in the game based on the blended terrain material attributes corresponding to each rendering point.

[0098] In some exemplary embodiments of this disclosure, the rendering coordinate acquisition module 610 may include a coordinate two-dimensional vector determination unit and a texture map coordinate determination unit. Wherein:

[0099] The coordinate two-dimensional vector determination unit can be used to obtain the two-dimensional vector corresponding to the world coordinates based on the values ​​of the red and green channels of the world coordinates of the rendering point;

[0100] The texture map coordinate determination unit can be used to obtain the texture map coordinates corresponding to the world coordinates based on the product of a two-dimensional vector and a coordinate tuning constant.

[0101] In some exemplary embodiments of this disclosure, the terrain material sampling module 620 may include a material texture sampling unit and a material parameter integration unit. Wherein:

[0102] The material map sampling unit can be used to sample the color map, normal map, and roughness map of the first and second terrain materials respectively through texture map coordinates to obtain the color parameters, normal parameters, and roughness parameters of the first and second terrain materials.

[0103] The material parameter integration unit can be used to integrate the color parameters, normal parameters, and roughness parameters of the first and second terrain materials respectively through the material property establishment function to obtain the first and second terrain material properties.

[0104] In some exemplary embodiments of this disclosure, the grayscale channel sampling module 630 may include a grayscale sampling coordinate determination unit, which can be used to adjust parameters according to the two-dimensional vector corresponding to the world coordinates of the rendering point and multiple sets of different coordinate offsets to obtain multiple different grayscale sampling coordinates.

[0105] In some exemplary embodiments of this disclosure, the grayscale channel sampling module 630 may further include a red channel sampling unit, which can be used to sample the red channel of the sample grayscale image multiple times using grayscale sampling coordinates to obtain multiple grayscale image channel sampling values.

[0106] In some exemplary embodiments of this disclosure, the proportion parameter determination module 640 may include a terrain transition factor determination unit, which can be used to perform a weighted average of multiple grayscale image channel sample values ​​according to a preset weight parameter to obtain the terrain transition factor corresponding to the rendering point.

[0107] In some exemplary embodiments of this disclosure, the fusion material rendering module 650 may include a fusion terrain material attribute determination unit, which can be used to fuse the first terrain material attribute and the second terrain material attribute according to the proportion parameter through a material fusion function to obtain the fusion terrain material attribute.

[0108] The specific details of each module / unit in the terrain rendering device in the above game have been described in detail in the corresponding method implementation section, and will not be repeated here.

[0109] Figure 7 A schematic diagram of a computer system suitable for implementing embodiments of the present invention is shown.

[0110] It should be noted that, Figure 7 The computer system 700 of the illustrated electronic device is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0111] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0112] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0113] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.

[0114] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0116] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0117] It should be noted that although several modules for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.

[0118] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0119] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method of rendering a game landscape, characterized in that, include: Obtain the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points; The first and second terrain material textures are sampled using the texture map coordinates to obtain the first and second terrain material attributes. This includes: sampling the color map, normal map, and roughness map of the first and second terrain materials using the texture map coordinates to obtain the color parameters, normal parameters, and roughness parameters of the first and second terrain materials; and integrating the color parameters, normal parameters, and roughness parameters of the first and second terrain materials to obtain the first and second terrain material attributes. Based on the world coordinates of the rendering point, multiple different grayscale sampling coordinates are obtained, and the sample grayscale image is sampled multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sampling values. The sampled values ​​of multiple grayscale channels are weighted and averaged according to preset weight parameters to obtain the terrain transition factor corresponding to the rendering point, and the proportion parameter between the first terrain material and the second terrain material is determined according to the terrain transition factor and the proportion adjustment parameter. The blended terrain material attributes are obtained based on the first terrain material attribute, the second terrain material attribute, and the proportion parameter, and the terrain in the game is rendered based on the blended terrain material attributes corresponding to each rendering point.

2. The method of claim 1, wherein, The process of integrating the color parameters, normal parameters, and roughness parameters of the first and second terrain materials to obtain the attributes of the first and second terrain materials includes: The color parameters, normal parameters, and roughness parameters of the first and second terrain materials are integrated by establishing a function based on material properties to obtain the first and second terrain material properties.

3. The method of claim 1, wherein, The step of obtaining the corresponding texture map coordinates based on the world coordinates of the rendering point includes: Based on the values ​​of the red and green channels of the world coordinates of the rendering point, a two-dimensional vector corresponding to the world coordinates is obtained; The texture map coordinates corresponding to the world coordinates are obtained by multiplying the two-dimensional vector with the coordinate tuning constant.

4. The method of claim 3, wherein, The process of obtaining multiple different grayscale sampling coordinates based on the world coordinates of the rendering point includes: Based on the two-dimensional vector corresponding to the world coordinates of the rendering point and multiple sets of different coordinate offset adjustment parameters, multiple different grayscale sampling coordinates are obtained.

5. The method of claim 1, wherein, The process of sampling the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sample values ​​includes: The red channel of the sample grayscale image is sampled multiple times using the grayscale sampling coordinates to obtain multiple grayscale image channel sample values.

6. The method of claim 1, wherein, The step of obtaining the fused landform material attribute based on the first landform material attribute, the second landform material attribute, and the proportion parameter includes: The first landform material attribute and the second landform material attribute are fused according to the proportion parameter using the material fusion function to obtain the fused landform material attribute.

7. An apparatus for rendering a game terrain, characterized by include: The rendering coordinate acquisition module is used to acquire the world coordinates of each rendering point in the game, and obtain the corresponding texture map coordinates based on the world coordinates of the rendering points; The terrain material sampling module is used to sample the first terrain material map and the second terrain material map using the texture map coordinates to obtain the first terrain material attributes and the second terrain material attributes. This includes: sampling the color map, normal map, and roughness map of the first and second terrain materials using the texture map coordinates to obtain the color parameters, normal parameters, and roughness parameters of the first and second terrain materials; and integrating the color parameters, normal parameters, and roughness parameters of the first and second terrain materials to obtain the first terrain material attributes and the second terrain material attributes. The grayscale channel sampling module is used to obtain multiple different grayscale sampling coordinates based on the world coordinates of the rendering point, and to sample the sample grayscale image multiple times using the grayscale sampling coordinates to obtain multiple grayscale channel sampling values. The proportion parameter determination module is used to perform a weighted average of the sampled values ​​of multiple grayscale image channels according to a preset weight parameter to obtain the terrain transition factor corresponding to the rendering point, and to determine the proportion parameter between the first terrain material and the second terrain material according to the terrain transition factor and the proportion adjustment parameter. The blended material rendering module is used to obtain blended terrain material attributes based on the first terrain material attributes, the second terrain material attributes, and the proportion parameters, and to render the terrain in the game based on the blended terrain material attributes corresponding to each rendering point.

8. An electronic device, comprising: include: processor; as well as A memory for storing one or more programs, which, when executed by the processor, cause the processor to implement the method for rendering terrain in a game as described in any one of claims 1 to 6.

9. A computer readable medium having stored thereon a computer program, characterized in that When the program is executed by the processor, it implements the method for rendering game terrain as described in any one of claims 1 to 6.