Simulated planet generation method based on cube chartlet

By combining the simulated planet generation method of height cube map and ecological cube map, the problem of separation and processing of terrain and ecological information in traditional technology is solved, and the effect of efficient generation of complex terrain and rich ecological environment is achieved.

CN119455387APending Publication Date: 2025-02-18SNAIL GAMES
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411827157.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In traditional planet generation technology, the separation of terrain and ecological information leads to low generation efficiency and insufficient details and complexity.

Method used

A simulated planet generation method based on cube map is adopted to generate complex terrain and rich ecological environment by combining height cube maps and ecological cube maps. The method includes making original grayscale maps, establishing an ecological database, generating basic terrain and ecological environment, and rendering and visualizing them.

Benefits of technology

It improves the efficiency of planet resource generation and the expressiveness of ecological diversity, realizes the synchronous generation of terrain and ecological information, and improves the expressiveness of the detailed generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119455387A_ABST
    Figure CN119455387A_ABST
Patent Text Reader

Abstract

The invention provides a simulated planet generation method based on cube chartlets, which comprises the following steps of: making an original grey-scale map for describing the terrain height and ecological distribution of a planet, and preparing a height cube chartlet and an ecological cube chartlet; establishing an ecological database for storing different ecological assets; generating a basic planet terrain according to the height cube map; obtaining the ecological assets from the ecological database according to the mapping of the ecological cube map and the ecological assets; mixing the ecological assets on the planet terrain to generate a corresponding ecological environment; and rendering and visualizing the planet terrain and the ecological environment. By combining the cube mapping technology and utilizing the high cube mapping and the ecological cube mapping, the virtual planet containing the rich ecological environment and the complex terrain can be efficiently generated, and the generation efficiency of planet resources and the expressive force of ecological diversity are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of game development, and in particular to a method for generating a simulated planet based on a cube map. Background Art

[0002] In today's interstellar universe-themed game development, generating complex and realistic planetary terrain and ecological environment is an important requirement. Traditional terrain generation mostly relies on height information generated by noise functions, while the ecological environment is usually processed separately from terrain information, resulting in low resource generation efficiency and insufficient ecological diversity. Therefore, in order to improve the efficiency of asset generation and the expression of ecological diversity, it is of great significance to develop a generation method that can simultaneously process terrain and ecological information. Summary of the invention

[0003] In order to solve the defects of the prior art, the purpose of the present invention is to provide a simulated planet generation method based on cube maps, which generates complex terrain and rich ecological environment of the planet by combining height cube maps and ecological cube maps containing ecological information, thereby solving the problem of low generation efficiency and insufficient detail complexity caused by separate processing of terrain and ecological information in traditional planet generation.

[0004] In order to achieve the above object, the present invention provides a method for generating a simulated planet based on a cube map, comprising the following steps: Create an original grayscale image describing the planet's terrain height and ecological distribution, and prepare height cubemaps and ecological cubemaps; Establish an ecological database to store different ecological assets; Generate basic planet terrain according to the height cube map; Acquire ecological assets from the ecological database according to the mapping between the ecological cube map and ecological assets; Mixing the ecological assets on the planetary terrain to generate a corresponding ecological environment; The planetary terrain and the ecological environment are rendered and visualized.

[0005] Furthermore, the step of producing an original grayscale image describing the planetary terrain height and ecological distribution, and preparing a height cubemap and an ecological cubemap, further comprises: Create multiple original grayscale images describing the planet's terrain height and ecological distribution; A height cube map is formed by the original grayscale images of the terrain height of the six faces, which is used to represent the terrain undulations of the planet; The original grayscale images of the ecological distribution of the six faces are baked to obtain an ecological cube map; each pixel of the ecological cube map contains three ecological IDs and their respective weights, and each ecological ID is mapped to a corresponding ecological asset.

[0006] Furthermore, the original grayscale images of the six faces describing the height of the planet terrain are produced by art, and used as the input of the height cube map, thereby obtaining the height cube map; The original grayscale images of the six surfaces describing the ecological distribution of the planet are produced through art, wherein the number and type of the original grayscale images of each surface are at least one, and the size of each original grayscale image is consistent.

[0007] Furthermore, the step of baking the original grayscale images of the ecological distribution of the six faces to obtain the ecological cube map further includes: baking and compressing the original grayscale images of the ecological distribution, wherein: During the baking process, each pixel is sorted according to the grayscale values ​​of different ecological types in the covered area, and the three ecological types with the largest weights are taken out. Each pixel stores the IDs of the three ecological types and their corresponding grayscale values; During the compression process, the weights corresponding to the three ecological types are weighted averaged, and the weight record of one of the ecological types is omitted.

[0008] Furthermore, the ecological assets include: Ecological ID: Different ecological assets have unique ecological IDs; Vegetation information, including: trees, grass, shrubs; Surface materials, including soil, sand, rock, and snow; Types of creatures, including crawling monsters and flying creatures; Buildings, including: houses, caves, temples.

[0009] Furthermore, the step of generating a basic planet terrain according to the height cube map further includes: using sphere-to-cube mapping to map the coordinates of a sphere surface in three-dimensional space into UV values ​​of a certain face in the cube map, and using the UV values ​​to generate three-dimensional terrain by bilinearly sampling the grayscale values ​​on the original grayscale map of the terrain height.

[0010] Furthermore, the step of acquiring ecological assets from the ecological database according to the mapping between the ecological cube map and the ecological assets further comprises: Sampling the ecocubemap, during which sphere-to-cube mapping is used to map the coordinates of a sphere surface in three-dimensional space to UV values ​​of a face in the cubemap; Use bilinear interpolation based on ecological information to sample pixels at any point, obtain multiple ecological IDs and corresponding weight values, sort the multiple ecological IDs according to the weight values, and select the three ecological IDs corresponding to the largest weight values; According to the selected ecological ID, the corresponding ecological assets are extracted from the ecological database.

[0011] Furthermore, the step of mixing the ecological assets on the planetary terrain to generate a corresponding ecological environment further includes: The obtained ecological assets are mixed and arranged according to the three ecological IDs corresponding to each pixel in the ecological cube map and the corresponding weights.

[0012] Further, including: mixing of surface materials, wherein each position is composed of at most three ecosystems, and the surface position corresponding to each screen pixel will use at most three different materials to mix according to their respective weights; The placement of vegetation, organisms, and buildings is done by randomly scattering them on the surface of the planet. After the positions are randomly selected, the three ecological IDs and weights in the ecological assets are obtained through the ecological cube map, and the weights are used as probability to randomly select one of the three ecological IDs. The vegetation, organisms, and buildings in the ecological assets corresponding to the selected ecological ID are selected and placed on the surface of the planet.

[0013] Furthermore, a graphics rendering engine is used to visualize the generated planetary terrain and the ecological environment on the planetary terrain.

[0014] The method for generating a simulated planet based on a cubemap provided by the present invention has the following beneficial effects compared with the prior art: By using height cubemaps and ecological cubemaps, virtual planets with rich ecological environments and complex terrains can be efficiently generated, which improves the generation efficiency of planetary resources and the expression of ecological diversity.

[0015] Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 The figure is a flow chart of a method for generating a simulated planet based on a cube map according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0018] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0019] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0020] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more". "Plurality" should be understood as two or more.

[0021] In an embodiment of the present invention, a method for generating a simulated planet based on a cube map is provided, comprising: producing an original grayscale image describing the height of the planetary terrain and the ecological distribution, and preparing a height cube map and an ecological cube map; establishing an ecological database for storing different ecological assets; generating basic planetary terrain according to the height cube map; acquiring ecological assets from the ecological database according to the mapping of the ecological cube map and the ecological assets; mixing the ecological assets on the planetary terrain to generate a corresponding ecological environment; and rendering and visualizing the planetary terrain and the ecological environment.

[0022] In this paper, Cubemap is a cube mapping technology that uses UV as texture coordinate value and is usually used for panoramic rendering, environment mapping, etc. The present invention applies Cubemap technology to the generation of planetary surface terrain and ecological distribution system, which can effectively improve the generation efficiency of complex planetary scenes and reduce calculation costs.

[0023] Figure 1 The flowchart of the method for generating a simulated planet based on a cube map according to an embodiment of the present invention is as follows. Figure 1 Embodiments of the present invention are described in detail.

[0024] First, in step 101, original grayscale images describing the terrain height and ecological distribution of the planet are respectively produced.

[0025] In an embodiment of the present invention, two types of Cubemaps are used to describe the surface information of the planet, including: Height Cubemap: A cubemap composed of the original grayscale images of the height of the six faces of the planet. Each face is a grayscale image designed and produced by an artist, and the grayscale value of each position represents the height of that position. The height Cubemap is used to represent the terrain undulations of the planet and generate terrain such as mountains, canyons, plains, etc. Ecological Cubemap: Each face is baked offline from the original grayscale images of various ecological distributions produced by artists. Each pixel of the ecological Cubemap contains three ecological IDs and their respective weights. Each ecological ID is mapped to a specific ecological asset, and each ecological asset includes information such as vegetation, surface materials, organisms, buildings, or other game-related units.

[0026] Specifically, in this step, six original grayscale images of the six faces describing the height of the planet's terrain are produced by art, and they are used as the input of the height Cubemap. Similarly, six original grayscale images of the six faces describing the ecological distribution of the planet are produced by art. The number and type of original grayscale images of each face can be different (at least one number and at least one type). The number of original grayscale images of the six faces are defined as N1, N2, N3, N4, N5, and N6 respectively. The size of each original grayscale image needs to be consistent, for example, all are 4096×4096 pixels.

[0027] In step 102, the original grayscale image of the ecological distribution is baked and compressed to generate an ecological Cubemap.

[0028] First, bake the original grayscale image offline to get the ecological map asset: a single ecological map asset is made by baking offline based on the original grayscale images of various ecological distributions produced by the artist. For example, there may be 5 types of ecology distributed on a certain surface, so the artist needs to make 5 corresponding original grayscale images of the corresponding ecological distribution. During the baking process, each pixel is sorted according to the size of the grayscale value of the different ecological types in the covered area, and the three ecological types with the largest weights are taken out. Each pixel saves the IDs of these three ecology and their corresponding grayscale values.

[0029] Furthermore, the ecological map assets are compressed: the weights corresponding to the three ecosystems are weighted averaged, which can save the record of one ecological weight. The type of ecological ID and the type of weight corresponding to each ecosystem are both single-byte, so the size of each pixel is only 5 bytes.

[0030] In an embodiment of the present invention, N original grayscale images of ecological distribution of each surface are baked and compressed offline, and six different ecological map assets are finally generated. Taking a single ecological map asset as an example, there may be N kinds of ecology distributed on a certain surface, so the artist needs to prepare the corresponding N original grayscale images of the corresponding ecology. The pixel value of the xth row and yth column on the original grayscale image of the nth ecological distribution (n belongs to 1 to N) is recorded as Pixel(n, x, y). The result of baking is to obtain an ecological map asset of the same size as the original grayscale image. Each pixel on the ecological map asset consists of the following information: 3 ecological IDs, and the weights between the three ecosystems. Then we count the information on the ecological map asset in the xth row and yth column as IDA(x,y), IDB(x,y), IDC(x,y), AlphaA(x,y), AlphaB(x,y), AlphaC(x,y).

[0031] Specifically, during the baking process, for any pixel (x, y), find the pixel value of the original grayscale image of the n ecological distribution at the pixel, that is, Pixel(1, x, y), Pixel(2, x, y)... Pixel(n, x, y), form an array of length N, and sort them, so as to take out the three values ​​with the largest values, record them as AlphaA(x, y), AlphaB(x, y), AlphaC(x, y), and record the ecological IDs on the ecological map assets represented by these three values ​​as IDA(x, y), IDB(x, y), IDC(x, y). After the baking is completed, a simple compression operation is performed to weighted average the three values ​​of AlphaA(x, y), AlphaB(x, y), and AlphaC(x, y) to save the record of one value. After having the ecological Cubemap, it is necessary to prepare the ecological assets corresponding to each ecological ID.

[0032] In step 103, an ecological database is constructed.

[0033] In the embodiment of the present invention, an ecological database is established to store different ecological assets. Specifically, the ecological database is prepared by the artist, and the ecological database consists of multiple ecological assets, each of which has its own unique ID, which is used to map with the ID recorded in the ecological Cubemap. In addition, the ecological assets also include their own vegetation library, surface material library, biological library and building library, all of which are provided by the artist.

[0034] Each ecological asset contains the following: Ecosystem ID: Different assets have unique ecosystem IDs; Vegetation information: such as trees, grass, shrubs, etc.; Surface material: such as soil, sand, rock, snow and other different materials; Biological types: such as crawling monsters, flying creatures, etc. Buildings: such as houses, caves, temples, etc.

[0035] In step 104, a basic planet terrain is generated according to the height Cubemap.

[0036] In an embodiment of the present invention, a sphere-to-cube mapping technique is used to map the coordinates of a sphere surface in three-dimensional space into UV values ​​of a certain face in a Cubemap, and the UV values ​​are used to bilinearly sample the grayscale values ​​on the original grayscale map of the terrain height to generate three-dimensional terrain, including different landforms such as mountains, canyons, and plains.

[0037] Specifically, the basic terrain undulations of the planet are generated according to the height Cubemap in step 101. First, a sphere is made based on an original radius R. Further, the sphere-to-cube mapping technology is used to map the coordinates of a sphere surface in three-dimensional space into the UV value of a certain face in the Cubemap, and the UV value is used to sample the gray value on the height Cubemap through bilinear sampling, and the terrain is offset on the basic radius R using this value, and finally the terrain of the planet is generated, including different landforms such as mountains, canyons, and plains.

[0038] In step 105, the mapping between the ecological Cubemap and the ecological assets is parsed, and the corresponding ecological assets are obtained from the ecological database.

[0039] In the embodiment of the present invention, when sampling the ecological Cubemap, the sphere-to-cube mapping technology is also used to map the coordinates of a sphere surface in three-dimensional space into the UV value of a certain face in the Cubemap.

[0040] Use special bilinear interpolation sampling based on ecological information: sample the pixels at (uv) point to get three sets of ecological IDs, represented by BiomeIdA, BiomeIdB, and BiomeIdC, and the corresponding three weight values, represented by AlphaA, AlphaB, and AlphaC. Continue sampling pixels at (u+1, v), (u, v+1), and (u+1, v+1) to get the other three sets of ecological information, a total of up to 12 ecological IDs and corresponding weight values. Sort these up to 12 different ecological IDs according to weight, and take out the three corresponding ecological IDs with the largest weights. Because each ecological asset is identified by a unique ID, these IDs can be used to extract the corresponding ecological assets from the ecological database.

[0041] For example, special bilinear interpolation based on ecological information is used to sample the ecological Cubemap and restore the ecological information of the entire planet. When sampling the ecological Cubemap, the sphere-to-cube mapping technology is used to map the coordinates of a sphere surface in three-dimensional space to the UV value of a certain face in the Cubemap. Among them, the special bilinear interpolation sampling based on ecological information includes: sampling the pixels of the (uv) point, obtaining IDA(u,v), IDB(u,v), IDC(u,v), AlphaA(u,v), AlphaB(u,v), AlphaC(u,v) = 1 - AlphaA(u,v) - AlphaB(u,v).

[0042] In step 106, the ecological assets are blended onto the planet terrain to generate an ecological environment.

[0043] In an embodiment of the present invention, after obtaining the ecological asset information of the planetary plot in step 105, this step will mix and arrange the terrain materials, vegetation, organisms, buildings, etc. in the ecological assets according to the three ecological IDs corresponding to each pixel in the ecological Cubemap and their respective weights.

[0044] In this step, for the mixing of surface materials: each position is composed of at most three ecosystems, so the surface position corresponding to each screen pixel will use at most three different materials to mix according to their respective weights; For the placement of vegetation and other units, take the placement of vegetation as an example: randomly scatter points on the surface of the planet to place vegetation. After randomly selecting a location, you can get the three ecological IDs and weights in the ecological assets through the ecological Cubemap. Use the weight as a probability to randomly select one of the three ecological IDs, and then select the vegetation from the ecological assets corresponding to the selected ecological ID and place it on the surface of the planet.

[0045] In step 107, the generated planetary terrain and ecological environment are rendered and visualized. This step uses a graphics rendering engine to visualize the generated planetary terrain and various ecosystems on the planetary terrain. Combined with Cubemap technology, users can view different sides of the planet in a panoramic view and make real-time adjustments and optimizations as needed.

[0046] In the embodiment of the present invention, the Cubemap technology is combined to render the entire planet with information from six faces, thus achieving a high-quality panoramic view of the planet. Users can interactively adjust parameters to view the ecosystem and terrain details of the planet in real time, and modify the ecosystem database and generation rules when necessary.

[0047] The cubemap-based simulated planet generation method provided by the present invention can efficiently generate a virtual planet containing a rich ecological environment and complex terrain by using a height Cubemap and an ecological Cubemap. The method improves the efficiency of planet resource generation, reduces computational complexity, and can achieve synchronous generation of ecology and terrain. By baking the ecological grayscale map offline and compressing it into a format that can be used for real-time rendering, the detail expression of the ecological environment is greatly improved. The present invention is suitable for application scenarios such as games, virtual reality, and scientific research simulation.

[0048] Those skilled in the art can understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating a simulated planet based on a cube map, characterized in that: The following steps are involved: Create an original grayscale image describing the planet's terrain height and ecological distribution, and prepare height cubemaps and ecological cubemaps; Establish an ecological database to store different ecological assets; Generate basic planet terrain according to the height cube map; Acquire ecological assets from the ecological database according to the mapping between the ecological cube map and ecological assets; Mixing the ecological assets on the planetary terrain to generate a corresponding ecological environment; The planetary terrain and the ecological environment are rendered and visualized.

2. The method for generating a simulated planet based on a cubemap according to claim 1, characterized in that: The step of producing an original grayscale image describing the planet terrain height and ecological distribution, and preparing a height cube map and an ecological cube map, further comprises: Create multiple original grayscale images describing the planet's terrain height and ecological distribution; A height cube map is formed by the original grayscale images of the terrain height of the six faces, which is used to represent the terrain undulations of the planet; The original grayscale images of the ecological distribution of the six faces are baked to obtain an ecological cube map; each pixel of the ecological cube map contains three ecological IDs and their respective weights, and each ecological ID is mapped to a corresponding ecological asset.

3. The method for generating a simulated planet based on a cube map according to claim 2, characterized in that: The height cubemap is obtained by creating the original grayscale images of the six faces describing the height of the planet's terrain through art, and using them as the input of the height cubemap; The original grayscale images of the six surfaces describing the ecological distribution of the planet are produced through art, wherein the number and type of the original grayscale images of each surface are at least one, and the size of each original grayscale image is consistent.

4. The method for generating a simulated planet based on a cube map according to claim 2, characterized in that: The step of baking the original grayscale images of the ecological distribution of the six faces to obtain the ecological cube map further includes: baking and compressing the original grayscale images of the ecological distribution, wherein: During the baking process, each pixel is sorted according to the grayscale values ​​of different ecological types in the covered area, and the three ecological types with the largest weights are taken out. Each pixel stores the IDs of the three ecological types and their corresponding grayscale values; During the compression process, the weights corresponding to the three ecological types are weighted averaged, and the weight record of one of the ecological types is omitted.

5. The method for generating a simulated planet based on a cube map according to claim 1, characterized in that: The ecological assets include: Ecological ID: Different ecological assets have unique ecological IDs; Vegetation information, including: trees, grass, shrubs; Surface materials, including soil, sand, rock, and snow; Types of creatures, including crawling monsters and flying creatures; Buildings, including: houses, caves, temples.

6. The method for generating a simulated planet based on a cube map according to claim 1, characterized in that: The step of generating a basic planet terrain according to the height cube map further includes: using sphere-to-cube mapping to map the coordinates of a sphere surface in three-dimensional space into UV values ​​of a certain face in the cube map, and using the UV values ​​to generate three-dimensional terrain by bilinearly sampling the grayscale values ​​on the original grayscale map of the terrain height.

7. The method for generating a simulated planet based on a cube map according to claim 1, characterized in that: The step of acquiring ecological assets from the ecological database according to the mapping between the ecological cube map and the ecological assets further comprises: Sampling the ecocubemap, during which sphere-to-cube mapping is used to map the coordinates of a sphere surface in three-dimensional space to UV values ​​of a face in the cubemap; Use bilinear interpolation based on ecological information to sample pixels at any point, obtain multiple ecological IDs and corresponding weight values, sort the multiple ecological IDs according to the weight values, and select the three ecological IDs corresponding to the largest weight values; According to the selected ecological ID, the corresponding ecological assets are extracted from the ecological database.

8. The method for generating a simulated planet based on a cube map according to claim 1, characterized in that: The step of mixing the ecological assets on the planetary terrain to generate a corresponding ecological environment further includes: The obtained ecological assets are mixed and arranged according to the three ecological IDs corresponding to each pixel in the ecological cube map and the corresponding weights.

9. The method for generating a simulated planet based on a cube map according to claim 8, characterized in that: include: A blend of surface materials, where each location is composed of up to three ecosystems, and each screen pixel corresponds to a surface location that uses up to three different materials blended according to their respective weights; The placement of vegetation, organisms, and buildings is done by randomly scattering them on the surface of the planet. After the positions are randomly selected, the three ecological IDs and weights in the ecological assets are obtained through the ecological cube map, and the weights are used as probability to randomly select one of the three ecological IDs. The vegetation, organisms, and buildings in the ecological assets corresponding to the selected ecological ID are selected and placed on the surface of the planet.

10. The method for generating a simulated planet based on a cube map according to claim 1, characterized in that: A graphics rendering engine is used to visualize the generated planetary terrain and the ecological environment on the planetary terrain.

Citation Information

Cited By

  • Planet generation method and system based on spherical display equipment

    CN121053276A