| The simulation system based on virtual reality has a very wide range of applications in industries,education,games,medicine and other fields.Combined with the needs of the petroleum field,the virtual reality technology is applied to the petroleum field emergency virtual simulation training system,and the simulation of the special effects is especially important for improving the fidelity of the virtual scene.This article focuses on the research of the crude petroleum leakage and crude petroleum fire special rendering technology that may occur in the production process of petroleum fields.The essence of crude petroleum and flame simulation is fluid simulation.The programmable shader realizes the simulation of the special effect of crude petroleum leakage and fire from the two aspects of solution of the fluid motion field and visualization of the fluid.This article mainly studies the following:1.Research on solution of fluid motion.Solve the fluid motion field based on physics.The N-S equations describing fluid motion are studied,including the derivation process,general form,and numerical solution process of the N-S equations.2.Research on the related technology of programmable shaders.Studied GPU programmable shaders,including graphics rendering pipelines,vertex shaders,geometry shaders,and fragment shaders in the pipeline,and the role of the above shaders in the graphics rendering process;Analyzed the working principle of computational shaders Study how to complete Shader programming,control programmable shaders through Unity,and solve the problem of realism and real-time in the process of graphics rendering.3.Simulation of special effects of crude petroleum leakage.Aiming at the movement of crude petroleum in the process of crude petroleum leakage,the fluid motion simulation is carried out based on the SPH method.The particle search process in the SPH algorithm is improved by the adjacent particle search method,and the collision treatment of crude petroleum particles is given.Through the calculation of the shader,the discrete crude petroleum particles are assigned a thread,and the calculation process of the physical quantity of the particles is placed in the GPU to solve,and parallel calculation is achieved,which effectively improves the calculation efficiency;in the visualization of particles,a programmable coloring is proposed.The point sprite drawing method of the device is used to complete the drawing of crude petroleum particles,and the particles are illuminated and mapped.4.Simulation of crude petroleum fire effects.Aiming at the flame movement in the crude petroleum fire phenomenon,it is solved based on the N-S equation.Through the calculation of the shader,the discrete meshes of the simulation area are allocated to the threads,and the physical quantities of the meshes are solved in the GPU to achieve parallel calculations and improve the calculation efficiency.A point sprite drawing method based on a programmable shader is used to complete the drawing of the flame particles,and the edge light processing and lighting calculation of the flame particles are completed through the programmable shader of the rendering pipeline,which improves the realism of the simulation. |