Method and system for dynamically generating river channel model based on unreal engine
By analyzing the river geographic information data to generate association files and using Unreal Engine to build a river model, combining block processing and ray detection technology, the problems of low rendering performance and difficulty in dynamic update of river models in three-dimensional visual scenes are solved, and efficient river information display and interaction are achieved.
Patent Information
- Application Number
- CN202510499092.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-21
AI Technical Summary
In three-dimensional visualization scenarios, the rendering efficiency of the river channel model is low, the interactive function is missing and dynamic updates are difficult. Especially in Unreal Engine, when the number of models exceeds 10,000, the rendering performance is significantly reduced, and the existing technology cannot support real-time updates of massive data.
By obtaining the geographic information data of the river channel, analyzing and generating related files, using Unreal Engine to build a river channel model, and using block processing and ray detection technology to achieve dynamic update of the color of the river channel model.
It improves the rendering performance and dynamic update capabilities of a large amount of river information in Unreal Engine, supports real-time color updates of millions of vertices models, and improves user interaction experience.
Smart Images

Figure CN120495550A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics processing, and in particular to a method and system for dynamically generating a river model based on an Unreal Engine. Background Art
[0002] In 3D visualization scenarios, the dynamic rendering and interactive display of river models face the following technical bottlenecks: Rendering efficiency is low. Existing technologies, such as individual model loading, particle effects, and instancing, are limited by the number of DrawCalls in Unreal Engine UE. When the number of models exceeds 10,000, rendering performance degrades significantly. Interaction is also lacking. Particle effects cannot support mouse click interaction, while instancing requires completely consistent model styles, failing to meet the diverse demands of river morphology. Dynamic updates are difficult. Existing technologies, such as GeometryScript, only support small-scale models (e.g., those with fewer than 10,000 vertices) when updating vertex colors, making it difficult to handle the real-time updates of massive amounts of data. Summary of the Invention
[0003] In order to solve the technical problems existing in the background technology, the present invention proposes a method and system for dynamically generating a river model based on Unreal Engine.
[0004] The present invention proposes a method for dynamically generating a river model based on Unreal Engine, comprising: Obtaining geographic information data of one or more river channels, and parsing the river channel geographic information data to generate associated files, wherein the associated files include a vertex position file, a face vertex index file, a face and river channel ID mapping file, and a river channel vertex set file; Using the Unreal Engine to dynamically construct one or more river models corresponding to one or more river geographic information data based on the vertex coordinate file and the triangle vertex index file; Output the overall model of a river channel or merge multiple river channel models into an overall model.
[0005] Preferably, the river channel geographic information data includes the geometric coordinates of the river channel and river channel associated attribute information; the geometric coordinates of the river channel are specifically a set of lines or line segments composed of longitude and latitude; the river channel associated attribute information includes but is not limited to river channel ID, name, flow, and water level.
[0006] Preferably, parsing the river geographic information data to generate an associated file specifically includes: Expand the line segments in the geometric coordinates of the river channel into patches to generate vertex position files and patch vertex index files; A mapping relationship between the face patch and the river channel ID in the attribute information associated with the river channel is established, and the vertex ID sequence contained in each river channel is recorded to obtain a face patch and river channel ID mapping file and a river channel vertex set file.
[0007] Preferably, the vertex position file is in the format Record the three-dimensional coordinates of each vertex; the patch vertex index file is in the format Record the counterclockwise sorting index of the vertices of each face; the face and river ID mapping file is in the format Establish a unique identification association between the surface and the river channel to which it belongs; The river vertex set file is in the format Store all vertex ID sequences contained in each river channel; Among them, RiverID represents the number of each river; PointID represents the number of each vertex in the river model; PlaneID represents the number of each surface in the river model.
[0008] Preferably, the method of dynamically constructing a river model corresponding to the river geographic information data using the Unreal Engine according to the vertex coordinate file and the triangle vertex index file specifically includes: Load the PointID coordinates in the vertex position file of a single river channel as the vertex set of the model, and generate a patch sequence based on the Point0, Point1, and Point2 vertex indices corresponding to the PlaneID in the patch vertex index file; Create a color array ColorArray for all vertices, and set the initial color value to a uniform default value; The PlaneID, RiverID in the patch and river mapping file and the vertex ID sequence in the river vertex mapping file are loaded into memory, and a chain index relationship between the PlaneID, RiverID and vertex ID sequence is established to obtain the corresponding river model.
[0009] Preferably, when dynamically constructing one or more river models corresponding to one or more river geographic information data, the river models whose vertex number exceeds the set threshold are divided into blocks and split into multiple sub-model blocks; each sub-model block independently loads the vertex position file and the patch vertex index file, and maintains an independent PlaneID, RiverID, and vertex ID sequence index relationship; when updating the color array in blocks, each sub-model block is asynchronously updated at a preset time interval.
[0010] Preferably, when dynamically constructing one or more river models corresponding to one or more river geographic information data, the river models whose vertex number exceeds the set threshold are divided into blocks and split into multiple sub-model blocks; each sub-model block independently loads the vertex position file and the patch vertex index file, and maintains an independent PlaneID, RiverID, and vertex ID sequence index relationship; when updating the color array in blocks, each sub-model block is asynchronously updated at a preset time interval.
[0011] The present invention proposes a river model dynamic generation system based on Unreal Engine, comprising: A data parsing module is used to obtain geographic information data of one or more river channels and parse the river channel geographic information data to generate associated files, wherein the associated files include a vertex position file, a patch vertex index file, a face and river channel ID mapping file, and a river channel vertex set file; A model construction module is used to dynamically construct one or more river channel models corresponding to one or more river channel geographic information data using the Unreal Engine according to the vertex coordinate file and the triangle vertex index file; The model integration module is used to output the overall model of a river channel or merge multiple river channel models into an overall model.
[0012] This paper proposes a method and system for dynamically generating river models based on Unreal Engine. By analyzing river geographic information data to dynamically generate a single integrated model, the system utilizes vertex color arrays to visualize attribute data. Combining block processing with ray detection technology, the system addresses the technical challenges of low rendering performance, poor dynamic update efficiency, and high interaction latency for large-scale river models. This improves the rendering performance and dynamic update capabilities of Unreal Engine for displaying large amounts of river information. The block update mechanism supports real-time color updates for models with millions of vertices, enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a schematic diagram of the workflow structure of a method for dynamically generating a river model based on Unreal Engine proposed by the present invention; Figure 2 This is a schematic diagram of the structure of the river channel geographic information data query process of the river channel model dynamic generation method based on Unreal Engine proposed by the present invention; Figure 3 A schematic diagram of a process for dynamically updating and displaying data of a river model according to a method for dynamically generating a river model based on Unreal Engine proposed by the present invention; Figure 4 This is a schematic diagram of the river model generation process structure of a river model dynamic generation method based on Unreal Engine proposed by the present invention; Figure 5This is a logical diagram of ray detection and face ID query for a dynamic generation method of river channel model based on Unreal Engine proposed by the present invention; Figure 6 This is a schematic diagram of a single river channel segment structure of a method for dynamically generating a river channel model based on Unreal Engine proposed by the present invention; Figure 7 A schematic diagram of a single river channel model according to a method for dynamically generating a river channel model based on Unreal Engine proposed by the present invention; Figure 8 This is a schematic diagram of a river channel example of a method for dynamically generating a river channel model based on Unreal Engine proposed by the present invention; Figure 9 The present invention proposes a method for dynamically generating a river model based on Unreal Engine. Figure 8 Schematic diagram of the corresponding river channel model structure; Figure 10 This is a thermal distribution diagram of the dynamic generation method of river model based on Unreal Engine proposed by the present invention. DETAILED DESCRIPTION
[0014] Reference Figure 1-10 The present invention proposes a method for dynamically generating a river model based on Unreal Engine, comprising the following steps: S1: Obtain geographic information data of one or more river channels, and parse the river channel geographic information data to generate associated files. The associated files include vertex position files, patch vertex index files, face and river channel ID mapping files, and river channel vertex set files.
[0015] In this embodiment, the river channel geographic information data includes the geometric coordinates of the river channel and river channel-related attribute information; the geometric coordinates of the river channel are specifically a set of lines or line segments composed of longitude and latitude; the river channel-related attribute information includes but is not limited to river channel ID, name, flow, and water level.
[0016] In this embodiment, the river geographic information data is parsed to generate an associated file, specifically including: Expand the line segments in the geometric coordinates of the river channel into patches to generate vertex position files and patch vertex index files; A mapping relationship between the face patch and the river channel ID in the attribute information associated with the river channel is established, and the vertex ID sequence contained in each river channel is recorded to obtain a face patch and river channel ID mapping file and a river channel vertex set file.
[0017] In this embodiment, the vertex position file is in the format Record the three-dimensional coordinates of each vertex; the patch vertex index file is in the format Record the counterclockwise sorting index of the vertices of each face; the face and river ID mapping file is in the format Establish a unique identification association between the surface and the river channel to which it belongs; River vertex collection file format Store all vertex ID sequences contained in each river channel; Among them, RiverID represents the number of each river; PointID represents the number of each vertex in the river model; PlaneID represents the number of each surface in the river model.
[0018] Specifically, we output all the point and facet information of each river channel into a txt file. The content that needs to be saved is as follows: Vertex location file PointsLocation: The location of each point number, the format is as follows: PointID, X, Y, Z, that is, each point number, point X value, point Y value, point Z value.
[0019] PlaneID2Point: The vertices of each triangle are sorted counterclockwise in the following format: PlaneID, Point0, Point1, Point2, i.e. the number of each face, the number of point 0 on the face, the number of point 1 on the face, and the number of point 2 on the face.
[0020] PlaneID2RiverID: The river ID corresponding to each triangular face is in the following format: PlaneID, RiverID, the number of each face, and the river ID to which it belongs.
[0021] River vertex collection file RIverID2Points: The vertex corresponding to each river ID is in the following format: RiverID, Point0, Point1, Point2, Point3... In this embodiment, the river geographic information data is the Geojson data of the river. The Geojson data content of each river is as follows: River channel 1, point 1 [longitude, latitude], point 2 [longitude, latitude], point 3 [longitude, latitude]..... S2: Using the Unreal Engine, dynamically construct one or more river models corresponding to one or more river geographic information data according to the vertex coordinate file and the triangle vertex index file.
[0022] In this embodiment, Unreal Engine is used to dynamically construct a river model corresponding to the river geographic information data based on the vertex coordinate file and the triangle vertex index file, specifically including: Use Unreal Engine UE to load the PointID coordinates in the vertex position file of a single river channel as the vertex set of the model, and generate a patch sequence based on the Point0, Point1, and Point2 vertex indices corresponding to the PlaneID in the patch vertex index file; Create a color array ColorArray for all vertices, and set the initial color value to a uniform default value; The PlaneID, RiverID in the patch and river mapping file and the vertex ID sequence in the river vertex mapping file are loaded into memory, and a chain index relationship between the PlaneID, RiverID and vertex ID sequence is established to obtain the corresponding river model.
[0023] Specifically, if Figure 6 and Figure 7 As shown in the figure, each river channel data has N points, and N points are connected into a line to represent the river channel. The spline is extended to both sides using the angle dividing line method to obtain the river channel model. After the line is extended, there are 8 points and 6 triangles. Figure 7 You can see the construction information of each triangle as follows: Triangle 0: 1, 0, 3; Triangle No. 1: 3, 2, 5 And so on.
[0024] Each face is composed of 3 vertices, and the facet information is the counterclockwise sequence of the 3 vertices on the face.
[0025] In this embodiment, when dynamically constructing one or more river models corresponding to one or more river geographic information data, the river models whose vertices exceed the set threshold are divided into blocks and split into multiple sub-model blocks; each sub-model block independently loads the vertex position file and the patch vertex index file, and maintains an independent PlaneID, RiverID, and vertex ID sequence index relationship; when updating the color array in blocks, each sub-model block is asynchronously updated at a preset time interval.
[0026] like Figure 8 and Figure 9 As shown in the figure, it contains 10,484 rivers, and after extrusion, the generated model has 20,967 points. If the number of points is larger, the model can be divided into blocks. For example, if there are 500,000 points, it can be divided into 5 blocks, each with 100,000 points.
[0027] In this embodiment, the ProceduralMesh component of the Unreal Engine is used to dynamically create a river model.
[0028] S3: Output the overall model of a river channel or merge multiple river channel models into an overall model.
[0029] In this embodiment, it also includes: S4: Normalize the values corresponding to the flow and water level in the river channel attribute information to the range of 0-1, convert them into RGB values through the heat map color mapping algorithm, and update the vertex color array of the corresponding river channel.
[0030] In this embodiment, the data storage content of the river channel is: river channel ID and corresponding value. The data of river channel 0 is set to 0.5, and the data of river channel 1 is set to 1. The data is as follows: RiverID,Value: 0,0.5, 1,1; If the data is not from 0 to 1, then we normalize it according to the set range.
[0031] For example, the data for river channel 0 is 100, and the data for river channel 1 is 150. Map 0 to 1 based on the range 100 to 200 and substitute it into the formula: Alpha = (Value-Min) / (Max-Min); the data for river channel 0 is 0; the data for river channel 1 is 0.5.
[0032] like Figure 10 As shown, referring to the style of the heat map, different values correspond to different color distributions. Similarly, color judgment can also be made based on the size of the data. From left to right, the distribution is from 0 to 1, and the colors are from blue to green to yellow to red. According to the R value in the vertex color RGBA, the color transition value is taken. When R is 0, the color is blue; when R is 1, the color is red; the same applies to the middle. Therefore, we set the values 0 to 7 in the ColorArray data to 0.5, corresponding to yellow; and the values 8 to 13 in the data are set to 1, corresponding to red.
[0033] S5: Obtain the PlaneID of the patch where the user clicks through ray detection, locate the target river vertex based on the PlaneID, RiverID, and vertex ID sequence index, modify the color value of the target river vertex, and render and update it in real time.
[0034] Specifically, if Figure 5 As shown, ray detection creates a ray from its starting point to its end point and then returns the data for the first model it triggers. From the mouse position and based on the mouse direction, ray AB is created, traveling from A to B. When ray AB contacts the blue model, data related to the blue model and point C is returned, including but not limited to: the model name, the face number of point C at impact, the coordinates of point C at impact, and the normal of point C at impact.
[0035] In this embodiment, model construction consumes minimal performance. The model generated by this invention consumes performance only at the moment of model construction. After completion, rendering it into the scene consumes no CPU computation, only GPU rendering power. Testing has shown that it can support rendering models with at least 200 million faces in a single scene, while maintaining a frame rate exceeding 20 FPS. GeometryScript solutions, which can also update model data, can only update models with 10,000 vertices at a time. This invention can simultaneously update the color and recreate a model with 100,000 vertices. If a model has 1 million vertices, it can be divided into 10 models with 100,000 vertices each, and the invention can still be used for model display and data updates. Each update can be performed with a 0.1-second interval, without affecting the interactive experience. This means that it can simultaneously support updates to models with millions of vertices. Dynamic updates of each river channel model data are supported. By querying the unique ID of each river channel, the corresponding vertices can be calculated. As long as the previous data is intact, data queries are error-free. Furthermore, the display style is controlled by the data of each vertex, so the color style can be updated by modifying the corresponding vertex color. The number of models is small. This invention only builds a single model from beginning to end. If a model solution is generated for each river channel, there will be multiple models in the solution of one model for each river channel. If there are 100,000 river channel data, there will be 100,000 models, which will have a high rendering performance overhead.
[0036] From mouse interaction to face recognition, to querying the river ID, to querying the river vertex, and finally setting the vertex color, the entire process is complete and clear, with a clear goal. The mouse-click face recognition solution supports models with up to 100,000 vertices and any size, making it an excellent solution for interactive recognition.
[0037] Reference Figure 1-10 The present invention proposes a river model dynamic generation system based on Unreal Engine, comprising: A data parsing module is used to obtain geographic information data of one or more river channels and parse the river channel geographic information data to generate associated files, which include vertex position files, patch vertex index files, face and river channel ID mapping files, and river channel vertex set files; A model construction module is used to dynamically construct one or more river channel models corresponding to one or more river channel geographic information data using the Unreal Engine according to the vertex coordinate file and the triangle vertex index file; The model integration module is used to output the overall model of a river channel or merge multiple river channel models into an overall model.
[0038] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for dynamically generating a river model based on Unreal Engine, characterized in that: include: Obtaining geographic information data of one or more river channels, and parsing the river channel geographic information data to generate associated files, wherein the associated files include a vertex position file, a face vertex index file, a face and river channel ID mapping file, and a river channel vertex set file; Using the Unreal Engine to dynamically construct one or more river models corresponding to one or more river geographic information data based on the vertex coordinate file and the triangle vertex index file; Output the overall model of a river channel or merge multiple river channel models into an overall model.
2. The method for dynamically generating a river model based on Unreal Engine according to claim 1, characterized in that: The river channel geographic information data includes the geometric coordinates of the river channel and river channel related attribute information; the geometric coordinates of the river channel are specifically a set of lines or line segments composed of longitude and latitude; the river channel related attribute information includes but is not limited to river channel ID, name, flow, and water level.
3. The method for dynamically generating a river model based on Unreal Engine according to claim 2, wherein: The parsing of the river geographic information data to generate an associated file specifically includes: Expand the line segments in the geometric coordinates of the river channel into patches to generate vertex position files and patch vertex index files; A mapping relationship between the face patch and the river channel ID in the attribute information associated with the river channel is established, and the vertex ID sequence contained in each river channel is recorded to obtain a face patch and river channel ID mapping file and a river channel vertex set file.
4. The method for dynamically generating a river model based on Unreal Engine according to claim 2, wherein: The vertex position file is in the format Record the three-dimensional coordinates of each vertex; the patch vertex index file is in the format Record the counterclockwise sorting index of the vertices of each face; the face and river ID mapping file is in the format Establish a unique identification association between the surface and the river channel to which it belongs; The river vertex set file is in the format Store all vertex ID sequences contained in each river channel; Among them, RiverID represents the number of each river; PointID represents the number of each vertex in the river model; PlaneID represents the number of each surface in the river model.
5. The method for dynamically generating a river model based on Unreal Engine according to claim 4, characterized in that: The method of dynamically constructing a river model corresponding to the river geographic information data using the Unreal Engine according to the vertex coordinate file and the triangle vertex index file specifically includes: Load the PointID coordinates in the vertex position file of a single river channel as the vertex set of the model, and generate a patch sequence based on the Point0, Point1, and Point2 vertex indices corresponding to the PlaneID in the patch vertex index file; Create a color array ColorArray for all vertices, and set the initial color value to a uniform default value; The PlaneID, RiverID in the patch and river mapping file and the vertex ID sequence in the river vertex mapping file are loaded into memory, and a chain index relationship between the PlaneID, RiverID and vertex ID sequence is established to obtain the corresponding river model.
6. The method for dynamically generating a river model based on Unreal Engine according to claim 5, characterized in that: When dynamically constructing one or more river models corresponding to one or more river geographic information data, the river models whose vertex number exceeds the set threshold are divided into blocks and split into multiple sub-model blocks; each sub-model block independently loads the vertex position file and the patch vertex index file, and maintains an independent PlaneID, RiverID, and vertex ID sequence index relationship; when updating the color array in blocks, each sub-model block is asynchronously updated at a preset time interval.
7. The method for dynamically generating a river model based on Unreal Engine according to claim 4, characterized in that: Also includes: Normalize the values corresponding to the flow and water level in the river channel attribute information to the range of 0-1, convert them into RGB values through the heat map color mapping algorithm, and update the vertex color array of the corresponding river channel; The PlaneID of the patch hit by the user's click is obtained through ray detection. The target river vertex is located based on the PlaneID, RiverID, and vertex ID sequence index. The color value of the target river vertex is modified and rendered and updated in real time.
8. A river model dynamic generation system based on Unreal Engine, characterized in that: include: A data parsing module is used to obtain geographic information data of one or more river channels and parse the river channel geographic information data to generate associated files, wherein the associated files include a vertex position file, a patch vertex index file, a face and river channel ID mapping file, and a river channel vertex set file; A model construction module is used to dynamically construct one or more river channel models corresponding to one or more river channel geographic information data using the Unreal Engine according to the vertex coordinate file and the triangle vertex index file; The model integration module is used to output the overall model of a river channel or merge multiple river channel models into an overall model.
Citation Information
Patent Citations
Three-dimensional oblique photography data processing method, device and equipment based on unreal engine
CN113900797A
Model construction method based on unreal engine, electronic equipment and storage medium
CN115409960A
Thermodynamic diagram construction method based on unreal engine, electronic equipment and storage medium
CN115409961A
Method and device suitable for three-dimensional visualization of vector data by unreal engine and medium
CN116310170A
Virtual model processing method and device, computer equipment and storage medium
CN117197307A