A method for simulating a large-range water surface environment under multiple sea conditions

Through technical means such as building ocean models and generating Phillips spectrum, the problem that the existing technology cannot simulate multiple sea conditions and large-scale water surface environments is solved, and the wave and surge effects with high detail and dynamic changes are achieved, making the sea surface more realistic.

CN115292915BActive Publication Date: 2025-06-17DALIAN MARITIME UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210871852.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-06-17
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The existing sea surface simulation methods cannot effectively simulate multiple sea conditions and large-scale water surface environments, and cannot truly present the dynamic fluctuations and surge effects of sea waves.

Method used

By constructing ocean models, Phillips spectrum and Gaussian random numbers are generated, the height and waveform of the waves are controlled, the details of sea surface and sea surface ripple under different wind speeds and under viewing angle changes are simulated, and the surge effect is added.

Benefits of technology

Real simulation of various sea conditions and large-scale water surface environments is achieved, which can dynamically change and present high-detailed waves and surge effects, making the sea surface more realistic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115292915B_ABST
    Figure CN115292915B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for simulating a large-range water surface environment under multiple sea conditions, including: constructing an ocean model, generating the Phillips spectrum, Gaussian random numbers, and initial spectrum required for the waveform in the ocean model, and controlling the direction of the waveform; generating the height spectrum of the ocean waveform, the offset spectrum of the ocean waveform in the x direction, and the offset spectrum in the Z direction according to the initial spectrum through ocean formulas; obtaining the offset texture and normal texture of the ocean waveform; generating a mesh and displaying the mesh through a mesh filter and a mesh renderer; assigning the generated offset texture and normal texture to corresponding texture variables; obtaining the coordinate offset value of the current coordinate point relative to the sea level in the height direction; converting the final coordinates of the current surface mesh point in the ocean model space into coordinates in the clip space and coordinates in the world coordinate system; obtaining the normal value of the current surface mesh point, generating a sea surface with different color values at different angles, and adding surge and detailed seawater wave maps with different perspectives of far and near.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to a method for simulating a large-range water surface environment under multiple sea conditions. Background Art

[0002] In existing sea surface simulation methods, there are more or less problems in the simulation and rendering of water bodies: the water surface is relatively flat and there is basically no real fluctuation in the height direction; it cannot simulate various conditions of the sea surface in real situations, and the simulation scene is relatively single; there is no surge in the real scene; the size of the sea surface is limited and it cannot simulate a large-range sea surface; the details of the waves cannot be changed by the distance of the viewing angle. Summary of the Invention

[0003] According to the problems existing in the prior art, the present invention discloses a method for simulating a large-range water surface environment under multiple sea conditions, which can control the height of the waves, the waveform of the sea water, the sea surface under different wind speeds, the ripple details of the sea surface under different visual distances, and the surge that appears under a calm sea surface through operations. The specific methods are as follows:

[0004] Construct an ocean model, generate the Phillips spectrum, Gaussian random numbers, and initial spectrum required for the waveform in the ocean model, and control the direction of the waveform;

[0005] Generate the height spectrum of the ocean waveform, the offset spectrum of the ocean waveform in the x direction, and the offset spectrum in the Z direction according to the initial spectrum through the ocean formula;

[0006] Obtain the offset texture and normal texture of the ocean waveform;

[0007] Generate a mesh and display the mesh through a mesh filter and a mesh renderer;

[0008] Assign the generated offset texture and normal texture to the corresponding texture variables;

[0009] Sample the obtained offset texture to obtain the coordinate offset value of the current coordinate point relative to the sea level in the height direction;

[0010] Convert the final coordinates of the current surface mesh point in the ocean model space into the coordinates in the clip space and the coordinates in the world coordinate system;

[0011] Obtain the normal value of the current surface mesh point, generate a sea surface with different color values at different angles, and add a surge and a detailed view of the sea waves at different viewing distances.

[0012] Further, a random number seed is generated through a Gaussian random function, and a uniformly distributed random number is generated using the Xorshift algorithm. The obtained uniformly distributed random number is subjected to a Box-Muller transformation to obtain a Gaussian random number, thereby obtaining a Phillips spectrum.

[0013] Further, an initial spectrum of the ocean is generated through Gaussian random numbers and a Phillips spectrum.

[0014] Further, an IDFT transformation is performed on the offset spectrum in the X direction and the offset spectrum in the Z direction of the generated height spectrum to generate an offset texture of the ocean waveform, and an ocean waveform normal texture is generated based on the offset texture.

[0015] Further, the vertex coordinates, texture coordinates, and world coordinates corresponding to the grid in the model space are set; the offset texture prepared in advance is sampled using the grid coordinates of the X axis and the Z axis in the model space to obtain the coordinate offset value of the current coordinate point in the height direction relative to the sea level in the offset texture; the texture coordinates of the grid vertices are superimposed with the texture map to obtain the coordinate offset value of the current coordinate point in the height direction relative to the sea level in the texture map.

[0016] Further, the final coordinates of the current surface grid point are obtained by adding the grid coordinate point to the coordinate offset value of the current coordinate point in the height direction relative to the sea level in the texture map, and the obtained coordinates are converted into coordinates in the clip space and coordinates in the world coordinate system.

[0017] Further, the normal texture is sampled using the grid coordinates in the ocean model space, and the normal vector in the model space is converted to the world coordinate system to obtain the normal value of the current surface grid point.

[0018] Further, a Fresnel calculation is performed on the obtained normal value and the viewing direction information to form a Fresnel effect, generating different color values presented by the sea surface at different angles.

[0019] Further, the normal value of the current surface grid point, the light source direction, the coordinate value of the current sea surface grid point, and the position information of the camera are used for seawater lighting calculation and Fresnel effect calculation to obtain the final color value of the current sea surface position.

[0020] Further, the coordinate value of the current sea surface grid point is obtained, and a surge is generated through a sine wave formula:

[0021] y = sin(x.uv + speed * time)

[0022] Where: x.uv represents the coordinate value of the current sea surface grid point, speed represents the moving speed of the surge, and time represents the period of the surge undulation. The generated surge is combined with the ocean ripple effect to obtain the final ocean ripple surge effect.

[0023] Due to the adoption of the above technical solution, a method for simulating a large-range water surface environment under multiple sea conditions provided by the present invention makes the current available sea surface grid by making multiple grids on the screen, and the sea surface waveform can be controlled by the FFT algorithm; wherein the sea surface changes with the speed and direction of the wind; the illumination angle of the sea surface is variable; the sea surface is not limited to a small range, equivalent to 10 kilometers in reality; the sea surface can achieve real and complex dynamic fluctuations. An infinitely wide and highly detailed sea water body is realized in an efficient manner, and at the same time, the effect of the surge is added to realize the feedback on the real sea water, making the sea surface more real. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0025] Figure 1 It is a method flow chart of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0026] Figure 2 It is a sea surface effect diagram under different wind speed conditions of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0027] Figure 3 It is a sea surface effect diagram under different wind speed conditions of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0028] Figure 4 It is a sea surface effect diagram under different wind speed conditions of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0029] Figure 5 It is an effect diagram of sea waves + surge under a calm sea surface of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0030] Figure 6 It is an effect diagram of sea waves + surge under a calm sea surface of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0031] Figure 7 It is a color effect diagram of the sea surface under different angles of the method for simulating a large-range water surface environment under multiple sea conditions according to the present invention;

[0032] Figure 8 The color effect diagrams of the sea surface from different angles of the multi-sea-state large-scale water surface environment simulation method according to the present invention;

[0033] Figure 9 The comparison diagram of a large-scale 10-kilometer ocean and a small-scale 1000-meter ocean of the multi-sea-state large-scale water surface environment simulation method according to the present invention. Specific embodiments

[0034] To make the technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention:

[0035] As Figure 1 shown, a multi-sea-state large-scale water surface environment simulation method includes the following steps:

[0036] Step 1: Construct an ocean model and generate the Phillips spectrum and Gaussian random function required for the ocean waveform in the constructed ocean model: First, generate a random number seed through a built-in function, and then use the Xorshift algorithm to generate uniformly distributed random numbers. For the obtained uniformly distributed random numbers, through the Box-Muller transformation, Gaussian random numbers are obtained.

[0037] Through the formula

[0038]

[0039]

[0040] The Phillips spectrum is obtained;

[0041] L = V 2 / g, where V is the wind speed and ω 2 is the wind direction,

[0042] Step 2: Generate the initial spectrum of the ocean according to the following formula;

[0043]

[0044] ξ r and ξ i are two independent Gaussian random numbers that follow a normal distribution with a mean of 0 and a standard deviation of 1.

[0045] Through the formula

[0046]

[0047] Generate the initial spectrum of the ocean, and the spectrum will change over time.

[0048] is the conjugate complex number of, and k is the modulus of, and ω(k) is the Dispersio relationship between the angular frequency ω and the wavelength k.

[0049] Step 3: Generate the height spectrum of the ocean waveform from the initial spectrum through the ocean formula

[0050] According to the formula

[0051]

[0052] Obtain the height spectrum of the ocean;

[0053] is the horizontal coordinate, t is the time, The function returns the sea surface height at at time t.

[0054] Step 4: Generate the offset spectrum of the ocean waveform in the X direction and the offset spectrum in the Z direction from the initial spectrum

[0055] From the obtained initial spectrum

[0056]

[0057] Through the formula

[0058]

[0059]

[0060]

[0061] Obtain the offset spectra of the ocean in the X direction and the Z direction;

[0062] Step 5: Perform IDFT transformation on the generated height spectrum, the offset spectrum in the X direction, and the offset spectrum in the Z direction to generate the offset texture of the ocean waveform, and generate the normal texture required for the ocean waveform from the offset texture.

[0063] Step 6: Add Mesh Filter and Mesh Renderer components to the game object, obtain the created Mesh grid through the Mesh Filter, then the Mesh Filter renders the grid on the screen through the Mesh Renderer, and access the material ball OceanMaterial for ocean rendering.

[0064] 1. Add Mesh Filter and Mesh Renderer components to the created Object

[0065] 2. Obtain the mesh required for the ocean waveform through the Mesh Filter. The number and size of the mesh can be set, and the ratio to the real world is 1:100, which can simulate a size of 10 kilometers;

[0066] 3. Render the mesh on the screen through the Mesh Renderer

[0067] 4. Bind the Mesh Renderer to the material ball OceanMaterial to render the texture effect in the material ball onto the mesh, presenting the ocean waveform effect on the screen. Implement the adjustment of the wind speed, amplitude, and various sea conditions of the ocean.

[0068] Step 7: Assign the offset texture and normal texture generated in Step 1 to the corresponding texture variables of the material ball OceanMaterial, which are the textures for vertex shader sampling, i.e., displacement maps, so that the vertex positions of all waves can be known;

[0069] Step 8: Set the vertex coordinates, texture coordinates, and world coordinates corresponding to the mesh in model space in the shader; sample the pre-made offset texture using the mesh coordinates on the X-axis and Z-axis in model space to obtain the coordinate offset value in the height direction of the current coordinate point relative to the sea level. In the following formula, use the texture coordinates of the mesh vertices to overlay with the texture map to obtain the coordinate offset value in the height direction of the current coordinate point relative to the sea level.

[0070] Step 9: Add the above offset value to the mesh coordinate point to obtain the final coordinate of the current surface mesh point, and convert the obtained coordinate into the coordinate in clip space and the coordinate in world coordinate system.

[0071] Step 10: Sample the pre-made normal texture using the mesh coordinates in model space, and convert the normal vector in model space to world coordinate system to obtain the normal value of the current surface mesh point.

[0072] Pass i.uv as the output value to the shader, and sample the pre-made normal map of the sea water waveform using i.uv to obtain the normal value normal of the sea water surface mesh point; implement the effect of the sea water waveform.

[0073] Step 11: Obtain the light source direction and viewing direction in the world coordinate system through the vertex positions of the grid in world space. Perform Fresnel formula calculations using the obtained normal value and viewing direction information, add the Fresnel effect, control the color of the sea surface, and achieve different color values for the sea surface at different angles.

[0074] Step 12: Use the final normal value of the current surface grid point, the coordinate value of the current sea surface grid point, the position of the camera, etc. to perform sea water lighting calculations and Fresnel effect calculations to obtain the final color value of the current sea surface position.

[0075] Step 13: Add the waveform of the surge and combine it with the previous ocean ripple effect to obtain the final ocean ripple surge effect.

[0076] Step 14: Add the effect of different wave details at different viewing distances to the formed final ocean ripples.

[0077] The method disclosed in the present invention combines the wave details in multiple different states through LOD (Level of detail) multi-level detail components, allocates the rendered models according to the position and importance of the models, and reduces the number of faces and detail levels of unimportant objects. According to the distance between the camera and the model, it is determined which model to display. When the distance is close, a high-precision and multi-detail model is displayed, and when the distance is far, a low-precision and low-detail model is displayed, so as to achieve the effect of changing wave details according to the distance between the camera and the model.

[0078] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.

Claims

1. A method for simulating a large - scale water surface environment under multiple sea conditions, characterized in that Including: Construct an ocean model, generate the Phillips spectrum, Gaussian random numbers, and initial spectrum required for the waveform in the ocean model, and control the direction of the waveform; Generate the height spectrum of the ocean waveform, the offset spectrum in the X direction, and the offset spectrum in the Z direction of the ocean waveform according to the initial spectrum through the ocean formula; Obtain the offset texture and normal texture of the ocean waveform; Generate a mesh and display the mesh through a mesh filter and a mesh renderer; Assign the generated offset texture and normal texture to the corresponding texture variables; Sample the obtained offset texture to obtain the coordinate offset value in the height direction of the current coordinate point relative to the sea level; Convert the final coordinates of the current surface mesh point in the ocean model space into coordinates in the clip space and coordinates in the world coordinate system; Obtain the normal value of the current surface mesh point, generate a sea surface with different color values at different angles, and add surge and detailed sea wave maps with different perspectives; 2. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Generate a random number seed through a Gaussian random function, generate uniformly distributed random numbers using the Xorshift algorithm, and perform a Box-Muller transformation on the obtained uniformly distributed random numbers to obtain Gaussian random numbers, thereby obtaining the Phillips spectrum; 3. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 2, characterized in that: Generate the initial spectrum of the ocean through Gaussian random numbers and the Phillips spectrum; 4. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Perform an IDFT transformation on the generated offset spectrum in the X direction and the offset spectrum in the Z direction of the height spectrum to generate the offset texture of the ocean waveform, and generate the normal texture of the ocean waveform according to the offset texture; 5. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Set the vertex coordinates, texture coordinates, and world coordinates corresponding to the mesh in the model space; sample the pre-made offset texture using the mesh coordinates of the X axis and Z axis in the model space to obtain the coordinate offset value in the height direction of the current coordinate point relative to the sea level in the offset texture; superimpose the texture coordinates of the mesh vertex with the texture map to obtain the coordinate offset value in the height direction of the current coordinate point relative to the sea level in the texture map; 6. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Obtain the final coordinates of the current surface mesh point by adding the mesh coordinate point and the coordinate offset value in the height direction of the current coordinate point relative to the sea level in the texture map, and convert the obtained coordinates into coordinates in the clip space and coordinates in the world coordinate system; 7. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Sample the normal texture using the mesh coordinates in the ocean model space, and convert the normal vector in the model space to the world coordinate system to obtain the normal value of the current surface mesh point; 8. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Perform a Fresnel calculation on the obtained normal value and the viewing direction information to form a Fresnel effect, generating different color values presented by the sea surface at different angles; 9. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Perform sea water lighting calculation and Fresnel effect calculation using the normal value of the current surface mesh point, the light source direction, the coordinate value of the current sea water surface mesh point, and the position information of the camera to obtain the final color value of the current sea surface position; 10. The method for simulating a large - scale water surface environment under multiple sea conditions according to claim 1, characterized in that: Obtain the coordinate value of the current sea water surface mesh point and generate a surge through the sine wave formula: y = sin(x.uv + speed * time) Where: x.uv represents the coordinate value of the current sea surface grid point, speed represents the moving speed of the surge, time represents the period of the surge undulation, and the generated surge is combined with the ocean ripple effect to obtain the final ocean ripple surge.

Citation Information

Patent Citations

  • Sea surface modeling and real-time illuminating method based on projected grid

    CN102855400A

  • Sea surface simulation image generation method and device and electronic equipment

    CN113470135A