A GPU-accelerated 3D seawater simulation and rendering method and system
Patent Information
- Application Number
- CN202611278203.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]现有技术在3D海水仿真与渲染方面存在以下不足:1.海面建模依赖CPU计算,海面网格密度不均,近处海面网格过密、远处海面网格过简,渲染开销高;2.海浪模拟简单,缺乏基于物理频谱的真实波浪生成;3.海水场景管理无分层裁剪,大规模海水场景易卡顿、加载慢;4.光学效果单一,缺少反射、折射、焦散、雾化、泡沫等综合渲染;5.加载海水场景时数据请求串行,海水场景加载延迟高,无法支持多线程并发加载;6.材质资源重复加载,显存占用高,渲染效率低;7.无法在保留海水几何精度的同时完整保留海水物理属性
[0051]1.渲染速度快:GPU 并行计算 + 多线程并发请求,加载与渲染效率显著提升;2.物理真实度高:基于 FFT 海浪频谱模拟,波浪自然、动态稳定;3.画质逼真:完整支持反射、折射、菲涅尔、焦散、雾化、泡沫、浪花;4.场景调度高效:八叉树 + LOD + 分层视锥剔除,支持超大规模海面;5.资源占用低:共享内存避免重复加载,显存与带宽占用降低;6.属性完整保留:几何与属性分离存储、编码关联,支持查询与交互;7.通用性强:支持客户端与 Web端部署,适配多平台,可嵌入数字孪生系统。
Smart Images

Figure CN122888094A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer graphics, 3D simulation, and digital twin technology, and specifically relates to a GPU-accelerated 3D seawater simulation and rendering method and system. Background Technology
[0002] In fields such as digital oceanography, water conservancy engineering, maritime training, virtual reality, film and television production, and smart cities, large-scale 3D seawater scenes need to simultaneously meet requirements such as real-time performance, realism, large-scale scenes, and low resource consumption. Seawater rendering involves complex physical simulations, including wave dynamics, fluid motion, light transmission, reflection and refraction, caustics, and underwater scattering, resulting in a huge computational load.
[0003] Existing technologies for 3D seawater simulation and rendering have the following shortcomings: 1. Sea surface modeling relies on CPU computation, resulting in uneven mesh density, with overly dense meshes in the near-shore area and overly simplistic meshes in the distant area, leading to high rendering overhead; 2. Wave simulation is simplistic, lacking realistic wave generation based on physical spectrum; 3. Seawater scene management lacks layered clipping, making large-scale seawater scenes prone to lag and slow loading; 4. Optical effects are limited, lacking comprehensive rendering of reflection, refraction, caustics, fogging, foam, etc.; 5. Data requests are serialized when loading seawater scenes, resulting in high loading latency and inability to support multi-threaded concurrent loading; 6. Material resources are repeatedly loaded, leading to high memory consumption and low rendering efficiency; 7. It is impossible to fully preserve the physical properties of seawater while maintaining its geometric accuracy.
[0004] Therefore, there is an urgent need for a 3D seawater simulation and rendering method and system that supports GPU acceleration, concurrent scheduling, shared memory, and layered rendering. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the present invention provides a GPU-accelerated 3D seawater simulation and rendering method and system, which can effectively solve the above problems.
[0006] The technical solution adopted in this invention is as follows:
[0007] This invention provides a GPU-accelerated 3D seawater simulation and rendering method, comprising:
[0008] Step S1, Preprocessing for digital model separation of the seawater scene:
[0009] The geometric structure and attribute information of a 3D seawater scene are separated to obtain the physical properties of seawater, marine environmental parameters, and seawater geometric mesh structure.
[0010] The seawater geometric mesh structure is divided into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map;
[0011] Establish a logical association between the geometric contour (Bbox) of each seawater tile and the corresponding seawater tile attribute in the seawater physical properties based on the encoded value;
[0012] The texture maps of the seawater tiles are stored separately in a database, and the texture map index information is written into the geometric outline Bbox of each seawater tile.
[0013] Step S2, configure the classification transmission service and seawater tile attribute query service:
[0014] Configure the seawater tile geometry outline Bbox transmission service and the seawater tile material texture map transmission service; configure the query service to obtain the corresponding seawater tile attributes by querying the seawater physical properties based on the encoded value;
[0015] Step S3, initial loading of the seawater scene on the front end:
[0016] When the front end first requests to load the seawater scene, it obtains the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; it obtains the corresponding seawater tile attributes, including geographic coordinates and spatial range, according to the seawater tile attribute query service; and it renders the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen.
[0017] Step S4, screen partitioning and seawater tile geometry outline Bbox assignment:
[0018] The screen is divided into multiple screen partitions according to the screen rendering range; the seawater tile geometry outline Bbox to be requested is determined based on the distance and view relationship between the camera and the root node seawater tile geometry outline Bbox_0; the optimal allocation strategy is adopted to allocate the requested seawater tile geometry outline Bbox to the corresponding screen partition.
[0019] Step S5: Concurrent request for seawater tile geometric outline Bbox and sharing of material texture map:
[0020] Each screen partition, in its corresponding thread, concurrently and synchronously requests the corresponding seawater tile geometric outline Bbox through the seawater tile geometric outline Bbox transmission service, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory.
[0021] Step S6: The GPU implements multi-threaded parallel rendering.
[0022] Each screen partition renders the geometric outline (Bbox) of the seawater tile in its corresponding thread, reads the corresponding material texture map from shared memory, and completes the rendering of seawater effects with lighting, reflection, refraction, Fresnel, caustics, and underwater mist.
[0023] This invention also provides a GPU-accelerated 3D seawater simulation and rendering system for executing the aforementioned GPU-accelerated 3D seawater simulation and rendering method, comprising:
[0024] The preprocessing module is used to perform digital-to-analog separation preprocessing on the seawater scene, including: separating the geometric structure and attribute information of the seawater scene to obtain seawater physical properties, marine environmental parameters, and seawater geometric structure; dividing the seawater geometric structure into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map; establishing a logical association between each seawater tile geometric outline Bbox and the corresponding seawater tile attribute in the seawater physical properties based on the encoding value; storing the seawater tile material texture map separately in a database, and writing material texture map index information into each seawater tile geometric outline Bbox;
[0025] The service configuration module is used to configure the classification transmission service and the seawater tile attribute query service, including: configuring the seawater tile geometric outline Bbox transmission service and the seawater tile material texture map transmission service; configuring the query service to query the physical properties of seawater based on the encoded value and obtain the corresponding seawater tile attributes;
[0026] The front-end loading module is used for the initial loading of the seawater scene, including: when the front-end requests to load the seawater scene for the first time, obtaining the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; obtaining the corresponding seawater tile attributes according to the seawater tile attribute query service, including geographic coordinates and spatial range; and rendering the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen.
[0027] The screen partitioning and allocation module is used for screen partitioning and seawater tile geometry outline Bbox allocation, including: dividing the screen into multiple screen partitions according to the screen rendering range; determining the seawater tile geometry outline Bbox that needs to be requested based on the distance and view relationship between the camera and the root node seawater tile geometry outline Bbox_0; and using the optimal allocation strategy to allocate the requested seawater tile geometry outline Bbox to the corresponding screen partition.
[0028] The concurrent request module is used for concurrent requests to the geometric outline Bbox of the seawater tile and the sharing of material texture maps. It includes: each screen partition concurrently and synchronously requests the corresponding geometric outline Bbox of the seawater tile through the seawater tile geometric outline Bbox transmission service in the corresponding thread, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory.
[0029] The GPU multi-threaded parallel rendering module is used to render the geometric outline (Bbox) of seawater tiles in the corresponding thread for each screen partition. It reads the corresponding material texture maps from shared memory to complete the rendering of seawater effects including lighting, reflection, refraction, Fresnel effects, caustics, and underwater misting, including:
[0030] The FFT wave calculation unit is used to generate height field, normal field, and displacement field based on the wave spectrum.
[0031] Projection mesh generation unit, used to realize dynamic LOD meshes with low resolution at long distances and high resolution at close distances based on GPU;
[0032] The layered frustum culling unit is used for three-layer pre-clipping and octree spatial culling: above water, on the water surface, and underwater.
[0033] Optical rendering unit for reflection, refraction, Fresnel mapping, normal mapping, HDR, caustics, underwater fogging, foam, and wave composition;
[0034] Render queue units are used to sort by material, shader, and render target to optimize rendering pipeline performance.
[0035] An algorithm for wave simulation combining FFT wave calculation units and hierarchical view frustum culling units:
[0036] Based on the hierarchical determination results of the layered view cone, the wave spectrum sampling resolution is adaptively adjusted:
[0037]
[0038] in: : Number of adaptive FFT spectrum sampling points for the current tile; The system presets the maximum number of high-precision sampling points. : Octtree LOD level decay coefficient; : Cone overlap efficiency; : Three-layer layering accuracy coefficient;
[0039] The calculation method is as follows:
[0040] Water surface layer, core rendering layer: Maintain full-precision FFT sampling to preserve wave and ripple details;
[0041] Above-water level, distant view level: Adaptive downsampling as the line of sight increases to simplify fine ripples;
[0042] Underwater layer, optical layer: It retains only the large wave undulations, weakens the micro ripples, and is suitable for underwater atomization and refraction effects;
[0043] Adaptive wave height field correction formula:
[0044]
[0045] in: : Adaptive correction of wave height field; Standard Phillips wave reference height field; : Cone overlap efficiency; : Current tile level, maximum subdivision level; : Hierarchical dynamic rejection threshold; Real-time regional wave height;
[0046] Dynamic removal threshold by layer Adaptive matching of wave amplitude; efficiency of view cone overlap Control the weight of visible tile wave details; achieve gradient wave simulation with detailed foreground and simplified background using LOD level coefficients;
[0047] Based on adaptive wave height field, normal field and displacement field with matching hierarchical accuracy are generated synchronously:
[0048]
[0049] in: Adaptive wave displacement field; Adaptive wave normal field; Wave displacement scaling factor; Gradient operator; : Layered normal accuracy correction coefficient, 1.0 for the surface layer, decreasing for the above-water and below-water layers.
[0050] The GPU-accelerated 3D seawater simulation and rendering method and system provided by this invention have the following advantages:
[0051] 1. Fast rendering speed: GPU parallel computing + multi-threaded concurrent requests significantly improve loading and rendering efficiency; 2. High physical realism: Based on FFT wave spectrum simulation, waves are natural and dynamically stable; 3. Realistic image quality: Fully supports reflection, refraction, Fresnel, caustics, fog, foam, and spray; 4. Efficient scene scheduling: Octree + LOD + hierarchical frustum culling supports ultra-large-scale sea surfaces; 5. Low resource consumption: Shared memory avoids repeated loading, reducing VRAM and bandwidth consumption; 6. Complete attribute preservation: Geometry and attributes are stored separately and encoded in association, supporting querying and interaction; 7. Strong versatility: Supports client and web deployment, adapts to multiple platforms, and can be embedded in digital twin systems. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a flowchart of a GPU-accelerated 3D seawater simulation and rendering method according to the present invention;
[0054] Figure 2 This is a diagram of the scenario management architecture of the present invention;
[0055] Figure 3 This is a schematic diagram illustrating the principle of octree scene partitioning in this invention.
[0056] Figure 4 This is a schematic diagram illustrating the principle of octree scene partitioning in this invention.
[0057] Figure 5 This is a schematic diagram of the improved octree scene partitioning principle of the present invention;
[0058] Figure 6 This is a diagram of the improved octree scene generation algorithm of the present invention;
[0059] Figure 7 This is a flowchart of the water surface optical effect rendering process of the present invention. Detailed Implementation
[0060] To make the technical problems solved, the technical solutions, and the beneficial effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the invention.
[0061] This invention provides a GPU-accelerated 3D seawater simulation and rendering method and system, suitable for real-time rendering of large-scale oceans, lakes, rivers, and other water bodies. It can be widely applied in fields such as digital twins, maritime simulation, water conservancy simulation, games, and film and television. (See also...) Figures 1-7 The methods include:
[0062] Step S1, Preprocessing for digital model separation of the seawater scene:
[0063] Step S1.1: Separate the geometric structure and attribute information of the 3D seawater scene to obtain the physical properties of seawater, marine environmental parameters, and seawater geometric mesh structure;
[0064] Step S1.2: Divide the seawater geometric mesh structure into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map;
[0065] In this step, the seawater geometric mesh structure is divided into multiple regions and multiple levels to construct a seawater tile group. Specifically, the overall outline of the seawater scene is determined, and a minimum bounding volume is established as the 0th level seawater tile, i.e., the root node seawater tile. The 0th level seawater tile is divided into 8 sub-tiles of the same size. Empty tiles without geometric faces are removed, and the remaining sub-tiles are used as the 1st level seawater tiles. For each 1st level seawater tile, if its size is less than a threshold or the number of faces is less than a threshold, the subdivision is stopped; otherwise, the octree division continues, and finally an octree-optimized seawater tile group is formed.
[0066] In this step, the geometric outline (Bbox) of each layer of seawater tile is the bounding outline of the outermost layer of seawater geometry within that seawater tile; the material texture map of the seawater tile is the material, normal, specular, and foam texture map of the outermost layer of seawater surface within that seawater tile.
[0067] Step S1.3: Establish a logical association between the geometric contour Bbox of each seawater tile and the corresponding seawater tile attribute in the seawater physical properties based on the encoded value, specifically as follows:
[0068] The physical properties of seawater are broken down into sub-components and sub-regional properties. Sub-regions correspond to seawater tiles and are stored with the seawater region ID as a unique encoding value. The geometric outline Bbox of each seawater tile is also uniquely encoded with the corresponding seawater region ID, realizing a one-to-one association between the geometric outline Bbox of the seawater tile and the properties of the seawater tile.
[0069] Step S1.4: Store the texture map of the seawater tile material separately in the database, and write the texture map index information into the geometric outline Bbox of each seawater tile.
[0070] Step S2, configure the classification transmission service and seawater tile attribute query service:
[0071] Configure the seawater tile geometry outline Bbox transmission service and the seawater tile material texture map transmission service; configure the query service to obtain the corresponding seawater tile attributes by querying the seawater physical properties based on the encoded value;
[0072] Step S3, initial loading of the seawater scene on the front end:
[0073] When the front end first requests to load the seawater scene, it obtains the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; it obtains the corresponding seawater tile attributes, including geographic coordinates and spatial range, according to the seawater tile attribute query service; and it renders the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen.
[0074] Step S4, screen partitioning and seawater tile geometry outline Bbox assignment:
[0075] Step S4.1: Divide the screen into multiple screen partitions according to the screen rendering range. For example, divide it into 4 screen partitions: upper left screen partition, lower left screen partition, upper right screen partition, and lower right screen partition.
[0076] Step S4.2: Determine the current requested seawater tile geometric contour Bbox based on the distance and viewing angle relationship between the camera and the root node seawater tile geometric contour Bbox_0.
[0077] Step S4.3: Using the optimal allocation strategy, the geometric outline Bbox of the requested seawater tile is allocated to the corresponding screen partition;
[0078] As one implementation method, the optimal allocation strategy is as follows: under the current camera view, calculate the spatial coordinates of the geometric outline Bbox of each requested seawater tile; calculate the projection area of the tile onto the screen based on its spatial coordinates; calculate the overlap area between the projection area and each screen partition, and allocate the geometric outline Bbox of the seawater tile to the screen partition with the largest overlap area.
[0079] Step S5: Concurrent request for seawater tile geometric outline Bbox and sharing of material texture map:
[0080] Each screen partition, in its corresponding thread, concurrently and synchronously requests the corresponding seawater tile geometric outline Bbox through the seawater tile geometric outline Bbox transmission service, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory.
[0081] Step S6: The GPU implements multi-threaded parallel rendering.
[0082] Each screen partition renders the geometric outline (Bbox) of the seawater tile in its corresponding thread, reads the corresponding material texture map from shared memory, and completes the rendering of seawater effects with lighting, reflection, refraction, Fresnel, caustics, and underwater mist.
[0083] Therefore, by constructing rendering commands independently for each thread and reading textures from shared memory, the optical effects of seawater are rendered.
[0084] As one implementation method, when the GPU performs multi-threaded parallel rendering, it obtains the seawater physical properties of the corresponding seawater tile geometric outline Bbox through the seawater tile attribute query service according to business needs, including wind speed, wave height, period, flow direction, depth, and transparency.
[0085] There are two ways to obtain the properties of seawater tiles:
[0086] a. Request with encoded value:
[0087] The sea area ID is obtained directly through the geometric outline Bbox of the sea area tile. The sea area ID is used as the search condition to obtain the sea area tile attributes through the sea area tile attribute query service.
[0088] b. Request using spatial coordinates:
[0089] Input the spatial coordinates (X0,Y0,Z0) of the root node seawater tile geometric outline Bbox_0, and perform intersection judgment with the geometric outlines Bbox of each seawater tile loaded in the current view. Determine the intersecting seawater tiles and query the corresponding attributes through their seawater region ID.
[0090] The GPU parallel rendering module performs vertex displacement, FFT wave calculation, lighting calculation, reflection and refraction, Fresnel mapping, caustics, fogging, and multi-threaded rendering compositing, including:
[0091] FFT wave calculation unit is used to generate height field, normal field and displacement field based on wave spectrum;
[0092] Projection mesh generation unit, used to realize dynamic LOD meshes with low resolution at long distances and high resolution at close distances based on GPU;
[0093] The layered frustum culling unit is used for three-layer pre-clipping and octree spatial culling: above water, on the water surface, and underwater.
[0094] Optical rendering unit for reflection, refraction, Fresnel mapping, normal mapping, HDR, caustics, underwater fogging, foam, and wave composition;
[0095] The rendering queue unit is used to sort by material, shader, and rendering target to optimize rendering pipeline performance.
[0096] Step S7: When the camera zooms, rotates, or translates, update the distance and view relationship between the camera and the root node seawater tile geometric contour Bbox_0. Repeat steps S4 to S6. Improve loading efficiency through concurrent requests. Achieve continuous and fast scheduling and rendering of the seawater scene based on GPU shared memory and multi-threaded parallel rendering to maintain continuous and smooth scene loading.
[0097] This invention provides a GPU-accelerated 3D seawater simulation and rendering method, the aforementioned steps of which can be summarized as follows:
[0098] Step S1, Preprocessing of digital-to-analog separation of seawater model
[0099] Read the seawater model and separate the geometric mesh from attributes such as wind speed, wave height, period, current direction, depth, and transparency;
[0100] Construct an octree seawater tile group: with the entire seawater scene bounding box as the root node, divide it into 8 equal parts level by level, and remove empty tiles;
[0101] Each seawater tile generates a seawater tile geometric outline (Bbox) and a seawater tile material texture map;
[0102] Using the seawater region ID as a unique code, establish the association between the geometric outline (Bbox) of seawater tiles and the physical properties of seawater;
[0103] The texture map of the seawater tile is stored in the database, and the texture map index information is recorded in the geometric outline Bbox of the seawater tile.
[0104] Refer to Figure 2 for a schematic diagram of the disassembly principle of the octagonal tree seawater tile assembly:
[0105] Geometry layer: dynamic sea surface mesh; Attribute layer: seawater physical parameters and environmental parameters; Material layer: water surface texture, normals, foam, specular mapping. Multi-level seawater tiles are formed through octree subdivision, achieving fine detail in the foreground and simplification in the background.
[0106] Step S2, Configure Classified Transmission Service
[0107] Three types of services are provided: 1. Seawater tile geometric outline Bbox transmission service; 2. Seawater tile material texture map transmission service; 3. Attribute query service based on seawater region ID.
[0108] Step S3, initial loading of the seawater scene on the front end.
[0109] Request the geometric outline of the root node seawater tile (Bbox_0), obtain its spatial extent, and complete the initial rendering.
[0110] Step S4: Screen partitioning and seawater tile geometry outline Bbox allocation
[0111] The screen is divided into four partitions: top left, bottom left, top right, and bottom right; visible tiles are selected based on camera distance and viewing angle; the overlapping area of the tile projection with each screen partition is calculated and assigned to the optimal thread.
[0112] Step S5, concurrent requests and material sharing
[0113] Each thread concurrently requests the geometric outline (Bbox) of the seawater tile;
[0114] Parse the material index and query shared memory: 1. If it already exists, use it directly; 2. If it does not exist, request the texture and write it to shared memory; thus achieving texture loading once and reuse by multiple threads.
[0115] Step S6, GPU multi-threaded parallel rendering
[0116] Each thread executes independently: 1. Generate LOD mesh for the sea surface based on GPU projection mesh; 2. Perform parallel FFT calculations of wave height and normal fields; 3. Perform layered frustum culling (above water / on the surface / underwater); 4. Perform optical compositing: reflection, refraction, Fresnel, caustics, fogging, and foaming; 5. Merge the rendered output.
[0117] The GPU parallel rendering core includes:
[0118] 1. FFT wave simulation: Based on the Phillips wave spectrum, the GPU generates height, displacement, and normal fields in parallel; 2. GPU projection mesh: Dynamically generates smooth meshes based on the viewpoint, reducing the number of triangular faces; 3. Layered frustum culling: First, it is culled in layers according to above-water / water surface / underwater, and then octree culling is performed; 4. Optical rendering pipeline: Reflection texture, refraction texture, Fresnel weights, caustic maps, underwater depth fog, and wave animation are mixed and output; 5. Shared memory mechanism: Textures are loaded only once and read directly by multiple threads, significantly reducing bandwidth usage.
[0119] Step S7, Camera Dynamic Update
[0120] When scaling / translating / rotating, the visible tiles are recalculated, and S4–S6 are repeated to achieve smooth scheduling.
[0121] This invention also provides a GPU-accelerated 3D seawater simulation and rendering system, comprising:
[0122] The preprocessing module is used to perform digital-to-analog separation preprocessing on the seawater scene, including: separating the geometric structure and attribute information of the seawater scene to obtain seawater physical properties, marine environmental parameters, and seawater geometric structure; dividing the seawater geometric structure into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map; establishing a logical association between each seawater tile geometric outline Bbox and the corresponding seawater tile attribute in the seawater physical properties based on the encoding value; storing the seawater tile material texture map separately in a database, and writing material texture map index information into each seawater tile geometric outline Bbox;
[0123] The service configuration module is used to configure the classification transmission service and the seawater tile attribute query service, including: configuring the seawater tile geometric outline Bbox transmission service and the seawater tile material texture map transmission service; configuring the query service to query the physical properties of seawater based on the encoded value and obtain the corresponding seawater tile attributes;
[0124] The front-end loading module is used for the initial loading of the seawater scene, including: when the front-end requests to load the seawater scene for the first time, obtaining the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; obtaining the corresponding seawater tile attributes according to the seawater tile attribute query service, including geographic coordinates and spatial range; and rendering the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen.
[0125] The screen partitioning and allocation module is used for screen partitioning and seawater tile geometry outline Bbox allocation, including: dividing the screen into multiple screen partitions according to the screen rendering range; determining the seawater tile geometry outline Bbox that needs to be requested based on the distance and view relationship between the camera and the root node seawater tile geometry outline Bbox_0; and using the optimal allocation strategy to allocate the requested seawater tile geometry outline Bbox to the corresponding screen partition.
[0126] The concurrent request module is used for concurrent requests to the geometric outline Bbox of the seawater tile and the sharing of material texture maps. It includes: each screen partition concurrently and synchronously requests the corresponding geometric outline Bbox of the seawater tile through the seawater tile geometric outline Bbox transmission service in the corresponding thread, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory.
[0127] The GPU multi-threaded parallel rendering module is used to render the geometric outline (Bbox) of seawater tiles in the corresponding thread for each screen partition. It reads the corresponding material texture maps from shared memory to complete the rendering of seawater effects including lighting, reflection, refraction, Fresnel effects, caustics, and underwater misting, including:
[0128] The FFT wave calculation unit is used to generate height field, normal field, and displacement field based on the wave spectrum.
[0129] Projection mesh generation unit, used to realize dynamic LOD meshes with low resolution at long distances and high resolution at close distances based on GPU;
[0130] The layered frustum culling unit is used for three-layer pre-clipping and octree spatial culling: above water, on the water surface, and underwater.
[0131] Optical rendering unit for reflection, refraction, Fresnel mapping, normal mapping, HDR, caustics, underwater fogging, foam, and wave composition;
[0132] Render queue units are used to sort by material, shader, and render target to optimize rendering pipeline performance.
[0133] One implementation involves a scene manager that manages the scene graph, multiple cameras, multiple rendering queues with different priorities, and multiple light sources. The scene graph contains multiple scene nodes, which are organized using an octree structure. Specifically, scene nodes are assigned to pre-created surface scene nodes, underwater scene nodes, and above-water scene nodes based on the relationship between the bounding boxes of all scene nodes and the horizontal plane. Specifically, based on the intersection of the bounding boxes of scene nodes with the horizontal plane, if a scene node's bounding box intersects with the horizontal plane, it is assigned to the surface scene set; if the bounding box does not intersect with the horizontal plane, then the y-axis coordinate of the scene node is checked. If it is greater than 0, it is assigned to the surface scene node set; otherwise, it is assigned to the underwater scene node set.
[0134] Then recalculate the axis-aligned bounding boxes of these three scene nodes, and then perform octree spatial partitioning on these three bounding boxes until the number of nodes in each subspace does not exceed the specified maximum value; that is: limit the first level of the octree to three nodes: water scene node, water surface scene node and underwater scene node.
[0135] Before rendering, the scene manager pre-clips the scene nodes based on the viewpoint position: underwater scene nodes are clipping when the camera is above the water surface, and above-water scene nodes are clipping when the camera is below the water surface; after the octree pruning is completed based on the camera position, the remaining two scene nodes are then pruned using the octree pruning algorithm to perform view frustum pruning.
[0136] Therefore, based on the camera's view frustum and the existing nodes in the scene graph, a corresponding scene clipping algorithm is used to obtain the target nodes that need to be rendered. Then, based on the target nodes' characteristics such as transparency, the target nodes are added to the rendering queue. Next, the renderer's state is set according to the light source information, and finally, rendering is performed according to the priority of the rendering queue.
[0137] Furthermore, this invention proposes an algorithm that couples an FFT wave calculation unit and a hierarchical view frustum culling unit to achieve wave simulation:
[0138] Based on the hierarchical determination results of the layered view cone, the wave spectrum sampling resolution is adaptively adjusted:
[0139]
[0140] in: : Number of adaptive FFT spectrum sampling points for the current tile; The system presets the maximum number of high-precision sampling points. : Octtree LOD level decay coefficient; : Cone overlap efficiency; : Three-layer layering accuracy coefficient;
[0141] The calculation method is as follows:
[0142] Water surface layer, core rendering layer: Maintain full-precision FFT sampling to preserve wave and ripple details;
[0143] Above-water level, distant view level: Adaptive downsampling as the line of sight increases to simplify fine ripples;
[0144] Underwater layer, optical layer: It retains only the large wave undulations, weakens the micro ripples, and is suitable for underwater atomization and refraction effects;
[0145] Adaptive wave height field correction formula:
[0146]
[0147] in: : Adaptive correction of wave height field; Standard Phillips wave reference height field; : Cone overlap efficiency; : Current tile level, maximum subdivision level; : Hierarchical dynamic rejection threshold; Real-time regional wave height;
[0148] Dynamic removal threshold by layer Adaptive matching of wave amplitude; efficiency of view cone overlap Control the weight of visible tile wave details; achieve gradient wave simulation with detailed foreground and simplified background using LOD level coefficients;
[0149] Based on adaptive wave height field, normal field and displacement field with matching hierarchical accuracy are generated synchronously:
[0150]
[0151] in: Adaptive wave displacement field; Adaptive wave normal field; Wave displacement scaling factor; Gradient operator; : Layered normal accuracy correction coefficient, 1.0 for the surface layer, decreasing for the above-water and below-water layers.
[0152] Performance effects of the invention:
[0153] Under a standard PC configuration, this invention can achieve: 1. Real-time rendering of large-scale, infinite sea surfaces; 2. Stable frame rate of 70–125 FPS; 3. Loading speed increased by more than 300%; 4. Memory usage reduced by more than 50%; 5. Complete preservation of seawater physical properties and support for interactive querying; It can be directly deployed on digital twin platforms, web applications, simulation training systems, etc.
[0154] This invention is applicable to digital ocean and water conservancy engineering visualization; maritime simulation and ship driving training; marine disaster simulation and emergency simulation; smart city and waterfront landscape display; virtual reality, games, film and television special effects; and digital twin systems for marine engineering.
[0155] This invention achieves real-time, efficient, highly realistic, and low-resource rendering of large-scale seawater scenes through GPU acceleration, split-screen concurrency, shared memory, octree LOD, and layered rendering, and has significant engineering application value.
[0156] This invention has the following advantages:
[0157] 1. Fast rendering speed: GPU parallel computing + multi-threaded concurrent requests significantly improve loading and rendering efficiency; 2. High physical realism: Based on FFT wave spectrum simulation, waves are natural and dynamically stable; 3. Realistic image quality: Fully supports reflection, refraction, Fresnel, caustics, fog, foam, and spray; 4. Efficient scene scheduling: Octree + LOD + hierarchical frustum culling supports ultra-large-scale sea surfaces; 5. Low resource consumption: Shared memory avoids repeated loading, reducing VRAM and bandwidth consumption; 6. Complete attribute preservation: Geometry and attributes are stored separately and encoded in association, supporting querying and interaction; 7. Strong versatility: Supports client and web deployment, adapts to multiple platforms, and can be embedded in digital twin systems.
[0158] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A GPU-accelerated 3D seawater simulation and rendering method, characterized in that, include: Step S1, Preprocessing for digital model separation of the seawater scene: The geometric structure and attribute information of a 3D seawater scene are separated to obtain the physical properties of seawater, marine environmental parameters, and seawater geometric mesh structure. The seawater geometric mesh structure is divided into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map; Establish a logical association between the geometric contour (Bbox) of each seawater tile and the corresponding seawater tile attribute in the seawater physical properties based on the encoded value; The texture maps of the seawater tiles are stored separately in a database, and the texture map index information is written into the geometric outline Bbox of each seawater tile. Step S2, configure the classification transmission service and seawater tile attribute query service: Configure the seawater tile geometry outline Bbox transmission service and the seawater tile material texture map transmission service; configure the query service to obtain the corresponding seawater tile attributes by querying the seawater physical properties based on the encoded value; Step S3, initial loading of the seawater scene on the front end: When the front end first requests to load the seawater scene, it obtains the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; it obtains the corresponding seawater tile attributes, including geographic coordinates and spatial range, according to the seawater tile attribute query service; and it renders the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen. Step S4, screen partitioning and seawater tile geometry outline Bbox assignment: The screen is divided into multiple screen partitions according to the screen rendering range; the seawater tile geometry outline Bbox to be requested is determined based on the distance and view relationship between the camera and the root node seawater tile geometry outline Bbox_0; the optimal allocation strategy is adopted to allocate the requested seawater tile geometry outline Bbox to the corresponding screen partition. Step S5: Concurrent request for seawater tile geometric outline Bbox and sharing of material texture map: Each screen partition, in its corresponding thread, concurrently and synchronously requests the corresponding seawater tile geometric outline Bbox through the seawater tile geometric outline Bbox transmission service, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory. Step S6: The GPU implements multi-threaded parallel rendering. Each screen partition renders the geometric outline (Bbox) of the seawater tile in its corresponding thread, reads the corresponding material texture map from shared memory, and completes the rendering of seawater effects with lighting, reflection, refraction, Fresnel, caustics, and underwater mist.
2. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, The seawater geometric grid structure is divided into multiple regions and multiple levels to construct a seawater tile group, specifically: Determine the overall outline of the seawater scene and establish the minimum bounding volume as the level 0 seawater tile, i.e. the root node seawater tile; The 0th layer of seawater tiles is divided into 8 sub-tiles of the same size. Empty tiles without geometric surfaces are removed, and the remaining sub-tiles are used as the 1st layer of seawater tiles. For each first-level seawater tile, if its size is less than a threshold or the number of faces is less than a threshold, then the subdivision stops; otherwise, the octree partitioning continues, eventually forming an octree-optimized seawater tile group.
3. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, The geometric outline (Bbox) of each layer of seawater tile is the bounding outline of the outermost layer of seawater geometry within that seawater tile; the material texture map of the seawater tile is the material, normal, specular, and foam texture map of the outermost layer of seawater surface within that seawater tile.
4. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, Based on the encoded value, a logical association is established between the geometric contour (Bbox) of each seawater tile and the corresponding seawater tile attribute in the seawater physical properties, specifically as follows: The physical properties of seawater are broken down into sub-components and sub-regional properties. Sub-regions correspond to seawater tiles and are stored with the seawater region ID as a unique encoding value. The geometric outline Bbox of each seawater tile is also uniquely encoded with the corresponding seawater region ID, realizing a one-to-one association between the geometric outline Bbox of the seawater tile and the properties of the seawater tile.
5. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, The screen is divided into multiple screen partitions according to the screen rendering range, specifically into 4 screen partitions: the upper left screen partition, the lower left screen partition, the upper right screen partition, and the lower right screen partition.
6. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, Using the optimal allocation strategy, the requested seawater tile geometric outline (Bbox) is assigned to the corresponding screen partition, specifically as follows: From the current camera viewpoint, calculate the spatial coordinates of the geometric outline Bbox of each requested seawater tile; calculate the projection area of the Bbox onto the screen based on its spatial coordinates; calculate the overlap area between the projection area and each screen partition, and assign the geometric outline Bbox of the seawater tile to the screen partition with the largest overlap area.
7. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, When GPU implements multi-threaded parallel rendering, the physical properties of the seawater, including wind speed, wave height, period, flow direction, depth, and transparency, are obtained from the seawater tile attribute query service according to business requirements.
8. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, There are two ways to obtain the properties of seawater tiles: a. Request with encoded value: The sea area ID is obtained directly through the geometric outline Bbox of the sea area tile. The sea area ID is used as the search condition to obtain the sea area tile attributes through the sea area tile attribute query service. b. Request using spatial coordinates: Input the spatial coordinates (X0,Y0,Z0) of the root node seawater tile geometric outline Bbox_0, and perform intersection judgment with the geometric outlines Bbox of each seawater tile loaded in the current view. Determine the intersecting seawater tiles and query the corresponding attributes through their seawater region ID.
9. The GPU-accelerated 3D seawater simulation and rendering method according to claim 1, characterized in that, Also includes: Step S7: When the camera zooms, rotates, or translates, update the distance and view relationship between the camera and the geometric contour Bbox_0 of the root node seawater tile. Repeat steps S4 to S6. Improve loading efficiency through concurrent requests. Achieve continuous and fast scheduling rendering of the seawater scene based on GPU shared memory and multi-threaded parallel rendering.
10. A GPU-accelerated 3D seawater simulation and rendering system, characterized in that, A method for executing a GPU-accelerated 3D seawater simulation and rendering method according to any one of claims 1-9 includes: The preprocessing module is used to perform digital-to-analog separation preprocessing on the seawater scene, including: separating the geometric structure and attribute information of the seawater scene to obtain seawater physical properties, marine environmental parameters, and seawater geometric structure; dividing the seawater geometric structure into multiple regions and multiple levels to construct a seawater tile group; the seawater tile group includes multiple seawater tiles with hierarchical relationships; each seawater tile includes a seawater tile geometric outline Bbox and a seawater tile material texture map; establishing a logical association between each seawater tile geometric outline Bbox and the corresponding seawater tile attribute in the seawater physical properties based on the encoding value; storing the seawater tile material texture map separately in a database, and writing material texture map index information into each seawater tile geometric outline Bbox; The service configuration module is used to configure the classification transmission service and the seawater tile attribute query service, including: configuring the seawater tile geometric outline Bbox transmission service and the seawater tile material texture map transmission service; configuring the query service to query the physical properties of seawater based on the encoded value and obtain the corresponding seawater tile attributes; The front-end loading module is used for the initial loading of the seawater scene, including: when the front-end requests to load the seawater scene for the first time, obtaining the root node seawater tile geometric outline Bbox_0 through the seawater tile geometric outline Bbox transmission service; obtaining the corresponding seawater tile attributes according to the seawater tile attribute query service, including geographic coordinates and spatial range; and rendering the root node seawater tile geometric outline Bbox_0 at the corresponding position on the screen. The screen partitioning and allocation module is used for screen partitioning and seawater tile geometry outline Bbox allocation, including: dividing the screen into multiple screen partitions according to the screen rendering range; determining the seawater tile geometry outline Bbox that needs to be requested based on the distance and view relationship between the camera and the root node seawater tile geometry outline Bbox_0; and using the optimal allocation strategy to allocate the requested seawater tile geometry outline Bbox to the corresponding screen partition. The concurrent request module is used for concurrent requests to the geometric outline Bbox of the seawater tile and the sharing of material texture maps. It includes: each screen partition concurrently and synchronously requests the corresponding geometric outline Bbox of the seawater tile through the seawater tile geometric outline Bbox transmission service in the corresponding thread, parses the material texture map index information, and determines whether the corresponding material texture map exists in the shared memory. If it exists, it is used directly; otherwise, it requests the database and writes it to the shared memory. The GPU multi-threaded parallel rendering module is used to render the geometric outline (Bbox) of seawater tiles in the corresponding thread for each screen partition. It reads the corresponding material texture maps from shared memory to complete the rendering of seawater effects including lighting, reflection, refraction, Fresnel effects, caustics, and underwater misting, including: The FFT wave calculation unit is used to generate height field, normal field, and displacement field based on the wave spectrum. Projection mesh generation unit, used to realize dynamic LOD meshes with low resolution at long distances and high resolution at close distances based on GPU; The layered frustum culling unit is used for three-layer pre-clipping and octree spatial culling: above water, on the water surface, and underwater. Optical rendering unit for reflection, refraction, Fresnel mapping, normal mapping, HDR, caustics, underwater fogging, foam, and wave composition; Render queue units are used to sort by material, shader, and render target to optimize rendering pipeline performance. An algorithm for wave simulation combining FFT wave calculation units and hierarchical view frustum culling units: Based on the hierarchical determination results of the layered view cone, the wave spectrum sampling resolution is adaptively adjusted: ; in: : Number of adaptive FFT spectrum sampling points for the current tile; The system has a preset maximum number of high-precision sampling points. : Octtree LOD level decay coefficient; : Efficiency of cone overlap; : Three-layer layering accuracy coefficient; The calculation method is as follows: Water surface layer, core rendering layer: Maintain full-precision FFT sampling to preserve wave and ripple details; Above-water level, distant view level: Adaptive downsampling as the line of sight increases to simplify fine ripples; Underwater layer, optical layer: It retains only the large wave undulations, weakens the micro ripples, and is suitable for underwater atomization and refraction effects; Adaptive wave height field correction formula: ; in: : Adaptive correction of wave height field; Standard Phillips wave reference height field; : Cone overlap efficiency; : Current tile level, maximum subdivision level; : Hierarchical dynamic rejection threshold; Real-time regional wave height; Dynamic removal threshold by layer Adaptive matching of wave amplitude; efficiency of view cone overlap Control the weight of visible tile wave details; achieve gradient wave simulation with detailed foreground and simplified background using LOD level coefficients; Based on adaptive wave height field, normal field and displacement field with matching hierarchical accuracy are generated synchronously: ; in: Adaptive wave displacement field; Adaptive wave normal field; Wave displacement scaling factor; Gradient operator; : Layered normal accuracy correction coefficient, 1.0 for the surface layer, decreasing for the above-water and below-water layers.