Volumetric fog generation method, apparatus, electronic equipment and storage medium

By acquiring depth and terrain information of virtual scenes, diverse volumetric fog effects are generated, solving the problem of dull volumetric fog rendering in virtual scenes and improving immersion and user experience.

CN114445533BActive Publication Date: 2026-03-06NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, volumetric fog rendering in virtual scenes produces a rigid effect with uniform density and shape, making it difficult to adjust for different areas and affecting immersion and user experience.

Method used

By acquiring scene depth and terrain information, volumetric fog areas are set, bounding box information is determined, and volumetric fog is generated based on terrain information. The fog density and shape in different areas are adjusted in combination with scene depth information, and scattering and shadows are calculated using the Gaussian specular formula to increase the realism of the fog effect.

Benefits of technology

It enables volumetric fog to interact with objects in the scene, with diverse concentrations and shapes, enhancing the immersion and rendering effects of virtual scenes and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445533B_ABST
    Figure CN114445533B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for generating volumetric fog. The method includes: acquiring scene depth information and terrain information; setting a volumetric fog region; determining bounding box information based on the scene depth information and the volumetric fog region; and generating volumetric fog based on the terrain information and the bounding box information. This solves the problem of interaction between volumetric fog and the scene. By combining the volumetric fog with the scene, the density and morphology within the volumetric fog are diversified, facilitating adjustments to different areas based on the scene's depth information, resulting in more realistic rendering effects, enhanced immersion in virtual scenes, and improved user experience. Furthermore, additional scattering and specular highlight calculations are added to the fog effect rendering, thereby strengthening the scattering effect of the volumetric fog. By superimposing the same effect through self-illumination, the problem of no volumetric fog effect in projected shadow areas is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer image technology, and in particular to a method, apparatus, electronic device and storage medium for generating volumetric fog. Background Technology

[0002] To achieve a sense of immersion in a virtual scene, volumetric fog can be introduced. In this technology, the Unreal Engine 4 is often used to generate fog effects based on the bounding box range. In Unreal Engine 4, the material editor is used to create materials by connecting nodes, noise is used to shape the volumetric fog, the RayMarch volumetric algorithm is used to render the volumetric fog, and then it is introduced into the virtual scene.

[0003] However, the related technology is simply model-based bounding box rendering, and the rendered effect is rather rigid in virtual scenes. The density and shape of the volumetric fog are uniform, which is not conducive to adjustment according to different areas. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method, apparatus, electronic device and storage medium for generating volumetric fog.

[0005] To achieve the above objectives, in a first aspect, this application provides a method for generating volumetric fog, comprising:

[0006] Acquire scene depth and terrain information;

[0007] Set the volumetric fog area;

[0008] The bounding box information is determined based on the scene depth information and the volumetric fog region;

[0009] Volumetric fog is generated based on the terrain information and the bounding box information.

[0010] In one possible implementation, obtaining scene depth information and terrain information further includes:

[0011] The scene capture camera is invoked to capture the scene depth map;

[0012] Scene depth information and terrain information are extracted from the scene depth map.

[0013] In one possible implementation, the bounding box information includes: the height information of the bounding box and the region information of the bounding box;

[0014] The step of determining the bounding box information based on the scene depth information and the volumetric fog region further includes:

[0015] The scene height information is extracted based on the scene depth information, and the height information of the bounding box is determined based on the scene height information;

[0016] The region information of the bounding box is determined based on the volumetric fog region, wherein the region of the bounding box is not smaller than the volumetric fog region.

[0017] In one possible implementation, generating volumetric fog based on the terrain information and the bounding box information further includes:

[0018] The terrain information and the bounding box information are converted into texture data;

[0019] Generate a volumetric fog material instance based on the texture data;

[0020] The volumetric fog material instance is assigned to the bounding box to generate the volumetric fog.

[0021] In one possible implementation, converting the terrain information and the bounding box information into texture data further includes:

[0022] Determine whether water elements exist within the enclosure based on the terrain information;

[0023] In response to the presence of water within the bounding box, the elemental proportion of water within the bounding box is determined;

[0024] The volumetric fog concentration is determined based on the aforementioned element ratio;

[0025] The volumetric fog concentration is converted into the texture data.

[0026] In one possible implementation, the step of generating volumetric fog based on the terrain information and the bounding box information further includes:

[0027] Object information is captured within the volumetric fog region;

[0028] In response to capturing the object information within the volumetric fog region, the object corresponding to the object information is ignored within the volumetric fog region.

[0029] In one possible implementation, the step of generating volumetric fog based on the terrain information and the bounding box information further includes:

[0030] The volumetric fog is height offset based on the height information of the bounding box to determine the height information of the volumetric fog.

[0031] In one possible implementation, the step of generating volumetric fog based on the terrain information and the bounding box information further includes:

[0032] The self-illuminating brightness and opacity within the scene are determined based on the volumetric fog.

[0033] The self-illuminating brightness and opacity are attenuated according to the Gaussian specular formula to determine the scattering portion and shadow dark area of ​​the volumetric fog.

[0034] In a second aspect, this application provides a volumetric fog generating apparatus, comprising:

[0035] The acquisition module is configured to acquire scene depth information and terrain information;

[0036] The settings module is configured to set the volumetric fog area;

[0037] The determination module is configured to determine bounding box information based on the scene depth information and the volumetric fog region;

[0038] The generation module is configured to generate volumetric fog based on the terrain information and the bounding box information.

[0039] In a third aspect, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the volumetric fog generation method as described in the first aspect.

[0040] In a fourth aspect, this application provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the volumetric fog generation method as described in the first aspect.

[0041] As described above, this application provides a volumetric fog generation method, apparatus, electronic device, and storage medium. It acquires scene depth and terrain information, then uses rendering textures to read the scene's depth information, generating volumetric fog regions and enabling interaction between volumetric fog and objects in the scene. The bounding box information is determined based on the scene depth information and the volumetric fog regions. Then, the scene depth information is baked, material and terrain-related parameters are set, and volumetric fog is generated based on the terrain and bounding box information. This solves the problem of interaction between volumetric fog and the scene. The volumetric fog generated in conjunction with the scene exhibits diverse density and morphology, facilitating adjustments to different areas based on scene depth information. This results in more realistic rendering effects, enhanced immersion in virtual scenes, and improved user experience. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A schematic diagram of the volumetric fog rendering effect in related technologies is shown.

[0044] Figure 2 An exemplary flowchart of a volumetric fog generation method provided in an embodiment of this application is shown.

[0045] Figure 3 An exemplary visual interface diagram of a depth information acquisition process according to an embodiment of this application is shown.

[0046] Figure 4 An exemplary visualization of a scene with objects present according to an embodiment of this application is shown.

[0047] Figure 5 An exemplary visual interface diagram of a height offset operation according to an embodiment of this application is shown.

[0048] Figure 6 A schematic diagram of an exemplary structure of a volumetric fog generating apparatus provided in an embodiment of this application is shown.

[0049] Figure 7 This illustration shows an exemplary structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0051] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0052] Figure 1 A schematic diagram of the volumetric fog rendering effect in related technologies is shown.

[0053] As described in the background section, in order to achieve a sense of immersion in a virtual scene, volumetric fog can be introduced into the virtual scene, as referenced... Figure 1 In related technologies, fog effects are often generated based on the bounding box range using the UE4 engine. In Unreal Engine 4, materials are created by connecting nodes using the material editor, noise is used to shape the volumetric fog, the RayMarch volumetric algorithm is used to render the volumetric fog, and it is then introduced into the virtual scene.

[0054] However, the related technology is simply model-based bounding box rendering, and the rendered effect is rather rigid in virtual scenes. The density and shape of the volumetric fog are uniform, which is not conducive to adjustment according to different areas.

[0055] Therefore, this application provides a method, apparatus, electronic device, and storage medium for generating volumetric fog. It acquires the depth and terrain information of a scene, then calls a rendering texture to read the depth information in the scene, generating a volumetric fog region, thus enabling interaction between the volumetric fog and objects in the scene. The bounding box information is determined based on the scene depth information and the volumetric fog region. Then, the scene depth information is baked, material and terrain-related parameters are set, and volumetric fog is generated based on the terrain information and the bounding box information. This solves the problem of interaction between volumetric fog and the scene. The volumetric fog generated in conjunction with the scene exhibits diverse concentrations and shapes, facilitating adjustments to different areas based on the scene's depth information, resulting in more realistic rendering effects, enhanced immersion in virtual scenes, and improved user experience.

[0056] The volumetric fog generation method provided in this application will be specifically described below through specific embodiments.

[0057] Figure 2 An exemplary flowchart of a volumetric fog generation method provided in an embodiment of this application is shown.

[0058] refer to Figure 2 The volumetric fog generation method provided in this application specifically includes the following steps:

[0059] S202: Obtain scene depth information and terrain information.

[0060] S204: Set the volumetric fog area.

[0061] S206: Determine the bounding box information based on the scene depth information and the volumetric fog region.

[0062] S208: Generate volumetric fog based on the terrain information and the bounding box information.

[0063] Figure 3 An exemplary visual interface diagram of a depth information acquisition process according to an embodiment of this application is shown.

[0064] refer to Figure 3 Regarding step S202, in this embodiment, scene information can be captured using a capture blueprint to obtain scene depth information and terrain information. Specifically, a scene depth map can be captured using a scene capture camera. For example, one or more scene depth maps can be taken perpendicular to the ground from top to bottom. The scene depth map that accurately determines the distance from each terrain location to the scene capture camera can be selected from these multiple scene depth maps. Scene depth information and terrain information can then be extracted from the scene depth map and stored in a rendering texture as texture data. The scene depth information can be the distance between the viewpoint and the target object, i.e., the distance between the scene and the scene capture camera; the terrain information can include the terrain type of the scene, such as mountain peaks, valleys, basins, sky, or water surfaces.

[0065] Understandably, to make the parameters in the capture operation easier to adjust, the entire capture process can be made into a blueprint tool, which makes it easy to adjust or modify the parameters.

[0066] In some embodiments, a virtual camera component can be acquired as a scene capture camera based on a pre-obtained virtual development engine. This camera component can be the SceneCapture component in the core of the virtual development engine, which is essentially a 3D camera component. This 3D camera component can be set within a volumetric fog generation tool, which then calls this 3D camera component to capture the scene. This scene capture camera is generally used for rendering the scene and can acquire information such as color and depth information from the scene.

[0067] Regarding step S204, in this embodiment, a volumetric fog generation tool developed based on blueprints can be configured within the scene, and the area of ​​the volumetric fog can be set according to the volumetric fog generation tool and the scene depth information extracted based on the scene depth map. Specifically, a volumetric fog tool can be placed within the scene where volumetric fog needs to be generated, or a volumetric fog tool matching the size of the terrain can be adaptively generated based on the size of the terrain within the scene. For example, when it is necessary to generate full-coverage volumetric fog throughout the entire scene, a volumetric fog tool of the same size as the terrain can be adaptively generated, so that the terrain within the entire scene can be covered by the volumetric fog tool. It can be understood that, for example, if the terrain of the entire scene is a valley surrounding a lake, a volumetric fog tool can be placed or adaptively generated within the terrain area corresponding to the lake surface, thereby obtaining a scene where fog is formed after the lake water evaporates.

[0068] In some embodiments, volumetric fog generation tools can be developed using Unreal Engine's Blueprint feature.

[0069] Regarding step S206, in this embodiment, the bounding box information is determined based on the scene depth information obtained in step S202 and the volumetric fog region set in step S204. Here, the bounding box refers to a square box that defines the boundary of the scene model.

[0070] In some embodiments, a volumetric fog baking tool can be developed based on Unreal Engine's Blueprint feature. This tool determines the bounding box information, which may include the bounding box's height and region information. Specifically, based on the volumetric fog region set by the volumetric fog generation tool, the region's size is stored within a cube-shaped box (i.e., the bounding box).

[0071] It should be noted that in step S202, scene depth information is extracted based on the scene depth map, and in step S204, the volumetric fog region is set based on the volumetric fog generation tool and the scene depth information. Because related technologies generate volumetric fog by directly generating a cubic fog effect based on the bounding box, and its size is unrelated to the scene it is in, there is a certain error between the generated volumetric fog and the terrain. For example, the fog effect height may be the same at different locations on a lake surface, while real fog is flowing and therefore will not maintain the same height at different locations. To solve the problem of poor fog effect realism in related technologies, specifically, scene height information can be extracted based on the scene depth information, and the height information of the bounding box can be determined based on the scene height information. The region information of the bounding box can then be determined based on the volumetric fog region.

[0072] Furthermore, since volumetric fog is generated within a bounding box, the area of ​​the bounding box should be no smaller than the volumetric fog area, ensuring that the bounding box can completely contain the volumetric fog. If the fog effect varies in different locations within a scene, multiple bounding boxes can be set, each corresponding to a different terrain height, making the area used to render the fog effect more realistic and improving the realism of the fog effect.

[0073] Regarding step S208, in this embodiment, volumetric fog is generated within the bounding box area of ​​the scene based on terrain information and bounding box information.

[0074] It should be noted that scene depth information, terrain information, and bounding box information can be converted into storable assets, i.e., texture data, and stored in textures for later retrieval, or stored in a volumetric fog generation tool. When volumetric fog needs to be generated within the scene, the volumetric fog baking tool is used to call the scene depth information, terrain information, and bounding box information from the volumetric fog generation tool or texture. A volumetric fog material instance is generated based on the scene depth information, terrain information, and bounding box information. Then, the scene depth information and terrain information are baked using the volumetric fog baking tool, material and terrain-related parameters are set, the volumetric fog material instance is assigned to the bounding box, and the volumetric fog generation tool is deleted, finally generating the volumetric fog.

[0075] In some embodiments, the generated volumetric fog should differ depending on the terrain. For example, in two scenes with the same bounding box height information, one is a desert and the other is a lake. In real-world scenes, lakes generate a large amount of water vapor due to evaporation, resulting in higher fog density. However, in deserts, due to extremely low moisture content, the fog effect generated by water vapor is very low. Therefore, to make the volumetric fog in the scene more realistic, thereby increasing the scene's realism and allowing users to become more immersed and improve their experience, the presence of water elements within the bounding box can be determined based on terrain information. Once the presence of water elements is confirmed, the proportion of water elements within the bounding box can be further determined. For example, the proportion of water elements in a lake scene might be 80%, while in a desert scene it might be 5%. Furthermore, the volumetric fog concentration can be determined based on the element proportion, and then converted into texture data for volumetric fog generation.

[0076] Understandably, when the water element content is 80%, the corresponding volumetric fog concentration will be higher, while when the water element content is 5%, the corresponding volumetric fog concentration will be lower. This results in a higher volumetric fog concentration in lake scenes, meaning a denser fog effect, while a lower volumetric fog concentration in desert scenes, meaning a lighter fog effect.

[0077] Figure 4 An exemplary visualization of a scene with objects present according to an embodiment of this application is shown.

[0078] In some embodiments, because there may be objects in the virtual scene that are identified as terrain, the generated volumetric fog may bypass these objects, causing objects that should be surrounded by the volumetric fog to completely avoid it, resulting in an unrealistic scene and a poor user experience. For example Figure 4 The scene contains a sphere and a cube. The sphere is ignored; when the scene capture camera captures the scene depth map, it ignores the sphere obstructing the terrain, thus obtaining the true scene depth map and terrain information. However, the cube is not ignored. During the scene depth capture process, the top surface of the cube is mistakenly identified as the terrain surface. This "misoperation" causes the system to generate a filling material between the actual terrain surface and the bottom surface of the cube. This filling material, along with the cube as a whole, represents what the scene capture camera mistakenly perceives as terrain, leading to terrain recognition errors. Consequently, both the captured scene depth map and the scene depth information extracted from it are inaccurate, resulting in incorrect volumetric fog generation and an unrealistic scene that deviates from the actual scene.

[0079] Therefore, refer to Figure 4 Before generating volumetric fog, object information, including but not limited to object outlines, is captured within the volumetric fog region using a capture blueprint. The presence of object information within the volumetric fog region confirms the presence of objects in the scene. To prevent the volumetric fog from being affected by object outlines or positions, the objects corresponding to the captured object information can be ignored within the volumetric fog region. This allows the volumetric fog to be generated solely based on terrain orientation, resulting in a fog effect that surrounds objects and, to some extent, integrates with the scene to generate volumetric fog, making the rendering more realistic, enhancing immersion in the virtual scene, and improving the user experience.

[0080] Figure 5 An exemplary visual interface diagram of a height offset operation according to an embodiment of this application is shown.

[0081] In some embodiments, the generated volumetric fog may change due to modifications in terrain parameters, see reference. Figure 5 The height of the volumetric fog can be determined by offsetting the height of the bounding box. In essence, height offsetting stretches the fog, for example, stretching a planar fog effect into a three-dimensional one.

[0082] In some embodiments, the volumetric fog in related technologies has a uniform concentration and shape, and the fog effect in areas of scattering and casting shadows is unrealistic or even nonexistent. Therefore, in volumetric fog rendering, for the scattering effect, additional specular calculations are added based on the position of the direct light to simulate scattering. Simultaneously, calculations compensate for the lack of fog effect in the cast shadow portion of the default volumetric fog effect in Unreal Engine. While enhancing the scattering effect of the volumetric fog through additional specular calculations, the same effect is achieved by overlaying self-illumination, solving the problem of no volumetric fog effect in the cast shadow portion. Specifically, the self-illumination brightness and opacity of the volumetric fog within the scene can be determined based on the volumetric fog. The self-illumination brightness and opacity are attenuated using the Gaussian specular formula to determine the scattering portion and shadow dark area of ​​the volumetric fog, thus diversifying the concentration and shape within the volumetric fog. The specific calculation formula is as follows:

[0083]

[0084]

[0085]

[0086] in, This represents the scene capture camera vector (also known as CameraVector). This represents the light vector (also known as LightDirection). The normal vector is represented by , and the roughness is used to control the degree of attenuation. The intermediate vector between the camera vector and the light vector, also known as the half-range vector, is θ, which represents the angle between the half-range vector and the normal vector. Specular represents the attenuation coefficient. The calculated self-illumination brightness and opacity corresponding to the scattered part of the volumetric fog and the dark part of the shadow are obtained by applying this attenuation coefficient to the initial self-illumination brightness and opacity within the scene, respectively.

[0087] In some embodiments, the RGB values ​​can also be calculated based on the distance between the volumetric fog and the viewing lens. Since the fog effect is denser when it is farther away from the viewing lens, the corresponding RGB value will be larger, while the fog effect is lighter when it is closer to the viewing lens, so the corresponding RGB value will be smaller, thereby making the concentration and morphology inside the volumetric fog more diverse.

[0088] As described above, this application provides a volumetric fog generation method, apparatus, electronic device, and storage medium. It acquires scene depth and terrain information, then calls rendering textures to read the scene's depth information, generating volumetric fog regions and enabling interaction between volumetric fog and objects in the scene. The bounding box information is determined based on scene depth and volumetric fog regions. Then, the scene depth information is baked, material and terrain-related parameters are set, and volumetric fog is generated based on terrain and bounding box information. This solves the problem of volumetric fog interaction with the scene. The volumetric fog generated in conjunction with the scene exhibits diverse concentrations and shapes, facilitating adjustments to different areas based on scene depth information, resulting in more realistic rendering, enhanced immersion in virtual scenes, and improved user experience. Furthermore, additional scattering and specular highlight calculations are added to the fog effect rendering, strengthening the volumetric fog's scattering effect. By overlaying the same effect through self-illumination, the problem of no volumetric fog effect in projected shadow areas is solved.

[0089] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0090] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0091] Figure 6 A schematic diagram of an exemplary structure of a volumetric fog generating apparatus provided in an embodiment of this application is shown.

[0092] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a volumetric fog generating device.

[0093] refer to Figure 6 The volumetric fog generating device includes: an acquisition module, a setting module, a determining module, and a generating module; wherein,

[0094] The acquisition module is configured to acquire scene depth information and terrain information;

[0095] The settings module is configured to set the volumetric fog area;

[0096] The determination module is configured to determine bounding box information based on the terrain information and the volumetric fog region;

[0097] The generation module is configured to generate volumetric fog based on the scene depth information and the bounding box information.

[0098] In one possible implementation, the acquisition module is further configured as follows:

[0099] The scene capture camera is invoked to capture the scene depth map;

[0100] Scene depth information and terrain information are extracted from the scene depth map.

[0101] In one possible implementation, the bounding box information includes: the height information of the bounding box and the region information of the bounding box;

[0102] The module is further configured as follows:

[0103] The scene height information is extracted based on the scene depth information, and the height information of the bounding box is determined based on the scene height information;

[0104] The region information of the bounding box is determined based on the volumetric fog region, wherein the region of the bounding box is not smaller than the volumetric fog region.

[0105] In one possible implementation, the generation module is further configured as follows:

[0106] The terrain information and the bounding box information are converted into texture data;

[0107] Generate a volumetric fog material instance based on the texture data;

[0108] The volumetric fog material instance is assigned to the bounding box to generate the volumetric fog.

[0109] In one possible implementation, the generation module is further configured as follows:

[0110] Determine whether water elements exist within the enclosure based on the terrain information;

[0111] In response to the presence of water within the bounding box, the elemental proportion of water within the bounding box is determined;

[0112] The volumetric fog concentration is determined based on the aforementioned element ratio;

[0113] The volumetric fog concentration is converted into the texture data.

[0114] In one possible implementation, the generation module is further configured as follows:

[0115] Before generating volumetric fog based on the scene depth information and the bounding box information, object information is captured within the volumetric fog region;

[0116] In response to capturing the object information within the volumetric fog region, the object corresponding to the object information is ignored within the volumetric fog region.

[0117] In one possible implementation, the generation module is further configured as follows:

[0118] After generating volumetric fog based on the scene depth information and the bounding box information, the volumetric fog is height offset based on the height information of the bounding box to determine the height information of the volumetric fog.

[0119] In one possible implementation, the generation module is further configured as follows:

[0120] After generating volumetric fog based on the scene depth information and the bounding box information, the self-illumination brightness and opacity within the scene are determined based on the volumetric fog.

[0121] The self-illuminating brightness and opacity are attenuated according to the Gaussian specular formula to determine the scattering and dark parts of the volumetric fog.

[0122] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0123] The apparatus of the above embodiments is used to implement the corresponding volumetric fog generation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0124] Figure 7 This illustration shows an exemplary structural diagram of an electronic device provided in an embodiment of this application.

[0125] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the volumetric fog generation method described in any of the above embodiments. Figure 7This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 710, a memory 720, an input / output interface 730, a communication interface 740, and a bus 750. The processor 710, memory 720, input / output interface 730, and communication interface 740 are interconnected internally via the bus 750.

[0126] The processor 710 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0127] The memory 720 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 720 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.

[0128] The input / output interface 730 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0129] The communication interface 740 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).

[0130] Bus 750 includes a pathway for transmitting information between various components of the device (e.g., processor 710, memory 720, input / output interface 730, and communication interface 740).

[0131] It should be noted that although the above-described device only shows the processor 710, memory 720, input / output interface 730, communication interface 740, and bus 750, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0132] The electronic devices described above are used to implement the corresponding volumetric fog generation methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0133] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the volumetric fog generation method as described in any of the above embodiments.

[0134] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0135] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the volumetric fog generation method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0136] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0137] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0138] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0139] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method of volumetric fog generation, characterized by, The method comprises: obtaining scene depth information and terrain information; setting a volume fog region; determining bounding box information according to the scene depth information and the volume fog region; generating volume fog according to the terrain information and the bounding box information; wherein generating volume fog according to the terrain information and the bounding box information comprises: determining whether there is a water element in the bounding box according to the terrain information; in response to the presence of a water element in the bounding box, determining an element proportion of the water element in the bounding box; determining a volume fog concentration according to the element proportion; converting the volume fog concentration into texture data, which is used for generation of the volume fog.

2. The method of claim 1, wherein, The obtaining of the scene depth information and the terrain information further comprises: calling a scene capture camera to capture a scene depth map; extracting scene depth information and terrain information according to the scene depth map.

3. The method of claim 1, wherein, The bounding box information comprises height information of the bounding box and region information of the bounding box; The determination of the bounding box information according to the scene depth information and the volume fog region further comprises: extracting scene height information according to the scene depth information, and determining height information of the bounding box according to the scene height information; determining region information of the bounding box according to the volume fog region, wherein the region of the bounding box is not less than the volume fog region.

4. The method of claim 2, wherein, The generation of the volume fog according to the terrain information and the bounding box information further comprises: converting the terrain information and the bounding box information into texture data; generating a volume fog material instance according to the texture data; assigning the volume fog material instance to the bounding box to generate the volume fog.

5. The method of claim 1, wherein, The generation of the volume fog according to the terrain information and the bounding box information further comprises: capturing object information in the volume fog region; in response to capturing the object information in the volume fog region, ignoring the object corresponding to the object information in the volume fog region.

6. The method of claim 3, wherein, The generation of the volume fog according to the terrain information and the bounding box information further comprises: performing height offset on the volume fog according to the height information of the bounding box to determine height information of the volume fog.

7. The method of claim 1, wherein, The generation of the volume fog according to the terrain information and the bounding box information further comprises: determining self-luminous brightness and opacity in a scene according to the volume fog; performing attenuation on the self-luminous brightness and the opacity according to a Gaussian highlight formula to determine a scattering part and a shadow dark part of the volume fog.

8. A volumetric fog generating device, characterized by The method comprises: an obtaining module configured to obtain scene depth information and terrain information; a setting module configured to set a volume fog region; a determining module configured to determine bounding box information according to the scene depth information and the volume fog region; a generating module configured to generate volume fog according to the terrain information and the bounding box information; wherein generating volume fog according to the terrain information and the bounding box information comprises: determining whether there is a water element in the bounding box according to the terrain information; in response to the presence of a water element in the bounding box, determining an element proportion of the water element in the bounding box; determining a volume fog concentration based on the element proportions; converting the volume fog concentration into texture data, the texture data being used for generation of the volume fog.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1 to 7 when executing the program.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions cause the computer to implement the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Real-time size cloud computing method based on screen space

    CN104091363A

  • Algorithm of volumetric fog in screen space

    CN104392478A