| Flight simulators are effective equipment for training pilots to fly virtual on the ground.One of the reasons why flight simulators bring realism to pilots is its realistic visual system,which can render the view virtually in front of the pilots.When training pilots,except for takeoff and landing scenes,they are all in the air.Therefore,clouds are the most frequently encountered scenes in the air by pilots and are indispensable scenes in flight simulation visual simulation.Compared with the 3D cloud scene in games or movies,3D cloud scene in the flight simulators have different requirements.First,when training pilots,they fly according to the preplanned flight plan;second,the aircraft often fly in the stratosphere above 2000 m and through the clouds;third,the flight simulator is a simulated scene,which requires more efficient realtime rendering technology support.Therefore,this paper will optimize the cloud modeling method and cloud rendering method to maintain the stability and real-time performance of the visual system in the flight simulator.The specific work improvement are as follows:1.In the visual system of a flight simulator,the cloud originally used a texture-based modeling method,which required a lot of pre-calculation before rendering the cloud layer.In order to solve the shortcomings of texture-based modeling methods in flight simulators in realtime rendering and modeling,this paper compares several common cloud modeling methods and selects noise-based modeling algorithms for large-scale cloud modeling.Aiming at the problem of insufficient realism of clouds under large-scale modeling,this paper proposes a cloud modeling method that combines 2D noise and 3D noise,using two-dimensional Simplex noise to create the initial density of the cloud.Then two different three-dimensional Worley noises are used to "sculpt" the basic shape and the detailed shape of the initial density of the cloud.2.The external characteristics of cloud can be simulated by using the modeling of multiple noise combination,but when the sun light passes through the cloud,many optical reactions will occur inside the cloud.In order to maintain the rendering efficiency while simulating the real lighting effects of the clouds,this paper adopts a simplified lighting model to retain the light attenuation and scattering effects of light passing through the clouds.Aiming at the problem that the cloud layer based on texture modeling cannot naturally fade the effect of the surrounding clouds as the viewpoint progresses,this paper proposes to sample the cloud modeling based on an optimized light stepping algorithm,using a variable step size.Sampling and stop sampling in advance when the density is one,and sample the cloud density at the sampling point while sampling toward the position of the sun for illumination calculation.The experimental results show that the algorithm in this paper can effectively simulate the effect of cloud spreading around the viewpoint when passing through the clouds,while meeting the efficiency requirements of real-time rendering of the flight simulator.3.Through experiments,the algorithm of this paper is applied to the visual system of flight simulator,and the effectiveness of the algorithm is verified under different experimental conditions.Through the experiment of cloud simulation effect,it is shown that the algorithm of this paper is used in the visual system of flight simulation.The effect of cloud simulation effect;the effectiveness of the algorithm in simulation and large-scale simulation is verified through cloud simulation;real-time comparison experiment of cloud simulation verifies the real-time rendering efficiency of the improved light stepping algorithm in this paper Effectiveness. |