Volume fog generation method and device, electronic equipment and computer readable storage medium

CN116310049BActive Publication Date: 2026-08-18NETEASE INTERACTIVE ENTERTAINMENT PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211698697.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2026-08-18
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

[0003]在现有常见的体积雾制作方法中,通常是基于将体积雾材质添加至由网格和/或多边形组成的不规则网格群实现,数量过多的网格将会造成GPU(GraphicsProcessingUnit,图形处理器)的性能消耗,不利于高效运用在开放世界大地图中

Benefits of technology

[0018] In this embodiment of the invention, the cloud modeled based on volumetric rendering, i.e., the volumetric cloud, is segmented to obtain a volume density map and a normal map for the volumetric cloud. Then, the planar map of the volumetric cloud is converted into a volumetric map, and volumetric fog is generated based on the converted volumetric map. By converting the planar map of the volumetric cloud into a volumetric map, the volume of the volumetric cloud is recalculated. The volumetric fog effect is calculated during the conversion process, avoiding the problem of excessive graphics processor performance consumption caused by the excessive use of irregular mesh clusters in volumetric fog generation. This achieves the effect of improving the visual expressiveness of volumetric fog with low power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310049B_ABST
    Figure CN116310049B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a volume fog generation method and device, electronic equipment and computer readable storage medium, the method comprises: obtaining a volume cloud, the volume cloud is obtained based on volume rendering modeling cloud; the volume cloud is cut to obtain the planar map for the volume cloud; the planar map of the volume cloud is converted into the volume map for the volume cloud according to the volume density map and the normal map; the volume fog is generated based on the volume map of the volume cloud. The planar map of the volume cloud is converted into the volume map, so as to recalculate the volume of the volume map of the volume cloud, the volume fog effect is calculated in the process of converting into the volume map, the problem that the performance consumption of the graphic processor is too large due to the excessive use of the volume fog generation mode of irregular grid cluster is avoided, and the effect that the visual performance of the volume fog is improved on the basis of low consumption is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rendering technology, and in particular to a volumetric fog generation method, a volumetric fog generation device, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Technology

[0002] Modern AAA games increasingly rely on lighting and environmental effects, leading to a rise in the use of dynamic volumetric fog as hardware performance improves. To meet specific artistic requirements, many scenes employ placement-based volumetric fog to achieve desired visual effects.

[0003] In existing common methods for creating volumetric fog, it is usually achieved by adding volumetric fog material to an irregular mesh group composed of grids and / or polygons. Too many grids will cause performance consumption of GPU (Graphics Processing Unit), which is not conducive to efficient use in open-world maps. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a volumetric fog generation method, a volumetric fog generation apparatus, a corresponding electronic device, and a corresponding computer-readable storage medium to overcome or at least partially solve the above problems.

[0005] This invention discloses a method for generating volumetric fog, the method comprising:

[0006] Obtain a volumetric cloud, which is a cloud obtained based on volumetric rendering modeling;

[0007] The volumetric cloud is segmented to obtain a planar texture map for the volumetric cloud; the planar texture map includes at least a volume density map and a normal map for the volumetric cloud.

[0008] Based on the volume density map and the normal map, the planar map of the volume cloud is converted into a volume map specific to the volume cloud;

[0009] Volumetric fog is generated based on the volumetric map of the volumetric cloud.

[0010] This invention also discloses a volumetric fog generating device, the device comprising:

[0011] The volumetric cloud acquisition module is used to acquire a volumetric cloud, which is a cloud obtained based on volumetric rendering modeling.

[0012] A planar texture acquisition module is used to cut the volumetric cloud to obtain a planar texture for the volumetric cloud; the planar texture includes at least a volume density texture and a normal texture for the volumetric cloud;

[0013] A volume map conversion module is used to convert a planar map of the volume cloud into a volume map specific to the volume cloud based on the volume density map and the normal map.

[0014] A volumetric fog generation module is used to generate volumetric fog based on the volumetric texture of the volumetric cloud.

[0015] This invention also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements any of the volumetric fog generation methods described above.

[0016] This invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the volumetric fog generation methods described above.

[0017] The embodiments of the present invention have the following advantages:

[0018] In this embodiment of the invention, the cloud modeled based on volumetric rendering, i.e., the volumetric cloud, is segmented to obtain a volume density map and a normal map for the volumetric cloud. Then, the planar map of the volumetric cloud is converted into a volumetric map, and volumetric fog is generated based on the converted volumetric map. By converting the planar map of the volumetric cloud into a volumetric map, the volume of the volumetric cloud is recalculated. The volumetric fog effect is calculated during the conversion process, avoiding the problem of excessive graphics processor performance consumption caused by the excessive use of irregular mesh clusters in volumetric fog generation. This achieves the effect of improving the visual expressiveness of volumetric fog with low power consumption. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of irregular mesh groups created in related technologies;

[0020] Figure 2 This is a flowchart illustrating the steps of an embodiment of the volumetric fog generation method of the present invention;

[0021] Figure 3 This is a schematic diagram of the volumetric fog generation process provided in an embodiment of the present invention;

[0022] Figures 4A to 4B This is a schematic diagram of the volumetric cloud fabrication process provided in an embodiment of the present invention;

[0023] Figure 5 This is a schematic diagram of the volume mapping provided in an embodiment of the present invention;

[0024] Figure 6This is a flowchart illustrating the steps of another embodiment of the volumetric fog generation method of the present invention;

[0025] Figures 7A to 7I This is a schematic diagram illustrating the process of baking to generate a planar texture for volumetric clouds, as provided in an embodiment of the present invention.

[0026] Figure 8 This is a schematic diagram of the custom normals added in an embodiment of the present invention;

[0027] Figures 9A to 9G This is a schematic diagram of the process of generating volumetric fog of the target model body shape provided in an embodiment of the present invention;

[0028] Figures 10A to 10C This is a schematic diagram illustrating an application scenario of volumetric fog representing the shape of a target modeling body, as provided in an embodiment of the present invention.

[0029] Figure 11 This is a structural block diagram of an embodiment of a volumetric fog generating device according to the present invention. Detailed Implementation

[0030] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0031] To facilitate understanding of the present invention by those skilled in the art, the terms or nouns involved in the following embodiments of the present invention are explained below:

[0032] VolumetricFog: refers to the volumetric fog feature supported by Unreal Engine version 4.16 and later.

[0033] ExponentialHeightFog: refers to numerical height fog.

[0034] Cascade: The previous generation particle effects system in Unreal Engine.

[0035] Niagara: The primary tool for creating and adjusting next-generation visual effects (VFX) in Unreal Engine.

[0036] UE: Unreal Engine.

[0037] Houdini refers to the 3D graphics software of SideEffects Software, which is a type of procedural modeling software.

[0038] CustomShader: Custom materials for HLSL, where HLSL (HighLevel Shader Language) is a high-level shader language, meaning that shaders are written using low-level shader assembly language.

[0039] Triangles: Triangles are one of the performance consumption parameters of statistical grids.

[0040] VOP: VectorOperationLanguage, a visual programming language provided by Houdini.

[0041] To meet specific artistic requirements, many scenes use placement-type volumetric fog to achieve the desired expressive effect.

[0042] In existing common methods for creating volumetric fog, the common approach involves editing a spherical volumetric material, attaching the edited material to a spherical mesh, and then using a particle system to create random, irregular shapes to achieve an aesthetically pleasing volumetric fog effect. Alternatively, a masked volumetric material, i.e., a volumetric fog material, can be created to produce an irregular static mesh to achieve volumetric fog. In practical applications, this can be achieved using Cascade, Niagara, or static meshes, as well as... Figure 1 The irregular mesh group shown is then used to create a volumetric fog material, which is then added to the irregular mesh group to obtain a placement-type volumetric fog. This makes it easier to add the created placement-type volumetric fog to the level to achieve the desired visual effect.

[0043] Most techniques for creating volumetric fog are based on adding volumetric fog materials to irregular mesh groups composed of grids and / or polygons. While this approach produces a good final visual effect, the presence of irregular mesh groups means that checking the polygon count may reveal tens of thousands of triangles (e.g., 67,606 triangles). Furthermore, after converting the rendered image to a semi-transparent form, severe overlap is observed. Since triangles can be used as a performance parameter for mesh calculations, an excessive number of meshes and severe overlap will significantly increase GPU performance, leading to high production costs and hindering efficient application in open-world maps.

[0044] To address performance issues while simultaneously enhancing the visual appeal of volumetric fog with low resource consumption, the core idea of ​​this invention is to avoid using a technique that adds volumetric fog materials to irregular mesh groups composed of grids and / or polygons. Instead, it deconstructs the fundamental principles of volumetric fog by converting the planar texture of a volumetric cloud into a volumetric texture. The volume of this volumetric cloud texture is then recalculated to obtain the volumetric fog effect during the conversion process. This lightweight rendering method produces volumetric fog, optimizing performance while maintaining visual quality, thus enhancing the visual appeal of volumetric fog with low resource consumption. Furthermore, customized normal calculations can simulate realistic lighting. Based on the added custom normals, a simulated light source is used to calculate the simulated lighting, further improving the visual quality of the generated volumetric fog with low resource consumption. This method can be practically applied to project development.

[0045] Reference Figure 2 The diagram illustrates a flowchart of an embodiment of a volumetric fog generation method according to the present invention, which may specifically include the following steps:

[0046] Step 201: Obtain the volumetric cloud, which is a cloud obtained based on volumetric rendering modeling;

[0047] Volumetric fog primarily refers to the effect of various densities and arbitrary numbers of light sources on a medium by calculating the density and illumination of the medium (such as fog) at each point of the camera's view frustum in a virtual environment.

[0048] In this embodiment of the invention, since the number of triangles in the irregular mesh group is used as a performance consumption parameter of the statistical mesh, in order to reduce the performance consumption caused by too many triangles and avoid excessive overlap of semi-transparency, this embodiment of the invention does not adopt the technical solution of adding volumetric fog material to the irregular mesh group composed of mesh and / or polygons to generate volumetric fog. Instead, it deconstructs the principle of volumetric fog itself, converts the planar texture (i.e., 2D texture) of the volumetric cloud into a volumetric texture (i.e., 3D texture), and recalculates the volume of the volumetric cloud's volumetric texture so that the volumetric fog effect can be calculated during the conversion to a volumetric texture.

[0049] Specifically, refer to Figure 3 The diagram illustrates the process of generating volumetric fog according to an embodiment of the present invention, which mainly involves cutting volumetric clouds to obtain planar textures, and converting planar textures into volumetric textures.

[0050] In one embodiment of the present invention, a volumetric cloud can first be created / generated. The created / generated volumetric cloud can be a cloud based on volumetric rendering modeling, so as to provide textures with 3D volumetric information for the subsequently generated volumetric fog. Its generation can be achieved using procedural modeling software, such as Houdini, etc., specifically as follows... Figures 4A to 4B As shown, this can be achieved by manually customizing the placement of stylized meshes to fix the corresponding shape, such as a cloud shape. Then, by using nodes related to the cloud to be rendered and modeled, such as nodes containing "Cloud" and "CloudNoise", the placed mesh can be converted into a volumetric rendering, generating a volumetric cloud shape.

[0051] It should be noted that the volume used to cut and obtain the planar texture in the embodiments of the present invention can also be any other object rendered based on volume rendering, which can be in any form. In the embodiments of the present invention, a volume cloud is used as an example for subsequent cutting and conversion. However, the embodiments of the present invention do not impose any limitations on this.

[0052] Step 202: Cut the volumetric cloud to obtain a planar texture for the volumetric cloud;

[0053] Volumetric fog is typically generated by rendering 3D volumetric information. To obtain 3D volumetric information, a volumetric object with 3D volumetric information, such as a volumetric cloud, can be segmented.

[0054] Since each spatial component of a volumetric cloud is three-dimensional, the 3D volume information obtained after segmenting the volumetric cloud can typically reflect the spatial information of the rendered volume, including at least volume density and normal information. Therefore, the 3D volume information of the volumetric cloud can be acquired based on a planar texture map. This planar texture map can at least include a volume density map and a normal map for the volumetric cloud.

[0055] It should be noted that volume cloud density information refers to the mass per unit volume when the volume cloud is in its natural state, while normal information refers to the dashed line perpendicular to a plane in this spatial part. Both volume cloud density information and normal information can be helpful when converting volume maps in the future.

[0056] Step 203: Based on the volume density map and normal map, convert the planar map of the volumetric cloud into a volumetric map specific to the volumetric cloud.

[0057] After obtaining the volume density map carrying volume cloud density information and the normal map carrying normal information, the planar map (i.e., 2D map) of the volume cloud can be converted into a volume map (i.e., 3D map) to reproduce the entire volume of the original 3D model based on the volume map.

[0058] Specifically, a volumetric map can refer to a special asset that uses and stores 3D volume information in a 2D map. In this embodiment of the invention, it can specifically be manifested as a resource that uses and stores volumetric cloud density information and normal information for volumetric clouds in a 2D map.

[0059] like Figure 5 As shown, assuming there is a certain 3D shape, such as a 32*32*32 solid voxel, this 3D shape can be cut into cross-sections that can be placed on a 2D texture mesh. When converting to volume-based texture, these cross-sections can be reconstructed on the 2D texture based on the stored 3D volume information, so that the 2D texture can reproduce the entire volume of the original 3D model.

[0060] In one embodiment of the present invention, the volume cloud density information carried by the volume density map and the normal information carried by the normal map can be used to convert the planar map of the volume cloud into a volume map for the volume cloud on the 2D texture mesh, so as to reproduce the entire volume of the volume cloud.

[0061] Step 204: Generate volumetric fog based on the volumetric map of the volumetric cloud.

[0062] After obtaining a volume map for the volume cloud containing the volume cloud density information and normal information, the generated volume map can be used to maintain a unique shape when creating 3D processing such as volume fog. When rendering the volume fog effect on the target model, it can be generated based on the volume map of the volume cloud, that is, the volume fog of the target model shape can be generated based on the converted volume map.

[0063] Specifically, for the target model, the 3D texture of the volumetric cloud can be input into the UE to recalculate the volume to generate a volumetric fog that conforms to the shape of the target model. The volumetric fog is created based on a more lightweight rendering method, which optimizes performance while taking into account the visual performance.

[0064] In a preferred embodiment, to improve the visual quality of the generated volumetric fog while maintaining low power consumption, realistic lighting can be simulated through customized normal calculations. Specifically, light sources can be simulated based on the added custom normals, and lighting can be simulated and calculated using a CustomShader to add the effects of any number of light sources to the generated volumetric fog. This embodiment of the invention does not limit the specific implementation method.

[0065] In this embodiment of the invention, the cloud obtained based on volumetric rendering modeling, i.e., the volumetric cloud, is segmented to obtain a volume density map and a normal map for the volumetric cloud. Then, the planar map of the volumetric cloud is converted into a volume map, and volumetric fog is generated based on the converted volume map. By converting the planar map of the volumetric cloud into a volume map, the volume of the volumetric cloud is recalculated. The volumetric fog effect is calculated during the conversion process, avoiding the problem of excessive graphics processor performance consumption caused by the excessive use of irregular mesh clusters in volumetric fog generation. This achieves the effect of improving the visual expressiveness of volumetric fog with low power consumption.

[0066] Reference Figure 6 The flowchart illustrates another embodiment of the volumetric fog generation method of the present invention, which may specifically include the following steps:

[0067] Step 601: Cut the modeling cloud of volume rendering by at least one slice, and obtain the volume cloud density information and normal information of the corresponding spatial part of the volume cloud based on each slice.

[0068] In this embodiment of the invention, since the number of triangles in the irregular mesh group is used as a performance consumption parameter of the statistical mesh, in order to reduce the performance consumption caused by too many triangles and avoid excessive overlap of semi-transparency, this embodiment of the invention does not adopt the technical solution of adding volumetric fog material to the irregular mesh group composed of mesh and / or polygons to generate volumetric fog. Instead, it deconstructs the principle of volumetric fog itself, converts the planar texture (i.e., 2D texture) of the volumetric cloud into a volumetric texture (i.e., 3D texture), and recalculates the volume of the volumetric cloud's volumetric texture so that the volumetric fog effect can be calculated during the conversion to a volumetric texture.

[0069] First, a volumetric cloud can be created / generated. The created / generated volumetric cloud can be a modeling cloud based on volumetric rendering, so as to provide textures with 3D volumetric information for the volumetric fog to be generated later. Then, in order to cut the volumetric cloud to obtain 3D volumetric information, a slice group can be generated. The generated slice group can include at least one slice, so as to cut the volume body, such as the volumetric cloud, that needs to be extracted with 3D volumetric information through at least one slice contained in the slice group.

[0070] Specifically, the generated slice group may include at least one slice, and 3D volume information of the spatial portion of the volume cloud can be extracted based on each generated slice.

[0071] like Figure 7AAs shown, in order to encapsulate subsequent information, the facet group is usually a standard cube. Its specific generation method can be represented as follows: firstly, it can be generated using "matchsize" to... Figure 4A The volumetric cloud shown is standardized in size, and its volume x, y, z are compressed to their respective ranges of -0.5 to 0.5, forming a standard cube. Then, a cube map can be generated with the same dimensions (x, y, z) as the normalized volumetric cloud. Assuming the normalized volumetric cloud is converted to a plane, taking a 512*512 pixel cube map as an example, the segmentation of this cube map can generate 64 pixel * 64 pixel slices. A single cross-section, i.e., a slice, can be... Figure 7B As shown, based on a 512*512 pixel square texture, a total of 64 slices with dimensions of 8*8 pixels can be generated.

[0072] Each spatial component of the volumetric cloud is three-dimensional, and the 3D volume information it possesses for this spatial component includes volumetric cloud density information and normal information. Volumetric cloud density information refers to the mass per unit volume of the volumetric cloud in its natural state, while normal information refers to the dashed line perpendicular to a plane in this spatial component. Both volumetric cloud density information and normal information can be helpful in the subsequent conversion of volumetric maps.

[0073] In some embodiments of the present invention, the extraction of 3D volume information can be represented by storing the volume cloud density information and normal information of each slice in the corresponding spatial part of the volume cloud as the attributes of each slice itself, based on at least one vertex in each slice. The content presented by each slice can be the cross-sectional shape mapped by cutting based on the corresponding spatial part. The attributes of each slice can not only characterize its own related information, such as slice type, slice name, information text, slice size, etc., but also characterize the configuration information of the slice content. For example, regarding the presentation information of the slice content, for a cross-section used to subsequently reconstruct the original volume shape, the presentation information of that cross-section can include density information, normal information, etc.

[0074] For example, such as Figure 7B The single slice shown is assumed to be 64*64 pixels. Each slice can have 4096 vertices. Using the `ForEach` instruction, each of the 64 slices can be sampled frame by frame based on these 4096 vertices. The volume information of the closest part in space is stored in the slice's attributes (volume is usually a floating-point value between 0 and 1), and so on. Figure 7C As shown, the normal information of the corresponding spatial portion is also stored in its own properties, such as... Figure 7DAs shown, based on sampling of the entire volumetric cloud from all slices, the 3D volumetric information of the entire volumetric cloud is extracted so that the captured information can be baked into a 2D mesh texture and the volume can be recalculated in UE.

[0075] In practical applications, when storing volume information in the attributes of each slice, a bounding box for each slice can be generated based on each vertex of each slice, such as... Figure 7E As shown, this allows the volume cloud density information and normal information of the corresponding spatial portion of the volume cloud where the bounding box is located to be encapsulated using the bounding boxes of each slice.

[0076] It should be noted that the volume used to cut and obtain the planar texture in the embodiments of the present invention can also be any other object rendered based on volume rendering, which can be in any form. In the embodiments of the present invention, a volume cloud is used as an example for subsequent cutting and conversion. However, the embodiments of the present invention do not impose any limitations on this.

[0077] Step 602: Encapsulate the volume cloud density information and normal information of the corresponding spatial parts of each slice in the volume cloud to obtain the volume density map and normal map for the volume cloud.

[0078] Each slice within the slice group, obtained after slicing, can have its 3D volume information extracted for its spatial portion within the volumetric cloud, yielding at least one cross-section. These cross-sections, after baking based on the extracted 3D volume information, can be termed planar textures for the volumetric cloud. In other words, the number of planar textures for the volumetric cloud is the same as the number of slices used to cut the volumetric cloud.

[0079] For the baking operation of cross sections, in order to match the UV arrangement and achieve the baking of 2D mesh textures, it can be represented by scattering and rearranging the individual slices carrying attributes according to the rendering shaping strategy of planar textures. The rendering shaping strategy of planar textures refers to UV sorting. Specifically, during the rendering process of planar textures, using the (u,v) coordinates of the planar texture, when rendered to an object, adjacent textures are usually rendered adjacently to the object. However, in this embodiment of the invention, the slices obtained during the slicing process are cross-sectional cuts of different spatial parts of a volumetric volume, such as a volumetric cloud. If the adjacent cross-sections obtained according to the cutting order are directly UV sorted in this order during subsequent rendering shaping, the original shape of the volumetric cloud cannot be restored. Therefore, it is necessary to re-sort the individual slices with attributes according to the rendering shaping strategy, i.e., UV sorting, to ensure that the corresponding (u,v) coordinates of the rearranged slices conform to the UV sorting of the original shape of the volumetric cloud to be restored during subsequent rendering based on (u,v) coordinates.

[0080] like Figure 7F As shown, breaking up the slices can be understood as the reverse process of creating a slice group. For example, 64 slices arranged in depth can be combined in an 8*8 arrangement to form a 512*512 vertex square mesh. Then, the 3D volume information can be baked onto the 2D texture through VOP.

[0081] Specifically, since each spatial component of a volumetric cloud is three-dimensional, its 3D volume information for that spatial component includes volumetric cloud density information and normal information. Based on the baked cross-section, two types of maps can be generated: volumetric density maps and normal maps. The number of volumetric density maps and normal maps is the same as the number of slices used to cut the volumetric cloud. That is, the volumetric cloud density information for each spatial component can be stored based on the volumetric density maps, and the normal information for each spatial component can be stored based on the normal maps.

[0082] In other words, the volumetric cloud density information and normal information carried by each rearranged slice can be baked into a preset planar texture according to the rearranged order, so as to obtain a volumetric density texture carrying volumetric cloud density information and a normal texture carrying normal information.

[0083] For example, first create a blank 512 pixel * 512 pixel texture, then... Figure 7F The mesh shown is a 512-vertex x 512-vertex arrangement, as follows: Figure 7G As shown, the information of vertex 1 is assigned to pixel 1 in sequence, and the information of vertex 2 is assigned to pixel 2 in sequence. As long as the vertex arrangement and pixel arrangement match, the assignment can be performed sequentially, and then the following is generated: Figure 7H The volume density map shown and as Figure 7I The normal map shown.

[0084] Step 603: Based on the volume density map carrying volume cloud density information and the normal map carrying normal information, convert the planar map of the volume cloud into a volume map for the volume cloud.

[0085] After obtaining the volume density map carrying volume cloud density information and the normal map carrying normal information, the planar map (i.e., 2D map) of the volume cloud can be converted into a volume map (i.e., 3D map) to reproduce the entire volume of the original 3D model based on the volume map.

[0086] Here, volumetric mapping can refer to a special asset that uses and stores 3D volume information in a 2D texture. In this embodiment of the invention, it can specifically be manifested as a resource that uses and stores volumetric cloud density information and normal information for volumetric clouds in a 2D texture.

[0087] Specifically, in one embodiment of the present invention, the volume cloud density information carried by the volume density map and the normal information carried by the normal map can be used to convert the planar map of the volume cloud into a volume map of the volume cloud on the 2D texture mesh, so as to reproduce the entire volume of the modeled cloud based on volume rendering.

[0088] In practical applications, the UE's built-in function is usually used to manually set the minimum pixel size of the 2D texture (e.g., 64 pixels * 64 pixels), and then the corresponding 3D texture is obtained based on the recognition within the UE engine.

[0089] For the UE engine, it usually creates a VolumeShader and unfolds 3D textures using standard methods. Since volumetric textures add one dimension (x, y, z, i.e., world coordinates) to the UVs, that is, the texture is drawn in 3D space. At this time, the code "return Tex.SampleLevel(TexSampler,WPS,0).w;" can be executed to enable planar textures to use the UV matrix to draw pixels using the stored 3D volume information.

[0090] Specifically, the volume cloud density information can be used to mask the planar texture to obtain the masked planar texture. Then, the normal vectors for each vertex in the volume cloud can be obtained from the normal information. The normal vectors are used to perform normal rendering on the masked planar texture to restore the planar texture to the shape of the volume cloud, thus obtaining the volume map for the volume cloud.

[0091] In a preferred embodiment, to improve the visual quality of the generated volumetric fog while maintaining low power consumption, realistic lighting can be simulated through customized normal calculations. Specifically, light sources can be simulated based on the added custom normals, and lighting can be simulated and calculated using a CustomShader to add the effects of any number of light sources to the generated volumetric fog. This embodiment of the invention does not limit the specific implementation method.

[0092] Reference Figure 8This diagram illustrates the custom normal vector added according to an embodiment of the present invention. The normal vector can be obtained using the coordinates of a point and its neighbors. To obtain the normal vector of point P, one can calculate point P1 and point P2, which is slightly moved from point P in the direction of the tangent vector. From these points, two vectors, P1-P and P2-P, are obtained. The cross product of these vectors, (P2-P)*(P1-P), is then calculated to obtain the normal vector. It should be noted that since the coordinate system is left-handed, the normal vector obtained from the cross product... direction such as Figure 8 As shown (in the left-hand system, the direction of the vector obtained by the cross product is the same as in the right-hand system).

[0093] In practical applications, besides using baked normal maps, real-time normals can also be calculated using vector information connecting vertices. Assuming the acquired custom normal information can be used to represent the light source direction vector, since the normal is a vector information perpendicular to the plane tangent, and the light source direction is also a vector information, a new normal vector with light source simulation can be obtained by performing a dot product operation on the light source direction vector and the normal vector, that is, performing a dot product operation on the vector information of the two. This vector can be reflected in the volumetric cloud as positive when facing the light source, so that when using the normal vector with light source simulation to perform normal rendering on the masked planar texture, it can be illuminated in the image. In addition, it can also be multiplied with vector3 to simulate different colors of the light source.

[0094] It should be noted that after the vertex motion calculation of the target, the fixed normal map information may be incorrect. In order to correct the accuracy, the normal can be recalculated in real time. This recalculation of the normal is necessary to improve the accuracy of the performance. However, this is not required in the embodiments of the present invention.

[0095] Step 604: Generate volumetric fog of the target model body shape based on the volumetric map of the volumetric cloud.

[0096] After obtaining a volume map for the volume cloud containing the volume cloud density information and normal information, the generated volume map can be used to maintain a unique shape when creating 3D processing such as volume fog. When rendering the volume fog effect on the target model, it can be generated based on the volume map of the volume cloud, that is, the volume fog of the target model shape can be generated based on the converted volume map.

[0097] Specifically, for the target model, the 3D texture of the volumetric cloud can be input into the UE to recalculate the volume to generate a volumetric fog that conforms to the shape of the target model. The volumetric fog is created based on a more lightweight rendering method, which optimizes performance while taking into account the visual performance.

[0098] In practical applications, to generate a volumetric fog that can produce a specific shape for a target model, an initial volumetric fog can first be generated using a volumetric cloud texture. This initial volumetric fog can be a generalized volumetric fog, and the specific shape of the initial volumetric fog is not limited in this embodiment. Then, the splicing portion of the generated initial volumetric fog can be cut. For the cut surfaces of the splicing portion, a misalignment operation can be performed to obtain at least one spliced ​​body. The obtained spliced ​​body contains a mesh for connection in three-dimensional space. At this point, random points can be placed at the center of the spliced ​​body, and a mesh can be generated based on these random points. This allows for splicing operations based on the mesh already present in the spliced ​​body and the meshes generated within it, thereby generating a volumetric fog in the shape of the target model.

[0099] For example, such as Figures 9A to 9G As shown, taking the application process of volume mapping for the shape of a target model as an example, for such... Figure 9A The shape shown is assumed to be the initial volumetric fog shape generated; such as Figure 9B As shown, at this point, it can be cut from the very center. Since the two sides of the object cannot be easily controlled, but the middle part is perfectly joined, the joined middle section can be cut open and the offset cut surfaces used as new finishing edges, as shown below. Figure 9C As shown, the x-axis is seamlessly joined at both ends; then the y-axis and z-axis can be processed in the same way to obtain the following result. Figure 9D The image shows a seamlessly connected mesh in a three-dimensional space of x, y, z; assuming... Figure 9D The boundaries at the top, bottom, left, and right are seamlessly connected, but the central part has an unnatural shape. At this point, it can be like... Figure 9E As shown, the central portion is cut out and then subjected to a face-to-point conversion operation, and then added as shown. Figure 9F The randomly added points shown can be used as follows: Figure 9G As shown, the central part is regenerated into a mesh, then spliced ​​with the outer part, and merged to obtain the desired shape.

[0100] It should be noted that for the generated volumetric fog, not only can custom normals be added to simulate light sources, but also custom colors and custom vector associations, association angles, etc., can be implemented to achieve effects such as point light sources on volumetric fog. Specifically, this leverages the advantages and characteristics of volumetric clouds themselves. Through spatial sampling calculations, volumetric clouds can be regarded as tiny particles in the atmosphere. The intensity and radius of the point light source are received in real time for scattering calculations and feedback to the brightness, resulting in realistic light and shadow in the image. It can also achieve effects such as spotlights on volumetric fog. Similar to point light sources, which illuminate volumetric clouds with a radius centered on a point, spotlights penetrate volumetric clouds with their own direction and range, simulating the natural phenomenon of the part in contact with the light being illuminated.

[0101] In this embodiment of the invention, the cloud obtained based on volumetric rendering modeling, i.e., the volumetric cloud, is segmented to obtain a volume density map and a normal map for the volumetric cloud. Then, the planar map of the volumetric cloud is converted into a volume map, and volumetric fog is generated based on the converted volume map. By converting the planar map of the volumetric cloud into a volume map, the volume of the volumetric cloud is recalculated. The volumetric fog effect is calculated during the conversion process, avoiding the problem of excessive graphics processor performance consumption caused by the excessive use of irregular mesh clusters in volumetric fog generation. This achieves the effect of improving the visual expressiveness of volumetric fog with low power consumption.

[0102] To help those skilled in the art further understand how the volumetric fog generation method proposed in this invention can be efficiently applied to open-world maps, the following description is provided in conjunction with application scenarios:

[0103] Reference Figures 10A to 10C The diagram illustrates an application scenario of volumetric fog representing the shape of a target model provided in an embodiment of the present invention.

[0104] First, the planar texture (i.e., 2D texture) of the volumetric cloud can be converted into a volumetric texture (i.e., 3D texture). The volume of the volumetric cloud texture is then recalculated to obtain the volumetric fog effect during the conversion process. This can be achieved by creating seamless volumetric assets, for example... Figure 10A The generated volumetric fog allows for freely adjustable tilling of the volumetric fog, which can be used to create lightweight, wide-area volumetric fog.

[0105] For the target modeling body, assuming as follows Figure 10BTo generate a volumetric fog representing the target model's shape, the spliced ​​portions of the generated volumetric fog can be cut. For the cut surfaces of these spliced ​​portions, a misalignment operation can be performed to obtain at least one spliced ​​body. The resulting spliced ​​body contains a mesh for connection in 3D space. Random points can then be placed at the center of the spliced ​​body, and a mesh can be generated based on these random points. This allows for splicing operations based on the existing mesh of the spliced ​​body and the meshes generated within it, resulting in a model like... Figure 10C The ideal shape of the target model shown.

[0106] In a preferred embodiment, to improve the visual quality of the generated volumetric fog while maintaining low power consumption, realistic lighting can be simulated through customized normal calculations. Specifically, light sources can be simulated based on the added custom normals, and lighting can be simulated and calculated using a CustomShader to add the effects of any number of light sources to the generated volumetric fog. This embodiment of the invention does not limit the specific implementation method.

[0107] It should be noted that for the generated volumetric fog, not only can custom normals be added to simulate light sources, but also custom colors and custom vector associations, association angles, etc., can be implemented to achieve effects such as point light sources on volumetric fog. Specifically, this leverages the advantages and characteristics of volumetric clouds themselves. Through spatial sampling calculations, volumetric clouds can be regarded as tiny particles in the atmosphere. The intensity and radius of the point light source are received in real time for scattering calculations and feedback to the brightness, resulting in realistic light and shadow in the image. It can also achieve effects such as spotlights on volumetric fog. Similar to point light sources, which illuminate volumetric clouds with a radius centered on a point, spotlights penetrate volumetric clouds with their own direction and range, simulating the natural phenomenon of the part in contact with the light being illuminated.

[0108] By utilizing 3D textures, while maintaining a lightweight design, custom real-time normal calculations can be used to achieve volumetric fog with special custom shapes and improve image performance.

[0109] In this embodiment of the invention, instead of adding volumetric fog material to an irregular mesh group composed of grids and / or polygons to generate volumetric fog, the principle of volumetric fog itself is deconstructed. The volume of the volumetric cloud is recalculated by converting its planar texture into a volumetric texture. This allows for the calculation of the volumetric fog effect during the conversion process, creating volumetric fog based on a more lightweight rendering method. This optimizes performance while maintaining visual appeal, achieving improved visual expressiveness of the volumetric fog with low resource consumption. Furthermore, customized normal calculations can be used to simulate realistic lighting. Based on the added custom normals, a simulated light source is used to calculate the simulated lighting, further improving the visual quality of the generated volumetric fog with low resource consumption. This method can be practically applied to project development.

[0110] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0111] Reference Figure 11 The diagram shows a structural block diagram of an embodiment of the volumetric fog generating device of the present invention, which may specifically include the following modules:

[0112] The volume cloud acquisition module 1101 is used to acquire the volume cloud, which is a cloud obtained based on volume rendering modeling.

[0113] The planar texture acquisition module 1102 is used to cut the volumetric cloud to obtain a planar texture for the volumetric cloud; the planar texture includes at least a volume density map and a normal map for the volumetric cloud.

[0114] The volume map conversion module 1103 is used to convert the planar map of the volume cloud into a volume map for the volume cloud based on the volume density map and the normal map.

[0115] Volumetric fog generation module 1104 is used to generate volumetric fog based on volumetric cloud volumetric maps.

[0116] In one embodiment of the present invention, the planar texture acquisition module 1102 may include the following sub-modules:

[0117] The slice group generation submodule is used to generate slice groups;

[0118] The cutting submodule is used to cut the volumetric cloud using the slice group to obtain a planar texture for the volumetric cloud.

[0119] In one embodiment of the present invention, the slice group includes at least one slice, and the cutting submodule may include the following units:

[0120] The cutting unit is used to cut the modeling cloud of volume rendering through at least one slice, and obtain the volume cloud density information and normal information of the corresponding spatial part of the volume cloud based on each slice.

[0121] The encapsulation unit is used to encapsulate the volume cloud density information and normal information of the corresponding spatial parts of each slice in the volume cloud, so as to obtain the volume density map and normal map for the volume cloud.

[0122] In one embodiment of the present invention, each slice has at least one vertex; the encapsulation unit may include the following sub-units:

[0123] The attribute storage sub-unit is used to store the volume cloud density information and normal information of each slice in the corresponding spatial part of the volume cloud as the attributes of each slice, based on each vertex of each slice.

[0124] Rearrange sub-units to rearrange the individual slices carrying attributes according to the rendering shaping strategy of planar textures;

[0125] The information baking subunit is used to bake the volumetric cloud density information and normal information carried by each rearranged slice onto a preset planar texture according to the rearranged order, so as to obtain a volumetric density texture carrying volumetric cloud density information and a normal texture carrying normal information.

[0126] In one embodiment of the present invention, the volume density map carries volume cloud density information, and the normal map carries normal information; the volume map conversion module 1103 may include the following sub-modules:

[0127] The masking submodule is used to mask a planar texture using volumetric cloud density information to obtain a masked planar texture.

[0128] The first normal rendering submodule is used to obtain the normal vectors for each vertex in the volumetric cloud from the normal information, and to perform normal rendering on the masked planar texture using the normal vectors, restoring the planar texture to the shape of the volumetric cloud, thus obtaining the volumetric texture for the volumetric cloud.

[0129] In one embodiment of the present invention, the volume mapping conversion module 1103 may further include the following sub-modules:

[0130] The simulated light source submodule is used to obtain custom normal information, which is used to characterize the light source direction vector.

[0131] The dot product operation submodule is used to perform a dot product operation on the light source direction vector and the normal vector to obtain a normal vector with light source simulation.

[0132] The second normal rendering submodule is used to render the normals of the masked planar texture using normal vectors with simulated light sources.

[0133] In one embodiment of the present invention, the volumetric fog generation module 1104 may include the following sub-modules:

[0134] The stitching section cutting submodule is used to generate an initial volumetric fog using a volumetric cloud volumetric map, and to cut the stitching section in the generated initial volumetric fog;

[0135] The splice body acquisition submodule is used to perform misalignment operations on the cross-sections of the spliced ​​parts to obtain at least one splice body; the splice body contains a mesh in three-dimensional space for connection.

[0136] The mesh derivation submodule is used to place random points in the center of a partial splice and generate a mesh based on these random points.

[0137] The stitching submodule is used to stitch together the meshes that the stitched body has and the meshes that are derived from the stitched body to generate a volumetric fog of the target model body shape.

[0138] In this embodiment of the invention, the volumetric fog generation apparatus obtains a volume density map and a normal map for the volumetric cloud by segmenting a modeled cloud based on volumetric rendering. Then, the planar map of the volumetric cloud is converted into a volumetric map, and volumetric fog is generated based on the converted volumetric map. By converting the planar map of the volumetric cloud into a volumetric map, the volume of the volumetric cloud is recalculated. The volumetric fog effect is calculated during the conversion process, avoiding the excessive performance consumption of the graphics processor caused by the excessive use of irregular mesh clusters in volumetric fog generation. This achieves the effect of improving the visual expressiveness of volumetric fog while maintaining low power consumption.

[0139] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0140] This invention also provides an electronic device, comprising:

[0141] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described volumetric fog generation method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0142] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described volumetric fog generation method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0143] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0144] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0145] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0146] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0148] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0149] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0150] The present invention has provided a detailed description of a volumetric fog generation method, a volumetric fog generation device, a corresponding electronic device, and a corresponding computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for generating volumetric fog, characterized in that, The method includes: Obtain a volumetric cloud, which is obtained based on volumetric rendering modeling; The volumetric cloud is segmented to obtain a planar texture map for the volumetric cloud; the planar texture map includes at least a volume density map and a normal map for the volumetric cloud; the volume density map carries volumetric cloud density information, and the normal map carries normal information. The volumetric cloud density information is used to mask the planar texture to obtain the masked planar texture. The normal vectors for each vertex in the volume cloud are obtained from the normal information. The normal vectors are used to perform normal rendering on the masked planar texture. The planar texture is restored to the shape of the volume cloud to obtain the volume texture for the volume cloud. An initial volumetric fog is generated using the volumetric map of the volumetric cloud, and the stitched parts in the generated initial volumetric fog are cut out; The cross-sections of the spliced ​​portion are misaligned to obtain at least one spliced ​​body; the spliced ​​body contains a mesh for connection in three-dimensional space; Random points are placed in the center of a partial splice body, and a mesh is generated based on these random points. A splicing operation is performed based on the mesh of the spliced ​​body and the meshes derived from the spliced ​​body to generate a volumetric fog of the target model body shape.

2. The method according to claim 1, characterized in that, The step of slicing the volumetric cloud to obtain a planar texture map of the volumetric cloud includes: A slice group is generated, and the volumetric cloud is cut using the slice group to obtain a planar texture for the volumetric cloud.

3. The method according to claim 2, characterized in that, The slice group contains at least one slice, and the step of cutting the volumetric cloud using the slice group to obtain a planar texture for the volumetric cloud includes: The volume cloud is cut by at least one slice, and the volume cloud density information and normal information of the corresponding spatial part of the volume cloud are obtained based on each slice. The volume cloud density information and normal information of the corresponding spatial parts of each slice in the volume cloud are encapsulated to obtain the volume density map and normal map for the volume cloud.

4. The method according to claim 3, characterized in that, Each slice has at least one vertex; the process of encapsulating the volume cloud density information and normal information of the corresponding spatial portion of each slice in the volume cloud to obtain a volume density map and a normal map for the volume cloud includes: Based on each vertex of each slice, the volume cloud density information and normal information of each slice in the corresponding spatial part of the volume cloud are stored as the attributes of each slice itself. The individual slices carrying attributes are rearranged according to the rendering and shaping strategy of planar textures. Following the rearranged order, the volumetric cloud density information and normal information carried by each rearranged slice are baked onto a preset planar texture, resulting in a volumetric density texture carrying volumetric cloud density information and a normal texture carrying normal information.

5. The method according to claim 4, characterized in that, The method of storing the volume cloud density information and normal information of each slice in the corresponding spatial part of the volume cloud as the attributes of each slice based on each vertex of each slice includes: Generate bounding boxes for each slice based on each vertex of each slice; The volume cloud density information and normal information of the corresponding spatial portion of the volume cloud where the bounding box is located are encapsulated using bounding boxes for each slice.

6. The method according to claim 1, characterized in that, The step of obtaining the normal vectors for each vertex in the volumetric cloud from the normal information and using the normal vectors to perform normal rendering on the masked planar texture also includes: Obtain custom normal information, which is used to characterize the light source direction vector; Perform a dot product operation on the light source direction vector and the normal vector to obtain a normal vector with light source simulation; The normal vector with light source simulation is used to perform normal rendering on the masked planar texture.

7. A volumetric fog generating device, characterized in that, The device includes: The volumetric cloud acquisition module is used to acquire a volumetric cloud, which is a cloud obtained based on volumetric rendering modeling. A planar texture acquisition module is used to cut the volumetric cloud to obtain a planar texture for the volumetric cloud; the planar texture includes at least a volume density texture and a normal texture for the volumetric cloud; the volume density texture carries volumetric cloud density information, and the normal texture carries normal information; The masking submodule is used to mask a planar texture using volumetric cloud density information to obtain a masked planar texture. The first normal rendering submodule is used to obtain the normal vectors for each vertex in the volume cloud from the normal information, and to perform normal rendering on the masked planar texture using the normal vectors, so as to restore the planar texture to the shape of the volume cloud and obtain the volume texture for the volume cloud. The stitching section cutting submodule is used to generate an initial volumetric fog using a volumetric cloud volumetric map, and to cut the stitching section in the generated initial volumetric fog; The splice body acquisition submodule is used to perform misalignment operations on the cross-sections of the spliced ​​parts to obtain at least one splice body; the splice body contains a mesh in three-dimensional space for connection. The mesh derivation submodule is used to place random points in the center of a partial splice and generate a mesh based on these random points. The stitching submodule is used to stitch together the meshes that the stitched body has and the meshes that are derived from the stitched body to generate a volumetric fog of the target model body shape.

8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the volumetric fog generation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the volumetric fog generation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Real-time rendering method and device of target object, electronic equipment and storage medium

    CN114445538A

  • Apparatus for generating a display medium, a method of displaying a visible image and a display apparatus

    US20170161943A1