Implementation Method of Fog Principle in 3D Simulation Visual Scene

By calculating the relative height of the camera and object and atmospheric light transmission attenuation, dynamically calculating the color changes of fog, solving the problem that the color changes of fog in the prior art is independent of the camera position, and improving the fidelity of the three-dimensional simulation scene.

CN119784924BActive Publication Date: 2025-06-24BEIJING SEASTARS SCI & TECH INC CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411837202.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-06-24
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

The prior art cannot calculate the change in the fog color based on the height between the camera and the fog, resulting in a reduced simulation effect.

Method used

By calculating the relative height h of the camera and the object, fog effect concentration fog is calculated, and combining atmospheric scattering and light transmission attenuation, the total attenuation of fog under sunlight and atmospheric scattering Ifonal and fog scattering color Cinscattering are finally calculated based on these parameters FogColor.

Benefits of technology

The fog color changes dynamically with the camera position, improving the fidelity and simulation effect of the three-dimensional simulation scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784924B_ABST
    Figure CN119784924B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for realizing the fog principle in a three-dimensional simulation visual scene, which includes the following steps: S1. Calculate the fog effect concentration fog according to the relative height h between the camera and the object; S2. Calculate the total attenuation Ifinal of the fog under sunlight and atmospheric scattering; S3. Calculate the fog scattering color Cinscattering; S4. Calculate the fog color change FogColor according to the fog effect concentration fog, the total attenuation Ifinal of atmospheric light transmission, and the fog scattering color Cinscattering. This method for realizing the fog principle in a three-dimensional simulation visual scene solves the problem in the prior art that the change of the fog color cannot be calculated according to the height between the camera and the fog.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation fog implementation, and particularly to a method for implementing the fog principle in a three-dimensional simulation visual scene. Background Art

[0002] A Chinese patent discloses a haze simulation method for remote sensing images based on dark channel prior with an application number of CN201510329446.3. The haze simulation method for remote sensing images based on dark channel prior includes the following steps: 1. Acquisition of remote sensing image data; 2. Calculation of the dark channel map of the image; 3. Global atmospheric light estimation; 4. Transmission map extraction; 5. Simulation of haze remote sensing images.

[0003] The haze simulation method for remote sensing images based on dark channel prior can make the haze concentration level known through simulating haze remote sensing images, without the need for manual identification for classification, thus providing haze ground truth for image quality evaluation and dehazing algorithm research. However, the disadvantages still existing in the haze simulation method for remote sensing images based on dark channel prior are: it cannot calculate the change in the color of the fog according to the height between the camera and the fog, resulting in the inability to change the fog color along with the change in the camera position during the simulation process, and reducing the simulation effect. Summary of the Invention

[0004] The present invention aims to provide a method for implementing the fog principle in a three-dimensional simulation visual scene to solve the problem in the prior art that the change in the color of the fog cannot be calculated according to the height between the camera and the fog.

[0005] To achieve the above object, the present invention adopts the following technical solution: The present invention discloses a method for implementing the fog principle in a three-dimensional simulation visual scene, including the following steps:

[0006] S1. Calculate the fog effect concentration fog according to the relative height h between the camera and the object;

[0007] S2. Calculate the total attenuation I of the fog under sunlight and atmospheric scattering final ;

[0008] S3. Calculate the fog scattering color C inscattering ;

[0009] S4. Calculate the fog color change FogColor according to the fog effect concentration fog, the total attenuation I of atmospheric light transmission final and the fog scattering color C inscattering ;

[0010] Preferably, step S1 includes the following steps:

[0011] S11. Calculate the changed value falloff of the relative height h between the camera and the object, where falloff = (HeightFallOff * h), and in the formula, HeightFallOff is the height attenuation coefficient;

[0012] S12. Calculate the relationship FogFactor between the fog concentration and the change in h, where FogFactor = (1 - exp2(-falloff)) / falloff;

[0013] S13. Calculate the fog effect concentration fog, where fog = FogDensity * FogFactor, and FogDensity = exp(-h), and FogDensity is the fog effect density obtained through h.

[0014] Preferably, step S2 includes the following steps:

[0015] S21. Calculate the atmospheric scattering I sacttering , I sacttering The calculation formula of is:

[0016] I sacttering = I0 · (pow(max(0, cosθ), w))

[0017] In the formula, I0 is the initial heat dissipation light intensity; θ is the included angle between the observation direction and the light source direction; w is the weight factor, reflecting the intensity of atmospheric scattering; max(0, cosθ) means: when cosθ > 0, the value is cosθ, when the value is 0; pow(max(0, cosθ), w) means the wth power of max(0, cosθ);

[0018] S22. Calculate the atmospheric light transmission attenuation T(d), where T(d) = exp(-k · d); T(d) represents the degree of light intensity attenuation after the light passes through a certain distance d; k represents: the attenuation coefficient, reflecting the absorption and scattering ability of the atmosphere; d represents the distance of light propagation between the object and the camera;

[0019] S23. Calculate the height attenuation integral M,

[0020] S24. Calculate the total attenuation I of the fog under sunlight and atmospheric scattering final ;

[0021] I final = I0 · (max(0, cosθ))w · exp(-k · d) · (1 - exp(-k · d))

[0022] Preferably, the calculation formula of C in step S3 is: inscattering The calculation formula of is:

[0023] C in sacttering = ((1 - a)·C ND + a·C D ) + S·H

[0024] In the above formula, C ND is the non-directional color of haze scattering, representing the scattering color of haze without the influence of a specific light source direction;

[0025] C D is the directional scattering color of haze, representing the color effect of haze in the direction towards the light source when haze is irradiated by a specific light source;

[0026] S is the contribution of the sky atmosphere to haze, related to factors such as the viewpoint height, terrain, weather conditions, and atmospheric composition;

[0027] H is a factor related to the height or viewing distance of haze and sky atmosphere scattering, describing the influence of distance on the contribution of the sky atmosphere;

[0028] S·H represents the calculation through weighted product.

[0029] Preferably, the calculation formula of FogColor in step S4 is: FogColor = I final (1 - fog) + C inscatternig .

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] In the present application, first, by analyzing the relationship between h (the relative height between the camera and the fog) and the fog effect concentration fog, the calculation formula of the fog effect concentration fog with respect to h is obtained. At the same time, the change of h is also realized by using the height attenuation coefficient HeightFallOff (this coefficient reflects the change of the camera in the 3D simulation scene), so that the finally obtained fog effect concentration fog is a calculation formula related to the change of h, so that the fog effect concentration fog can change with the change of the camera height, ensuring the fidelity of the 3D simulation scene; then, by calculating the atmospheric scattering I sacttering , the atmospheric light transmission attenuation T(d), and the height attenuation integral M, the total attenuation I final of the fog under sunlight and atmospheric scattering is obtained. This describes the total attenuation of the fog between the object and the camera, and the total attenuation is also related to the light propagation distance between the object and the camera, adapting to the change of the camera relative to the object. The total attenuation I final of the fog under sunlight and atmospheric scattering also changes with the change of the distance between the camera and the object, ensuring that I finalIt will also change to ensure the simulation effect; afterwards, the fog scattering color C is calculated inscattering The calculation of the fog scattering color C inscattering It reflects that: when light passes through haze, scattering occurs, affecting the final light intensity and color performance, making distant objects look blurrier and their colors change accordingly; finally, based on the fog effect concentration fog, the total attenuation I of atmospheric light transmission final and the fog scattering color C inscattering the fog color change FogColor is calculated. Finally, by controlling the parameters in the fog effect concentration fog, the total attenuation I final the parameters in and the fog scattering color C inscattering the parameters in, a realistic fog color rendering effect that changes dynamically according to the camera position and other factors is obtained, increasing the simulation degree of the scene and realizing the interaction between atmospheric phenomena and the visual environment.

[0032] Other advantages, objectives, and features of the present invention will be partially reflected by the following description and partially understood by those skilled in the art through the research and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a flowchart of the steps of the fog principle implementation method in a three-dimensional simulation visual scene. DETAILED DESCRIPTION OF THE INVENTION

[0034] In order to make the technical means, creative features, achieved objectives, and functions of the present invention clearer and easier to understand, the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments:

[0035] As Figure 1 shown, the present invention discloses a fog principle implementation method in a three-dimensional simulation visual scene, including the following steps:

[0036] S1. Calculate the fog effect concentration fog according to the relative height h between the camera and the object;

[0037] S2. Calculate the total attenuation I of the fog under sunlight and atmospheric scattering final ;

[0038] S3. Calculate the fog scattering color C inscattering ;

[0039] S4. Calculate the fog color change FogColor according to the fog effect concentration fog, the total attenuation I of atmospheric light transmission final and the fog scattering color C inscattering Steps S1 include the following steps:

[0040]

[0041] ​S11. Calculate the changed value falloff of the relative height h between the camera and the object, where falloff = (HeightFallOff * h). In this formula, HeightFallOff is the height attenuation coefficient. (In this formula, the height attenuation coefficient HeightFallOff is multiplied by h to calculate the value obtained after the height changes with the height attenuation coefficient, that is, the changed height falloff.)

[0042] S12. Calculate the relationship FogFactor between the fog concentration and the change in h, where FogFactor = (1 - exp2(-falloff)) / falloff. (In this formula, the integral fitting method is used to add the attenuation parameter to calculate the relationship between the fog concentration and the change in h according to the changed height falloff. The relationship between the fog concentration and the change in h is FogFactor.)

[0043] S13. Calculate the fog effect concentration fog, where fog = FogDensity * FogFactor, and FogDensity = exp(-h). FogDensity is the fog effect density obtained through h. The higher the object, the more serious the disappearance of the fog effect reaching the camera. The lower the object, the stronger the fog effect after reaching the camera, simulating the phenomenon that the fog layer in the real world usually has a higher concentration at low altitudes and a lower concentration at high altitudes.

[0044] Step S2 includes the following steps:

[0045] S21. Calculate the atmospheric scattering I sacttering , I sacttering The calculation formula of is:

[0046] I sacttering = I0 · (pow(max(0, cosθ), w)) (This formula describes how light in the atmosphere is scattered in different directions, and the intensity of the scattered light is proportional to θ)

[0047] In the formula, I0 is the initial intensity of the scattered light; θ is the angle between the observation direction and the light source direction; w is the weight factor, reflecting the intensity of the atmospheric scattering; max(0, cosθ) means: when cosθ > 0, the value is cosθ, and when cosθ ≤ 0, the value is 0; pow(max(0, cosθ), w) means the w-th power of max(0, cosθ);

[0048] S22. Calculate the atmospheric light transmission attenuation T(d), where T(d) = exp(-k·d) (This formula indicates that during the propagation of light in the atmosphere, it gradually weakens due to absorption and scattering); T(d) represents the degree of light intensity attenuation after the light passes through a certain distance d; k represents the attenuation coefficient, reflecting the absorption and scattering ability of the atmosphere; d represents the distance of light propagation between the object and the camera;

[0049] S23. Calculate the altitude attenuation integral M, (k(z): This is the attenuation coefficient at a specific altitude z in the atmosphere)

[0050] S24. Calculate the total attenuation I of the fog under sunlight and atmospheric scattering final (I final reflects the effect produced by the fog under sunlight and atmospheric scattering);

[0051] I final = I0·(max(0, cosθ))^w·exp(-k·d)·(1 - exp(-k·d)) (T(d) describes the attenuation effect experienced during light propagation. The closer T(d) is to 1, it means the attenuation is smaller and the light intensity attenuation is less; conversely, the closer T(d) is to 0, it means the attenuation is more severe and the light intensity loss is larger. 1 - T(d) reflects the relationship between the "remaining light intensity" and the "scattered light intensity". In fact, although the light will attenuate during propagation, the light scattered in the atmosphere will still reach the observer's eyes. Using 1 - T(d) (i.e., 1 - exp(-k·d)) for correction means that we need to consider the scattered light intensity that can actually reach the observer after attenuation. In this way, we can accurately simulate the light transmission process in the atmosphere in the fields of computer graphics, rendering, etc., and generate more realistic visual effects. The final light intensity is not only affected by the intensity of the light source and the scattering direction, but also by the attenuation effect in the atmosphere. The atmospheric scattering intensity gradually weakens as the light propagation distance increases, and at the same time, the absorption and scattering in the atmosphere will cause further attenuation of the final light intensity.)

[0052] In step S3, the calculation formula for C inscattering is as follows:

[0053] C in sacttering = ((1 - a)·C ND + a·C D ) + S·H

[0054] In the above formula, C ND is the non-directional color of haze scattering, representing the scattering color of haze without the influence of a specific light source direction;

[0055] C DIt represents the directional scattering color of haze, indicating the color effect of haze in the direction towards the light source when the haze is irradiated by a specific light source;

[0056] a is the interpolation factor, representing the degree of transition between two colors, and its range is [0, 1];

[0057] S is the contribution of the sky atmosphere to the haze, which is related to factors such as the viewer's height, terrain, weather conditions, and atmospheric composition;

[0058] H is a factor related to the height or viewing distance of the scattering of haze and the sky atmosphere, describing the influence of distance on the contribution of the sky atmosphere;

[0059] S·H represents the calculation through weighted product. Mixing of directional and non-directional scattering: First, the scattering color of the haze is composed of the mixing of two different scattering components: non-directional scattering and directional scattering. Through the interpolation factor a, the directionality of the scattering is adjusted according to the distance between the observer and the haze. When the distance is closer (a is larger), the haze shows more directional scattering effect, and vice versa, it shows non-directional scattering effect. Contribution of the sky atmosphere: Next, the scattering effect of the sky is also added to the final haze color, especially the contribution of the sky scattering related to the height or viewing distance. This contribution is calculated by S·H, enhancing the haze color in the long-distance view, usually a slight overlay of the sky color to further enrich the color effect of the fog.

[0060] Preferably, the calculation formula of FogColor in step S4 is: FogColor = I final (1 - fog) + C inscatternig .

[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

Claims

1. A method for realizing the fog principle in a three-dimensional simulated scene, characterized in that: The steps include: S1, calculate the fog concentration fog according to the relative height h between the camera and the object; S2. Calculate the total attenuation of fog under sunlight and atmospheric scattering I final ; S3. Calculate the fog scattering color C inscattering ; S4, based on the fog concentration fog, the total attenuation of atmospheric light transmission I final and the fog scattering color C inscattering Calculate the fog color change FogColor; Step S2 includes the following steps: S21. Calculation of atmospheric scattering I sacttering , I sacttering The calculation formula is: , In the formula, is the initial heat dissipation light intensity; is the angle between the observation direction and the light source direction; is the weight factor, reflecting the intensity of atmospheric scattering; Indicates: When When the value is ,when When the value is 0; express of Power; S22, calculate the atmospheric light transmission attenuation T(d), ; T(d) represents the degree of attenuation of light intensity after the light passes a certain distance d; k represents: attenuation coefficient, which reflects the absorption and scattering ability of the atmosphere; d represents the distance of light propagation from the object to the camera; S23, calculate the height attenuation integral M, ; S24. Calculate the total attenuation of fog under sunlight and atmospheric scattering I final ; ; Step S3C inscattering The calculation formula is: , In the above formula, It is the non-directional color scattered by haze, which means the scattered color of haze without the influence of a specific light source direction; It is the directional scattering color of the haze, which means the color effect of the haze in the direction of the light source when the haze is illuminated by a specific light source; S is the contribution of sky atmosphere to haze, which is related to viewpoint height, terrain, weather conditions and atmospheric composition factors; H is a factor related to the height or visibility distance of haze and sky atmospheric scattering, describing the effect of distance on the sky atmospheric contribution; S·H means calculation by weighted product; a is the interpolation factor, which indicates the degree of transition between two colors, and its range is [0, 1]; The calculation formula of FogColor in step S4 is: .

2. The method for realizing fog principle in three-dimensional simulation scene according to claim 1, characterized in that: Step S1 includes the following steps: S11, calculate the relative height h between the camera and the object after the change value falloff, , where HeightFallOff is the height attenuation coefficient; S12, calculate the relationship between fog concentration and h, FogFactor, FogFactor = (1 - exp2(-falloff)) / falloff; S13, calculate the fog concentration fog, , FogDensity=exp(-h), FogDensity is the fog density obtained by h.

Citation Information

Patent Citations

  • Remote sensing image haze simulation method based on dark-channel priori knowledge

    CN104881879A

  • Multi-scattering real-time rendering method and device and electronic equipment

    CN117274473A

  • Visualization method and system of electrical schematic diagram

    CN118780186A