CN111932662A - Real-time drawing method and system for mass three-dimensional ground-attaching trails - Google Patents

Real-time drawing method and system for mass three-dimensional ground-attaching trails Download PDF

Info

Publication number
CN111932662A
CN111932662A CN202010767626.0A CN202010767626A CN111932662A CN 111932662 A CN111932662 A CN 111932662A CN 202010767626 A CN202010767626 A CN 202010767626A CN 111932662 A CN111932662 A CN 111932662A
Authority
CN
China
Prior art keywords
terrain
data
line segment
trail
grid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010767626.0A
Other languages
Chinese (zh)
Other versions
CN111932662B (en
Inventor
占伟伟
袁思佳
蒉露超
王辉
李佳祺
郑瑞杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 28 Research Institute
Original Assignee
CETC 28 Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CETC 28 Research Institute filed Critical CETC 28 Research Institute
Priority to CN202010767626.0A priority Critical patent/CN111932662B/en
Publication of CN111932662A publication Critical patent/CN111932662A/en
Application granted granted Critical
Publication of CN111932662B publication Critical patent/CN111932662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Abstract

The invention provides a real-time drawing method and a real-time drawing system for a large number of three-dimensional ground-attaching trails, aiming at a large number of trail points generated by various situation targets in real time in a battlefield environment simulation process, finding a trail needing ground wire attachment updating through screening and comparison, organizing trail data and terrain grid data by utilizing a multithreading technology, and then carrying out terrain grid interpolation calculation on trail segments by utilizing a cuda parallel calculation technology to obtain the ground-attaching trail. The invention can realize real-time drawing of mass three-dimensional ground-sticking traces in the simulation process of battlefield environment, and compared with a mode of directly using CPU interpolation, the invention can reduce interpolation calculation on the basis of ensuring ground-sticking effect, obviously improve calculation and drawing efficiency and make the simulation process of battlefield environment smoother.

Description

Real-time drawing method and system for mass three-dimensional ground-attaching trails
Technical Field
The invention belongs to the field of computer graphics, and particularly relates to a real-time drawing method and system for mass three-dimensional ground-attached trails.
Background
In order to express the motion states of various situation targets in a three-dimensional battlefield environment simulation system, trails are required to be used as auxiliary rendering elements to visually reflect the motion tracks of the situation targets, the movement intentions of the targets are predicted, and the like, so that the three-dimensional battlefield environment simulation system plays an important role in battlefield environment simulation and auxiliary decision making. The motion of the three-dimensional situation target is expressed as a batch of trail point data received by the simulation system, and the trail points are subjected to various modification processing in the drawing of the three-dimensional scene and are displayed in the form of various trail lines. For a situation target on the ground, the motion track of the situation target is necessarily generated along the fluctuation of the terrain, and the matching with the terrain data cannot be completely guaranteed only by fitting the tail point of the target. Therefore, in order to make the display effect of the three-dimensional battlefield environment simulation system more real and beautiful, on the premise of constructing the basic terrain environment by using terrain data, the trail line of the situation target needs to be subjected to ground-to-ground interpolation calculation to obtain the intersection point of the situation target and the current terrain grid, so as to form a new trail point set. Therefore, the drawing of the tail trace line can better ensure the matching of the tail trace line and the relief state.
The situation target number in the battlefield environment simulation system may be relatively large, the number of the generated trail points can be continuously increased along with the progress of the simulation process, and the number of the trail points needing to be drawn in the full trail mode is also large. Under the condition, if the traditional method is adopted, the CPU is directly used for carrying out the ground wire interpolation calculation, more time is needed, the rendering efficiency is very low, even if the multithreading is used for carrying out the calculation, the calculation is limited by the number of the CPU cores, and the requirement of real-time drawing cannot be met when the data volume reaches a certain degree.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the problems of jamming, low frame rate, slow refreshing and the like when massive situation target ground-attached trails are rendered in the conventional three-dimensional battlefield environment simulation system, the invention provides a real-time drawing method of massive three-dimensional ground-attached trails, which comprises the following steps:
step 1, request screening and submission: screening a situation target needing to be updated in the three-dimensional scene, and constructing an updating request; traversing situation target trail in the current three-dimensional scene, comparing the situation target trail with cache data according to the index of a terrain grid rendered in the current three-dimensional scene, and screening out the ground-attaching trail which needs to be updated due to terrain change; screening out the ground-attaching trail which needs to be subjected to terrain grid interpolation according to whether the trail point changes, and submitting an updating request;
step 2, the update request is deduplicated, and the existing request is filtered; screening out line segments needing to be updated according to the trail cache information, processing the trail data of the line segments and the terrain grid data into data streams, and submitting the data streams to a ground wire computing thread; the multithreading technology is adopted, the request processing is carried out in the auxiliary thread, and the rendering efficiency is prevented from being influenced by the blocking of the rendering thread;
step 3, ground wire interpolation: performing ground wire interpolation calculation by adopting a cuda parallel calculation technology based on the data stream obtained in the step 2, allocating GPU resources according to calculation requirements, submitting the processed data to a GPU, and enabling the GPU to perform interpolation calculation; and (4) performing intersection interpolation calculation on the line segments screened in the step (2) and the terrain grids to obtain an interpolation result, and calculating the ground-attaching tail trace which accords with the terrain relief rule.
The step 1 comprises the following steps:
step 1-1, performing visibility judgment on a situation target in a three-dimensional scene, wherein only the current visible target needs to be processed, and the invisible target is not processed;
step 1-2, obtaining an index of a terrain grid used for rendering a current three-dimensional scene, establishing the index of the three-dimensional scene terrain grid according to a form of a hierarchy line column, comparing the index with the terrain grid index in a cache, judging whether the terrain in the three-dimensional scene changes, updating a ground tail only when the terrain changes, and not updating when the terrain does not change;
step 1-3, judging whether a situation target with changed trail points exists or not, and updating the changed situation target by pasting the trail points;
and step 1-4, screening out objects needing to be updated according to the processing of the step 1-1 to the step 1-3, and constructing an updating request.
The step 2 comprises the following steps:
step 2-1, maintaining a request queue for managing the update request constructed in step 1, comparing the update request constructed in step 1 with the requests stored in the request queue, judging whether a repeat request exists, filtering the repeat request, and updating the request queue;
step 2-2, performing subsequent calculation by using topographic data used for drawing a current scene acquired from the three-dimensional scene, obtaining topographic grid data according to a current topographic grid index, writing geographic coordinates of each vertex of the topographic grid into a data stream in a form of longitude-latitude-elevation values, storing the geographic coordinates of one vertex by three floating point numbers, namely the longitude, the latitude and the elevation of the vertex, and storing all the vertex coordinates in an array for submitting the calculation in the step 3;
and 2-3, after finishing updating the tail trace of the point pasting each time, storing coordinates of a starting point and an end point of the line segment and a terrain grid index intersected with the line segment in a tail trace cache. When an update request in a request queue is processed, obtaining a control point line segment set according to a trail control point of a situation target in the update queue, obtaining a terrain grid index intersected with a line segment at present, comparing the terrain grid index with a trail cache, judging whether a terrain grid related to the line segment changes, and if so, performing terrain grid interpolation calculation on the line segment again;
step 2-4, the top points of the line segments screened in the step 2-3 are written into a data stream in a form of longitude-latitude, one top point geographic coordinate is stored in two floating point numbers, the top point geographic coordinate is respectively the longitude and the latitude, and all the top point coordinates are stored in an array and are used for submitting calculation in the step 3;
step 2-5, submitting the terrain data stream and the tail trace segment data stream to step 3 for calculation;
and 2-6, updating the request queue.
The step 3 comprises the following steps:
step 3-1, after receiving the terrain grid data and the trail segment coordinate data in the trail segment data stream transmitted in the step 2, distributing GPU computing threads according to the number of the segments, and when the number of the segments is n, setting the size of a thread block to be 1024 and the size of a thread grid to be (n + 1024-1)/1024; n is a natural number;
step 3-2, submitting the coordinate data of the control points and the terrain grid data to a GPU by adopting a cuda parallel computing technology;
and 3-3, executing a calculation process in the GPU, taking interpolation of each line segment as an independent calculation process, and constructing a linear equation (y-y1)/(y1-y2) (x-x1)/(x1-x2) according to geographical coordinates of a starting point and an ending point of the line segment, wherein x and y respectively represent longitude and latitude of any point of the line segment, x1 and y1 respectively represent longitude and latitude of the starting point of the line segment, x2 and y2 respectively represent longitude and latitude of the ending point of the line segment, and intersection points of the line segment and all triangles in the terrain grid are calculated to form an interpolation coordinate set together with the starting point and the ending point of the line segment to form a complete ground-attached trail so that the trail can be fully matched with terrain fluctuation.
The invention also provides a real-time drawing system of the mass three-dimensional ground-attached trail, which comprises a data scheduling module, a data organizing module and a ground wire calculation module;
the data scheduling module is executed by a CPU rendering thread and is used for screening a situation target needing to be updated in a three-dimensional scene, constructing an updating request and submitting the updating request to the data organization module;
the data organization module is executed by a CPU auxiliary thread and is used for carrying out duplication removal on the updating request and filtering the existing request; screening out line segments needing to be updated according to trail cache information, processing terrain grid data and line segment control point information data into data streams, and submitting the data streams to a ground wire calculation module;
the ground wire sticking calculation module is executed by a CPU auxiliary thread and a GPU, based on the data stream obtained in the step 2, the ground wire sticking interpolation calculation is carried out by adopting a cuda parallel calculation technology, GPU resources are distributed according to calculation requirements, the processed data are submitted to the GPU, and the GPU carries out interpolation calculation; and performing intersection interpolation calculation according to the screened line segments and the terrain grids to obtain an interpolation result, and calculating the ground tail trace which accords with the terrain relief rule.
The data scheduling module specifically executes the following steps:
step 1-1, performing visibility judgment on a situation target in a three-dimensional scene, wherein only the current visible target needs to be processed, and the invisible target is not processed;
step 1-2, obtaining an index of a terrain grid used for rendering a current three-dimensional scene, establishing the index of the three-dimensional scene terrain grid according to a form of a hierarchy line column, comparing the index with the terrain grid index in a cache, judging whether the terrain in the three-dimensional scene changes, updating a ground tail only when the terrain changes, and not updating when the terrain does not change;
step 1-3, judging whether a situation target with changed trail points exists or not, and updating the changed situation target by pasting the trail points;
and step 1-4, screening out objects needing to be updated according to the processing of the step 1-1 to the step 1-3, and constructing an updating request.
The data organization module specifically executes the following steps:
step 2-1, maintaining a request queue for managing the update request constructed in step 1, comparing the update request constructed in step 1 with the requests stored in the request queue, judging whether a repeat request exists, filtering the repeat request, and updating the request queue;
step 2-2, performing subsequent calculation by using topographic data used for current scene drawing acquired from the three-dimensional scene, obtaining topographic grid data according to a current topographic grid index, and writing the geographic coordinates of each vertex of the topographic grid into a data stream in a form of longitude-latitude-elevation values;
and 2-3, after finishing updating the tail trace of the point pasting each time, storing coordinates of a starting point and an end point of the line segment and a terrain grid index intersected with the line segment in a tail trace cache. When an update request in a request queue is processed, obtaining a control point line segment set according to trail control points of situation targets in the update queue, calculating to obtain a terrain grid index intersected with a line segment at present, comparing the terrain grid index with a trail cache, judging whether a terrain grid related to the line segment changes according to the current terrain grid index, and if so, performing terrain grid interpolation calculation on the line segment again;
step 2-4, writing the top points of the line segments screened in the step 2-3 into a data stream in a form of longitude-latitude;
step 2-5, storing the terrain data stream and the tail trace segment data stream for subsequent calculation;
and 2-6, updating the request queue.
The ground wire pasting calculation module specifically executes the following steps:
step 3-1, loading terrain grid data in the terrain data stream and trail line segment coordinate data in the trail line segment data stream stored in the step 2-5, distributing GPU computing threads according to the number of the line segments, and setting the size of a thread block to be 1024 and the size of a thread grid to be (n +1024-1)/1024 when the number of the thread is n;
step 3-2, submitting the coordinate data of the control points and the terrain grid data to a GPU by adopting a cuda parallel computing technology;
and 3-3, executing a calculation process in the GPU, taking interpolation of each line segment as an independent calculation process, and constructing a linear equation (y-y1)/(y1-y2) (x-x1)/(x1-x2) according to geographical coordinates of a starting point and an ending point of the line segment, wherein x and y respectively represent longitude and latitude of any point of the line segment, x1 and y1 respectively represent longitude and latitude of the starting point of the line segment, x2 and y2 respectively represent longitude and latitude of the ending point of the line segment, and intersection points of the line segment and all triangles in the terrain grid are calculated to form an interpolation coordinate set together with the starting point and the ending point of the line segment to form a complete ground-attached trail so that the trail can be fully matched with terrain fluctuation.
Compared with the multi-thread calculation of the CPU, the GPU can provide parallel calculation capability far exceeding the former. The GPU has more computing units than the former, can execute repeated simple computation aiming at multiple data streams simultaneously, utilizes the parallel computing characteristic of the GPU, distributes repeated computing tasks to the GPU for execution, can obviously improve the computing efficiency, and can reduce the computing pressure of the CPU.
In conclusion, the GPU parallel computing technology is used for replacing CPU multi-thread computing, interpolation point computing in a repeated process is carried out, performance bottlenecks can be broken through, higher computing power is provided for drawing the three-dimensional situation target ground trail, drawing efficiency of the large-batch situation target ground trail is guaranteed, and three-dimensional battlefield environment simulation is smoother.
Compared with the prior art, the invention has the following remarkable advantages: 1. the invention uses the terrain grid index and the trail cache to screen the trail, reduces the number of line segments needing to be calculated by attaching to the ground and reduces the overall calculation amount; 2. according to the method, a cuda parallel computing technology is adopted, a large amount of time-consuming ground wire interpolation computing is sent to the GPU for processing, the parallel computing advantage of the GPU is exerted, the computing burden of the CPU is reduced, the computing and rendering efficiency is improved, and the simulation process of the battlefield environment is smoother; 3. the method adopts the multithreading technology, the request processing and the ground wire pasting calculation are respectively put into the independent auxiliary threads for processing, the request processing and the interpolation calculation can be used for parallel processing, the request processing efficiency is improved, and the influence on the rendering thread is reduced.
Drawings
The foregoing and/or other advantages of the invention will become further apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings.
FIG. 1 is a general flow diagram of the practice of the present invention.
Fig. 2 is a flow diagram of a data scheduling module implemented by the present invention.
FIG. 3 is a flow diagram of a data organization module in accordance with an embodiment of the present invention.
Fig. 4 is a flow chart of a patch cord calculation module implemented by the present invention.
Detailed Description
The invention provides a real-time drawing method and a real-time drawing system for a large batch of three-dimensional ground-sticking tail traces, and the real-time drawing method for the large batch of ground-sticking tail traces adopts a cuda parallel computing technology, hands over a ground-sticking line interpolation computing process which consumes more CPU resources to a GPU for processing, gives full play to the parallel computing advantages of the GPU, and reasonably utilizes the computing resources of the CPU and the GPU so as to achieve the purposes of improving the computing speed and optimizing the rendering efficiency.
As shown in fig. 1, the method first judges a current terrain grid to determine whether updating of the ground tail trace is needed, screens out objects needing updating of the ground tail trace, and submits a request; after receiving an updating request, a request processing thread screens out the trail segments needing to be updated, fills a vertex data set by using information such as geographical coordinates of trail points and the like, fills a terrain data set by using current terrain grid data, and submits the prepared data sets to a computing thread; and after receiving the processed data set, the computing thread allocates GPU resources according to computing requirements, submits the data to a GPU, and performs intersection interpolation computation on the terrain grids according to a specified computing mode.
The drawing method mainly comprises a data scheduling module, a data organizing module and a ground wire pasting computing module. The flow of each part is described in detail below.
A data scheduling module:
the updating of the ground wire does not need to be carried out continuously, and in the process of simulation, if the topographic relief displayed by the current scene changes, the tail trace of the ground wire also needs to be updated correspondingly; similarly, if the trail point itself changes, it needs to be updated. The module is therefore responsible for terrain grid management, trail screening, and request submission, among other things. Mainly, the related data is stored and compared, and the tail trace which needs to submit the update request is screened out, as shown in fig. 2, the detailed steps are as follows:
(1) and screening M situation targets needing to be drawn out from the N situation targets in the simulation system through visibility judgment.
(2) Obtaining a currently used terrain grid from three-dimensional scene rendering, establishing an index in a mode of 'hierarchy _ row _ column', obtaining an index list I, searching a terrain grid index cache, checking whether the index list I is completely consistent with the index in the cache, and preparing to submit a ground-attaching trail updating request if the difference exists.
(3) And if the terrain grids in the previous step are not different, judging whether the trail points of the situation target are changed, and if so, preparing to submit a request for updating the trail points attached to the ground.
(4) Through the judgment, K situation targets needing to be subjected to terrain tailing updating are screened out from the visible situation targets, updating requests are created for the K situation targets, and the K situation targets are submitted to the auxiliary thread for processing.
A data organization module:
the submitted request is processed in the auxiliary thread to reduce the influence on the rendering efficiency of the three-dimensional scene. For the request to be processed, the GPU may be submitted for computation after the data processing is required. Therefore, the module is responsible for receiving a ground-to-ground trail update request sent by the data scheduling module, removing duplication of the request, screening out control point segments needing ground-to-ground calculation, acquiring terrain data, processing the terrain data, and submitting the processed terrain data to the ground-to-ground line calculation module for calculation, as shown in fig. 3, the detailed steps are as follows:
(1) after receiving the submitted updating request, comparing the updating request with the maintained request queue, searching a corresponding situation target in the queue, adding the request which is not in the queue into the queue, and discarding the repeated request.
(2) The method comprises the steps of obtaining a current terrain grid set T from three-dimensional scene rendering, traversing vertex data of any terrain grid in the set T, organizing geographic coordinates of each vertex in a longitude-latitude-elevation value mode, and writing all the vertex geographic coordinates in the terrain grid set T into a data stream StreamT.
(3) And (3) forming a segment list for each situation target in the request queue according to the sequence of the trail point of the situation target, searching grids intersected with the segment sp-ep in the terrain grid set T by taking the geographic coordinates of the segment start point sp and the key ep as boundary conditions to obtain a grid list A, comparing the grid list A with a corresponding list B in a trail cache, and if the A and the B are not completely consistent, carrying out interpolation calculation on the trail again.
(4) And for the line segment needing to be subjected to interpolation calculation again, organizing the geographic coordinates of a start point sp and an end point ep of the line segment according to a longitude-latitude mode, and writing the vertex coordinates of all the line segments into a data stream streammV.
(5) And submitting the organized terrain grid data stream StreamT and the tail track section data stream StreamV to a ground wire computing thread.
The ground wire pasting calculation module:
by utilizing the parallel computing capability of the GPU, a large amount of repetitive computing can be efficiently and parallelly processed, and the time required by computing is greatly reduced. The module is responsible for distributing GPU computing resources, submitting processed data to the GPU, enabling the GPU to perform computing processing and obtaining computing results. As shown in fig. 4, the detailed steps are as follows:
(1) and allocating a GPU computing thread to each line segment according to the number of the incoming line segments.
(2) The terrain grid data stream StreamT and the tail section data stream StreamV are transmitted into the GPU.
(3) And the GPU obtains the geographic coordinates of the starting point sp and the end point ep of each line segment from the tail trace segment data stream streamV, and performs terrain mesh interpolation calculation of one line segment in each allocated thread. For a line segment L, a straight line equation f is established by (y-sp.y)/(sp.y-ep.y) — (x-sp.x)/(sp.x-ep.x), a terrain mesh set T is obtained in a terrain mesh data stream StreamT, a mesh list a intersecting the line segment L is calculated, for each terrain mesh in the list a, a list P of intersections of the straight line equation with triangles in the mesh is solved by { P1, P2, … … pN }, and the interpolation coordinate set { sp, P1, P2, … … pN, ep } is formed by a start point sp and an end point ep.
(4) And after all the threads of the GPU are calculated, returning the calculation result to the CPU, and updating the trail cache.
The present invention provides a method and a system for real-time rendering of a large-scale three-dimensional ground-attached trail, and a plurality of methods and ways for implementing the technical scheme, and the above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, a plurality of improvements and embellishments can be made without departing from the principle of the present invention, and these improvements and embellishments should also be regarded as the protection scope of the present invention. All the components not specified in the present embodiment can be realized by the prior art.

Claims (8)

1. A real-time drawing method of a large-batch three-dimensional ground-attaching trail is characterized by comprising the following steps:
step 1, screening a situation target needing to be updated in a three-dimensional scene, and constructing an updating request;
step 2, the update request is deduplicated, and the existing request is filtered; screening out line segments needing to be updated according to trail cache information, and processing terrain grid data and line segment control point information data into data streams;
step 3, ground wire interpolation: performing ground wire interpolation calculation by adopting a cuda parallel calculation technology based on the data stream obtained in the step 2, allocating GPU resources according to calculation requirements, submitting the processed data to a GPU, and enabling the GPU to perform interpolation calculation; and (4) performing intersection interpolation calculation on the line segments screened in the step (2) and the terrain grids to obtain an interpolation result, and calculating the ground-attaching tail trace which accords with the terrain relief rule.
2. The method of claim 1, wherein step 1 comprises:
step 1-1, performing visibility judgment on a situation target in a three-dimensional scene, only processing a current visible target, and not processing an invisible target;
step 1-2, obtaining an index of a terrain grid used for rendering a current three-dimensional scene, establishing the index of the three-dimensional scene terrain grid according to a form of a hierarchy line column, comparing the index with the terrain grid index in a cache, judging whether the terrain in the three-dimensional scene changes, updating a ground tail only when the terrain changes, and not updating when the terrain does not change;
step 1-3, judging whether a situation target with changed trail points exists or not, and updating the changed situation target by pasting the trail points;
and step 1-4, screening out objects needing to be updated according to the processing of the step 1-1 to the step 1-3, and constructing an updating request.
3. The method of claim 2, wherein step 2 comprises:
step 2-1, maintaining a request queue for managing the update request constructed in step 1, comparing the update request constructed in step 1 with the requests stored in the request queue, judging whether a repeat request exists, filtering the repeat request, and updating the request queue;
step 2-2, performing subsequent calculation by using topographic data used for current scene drawing acquired from the three-dimensional scene, obtaining topographic grid data according to a current topographic grid index, and writing the geographic coordinates of each vertex of the topographic grid into a data stream in a longitude-latitude-elevation value form;
step 2-3, after finishing updating the tail trace of the point pasting each time, storing coordinates of a starting point and an end point of the line segment and a terrain grid index intersected with the line segment in a tail trace cache; when an update request in a request queue is processed, obtaining a control point line segment set according to a trail control point of a situation target in the update queue, obtaining a terrain grid index intersected with a line segment at present, comparing the terrain grid index with a trail cache, judging whether a terrain grid related to the line segment changes, and if so, performing terrain grid interpolation calculation on the line segment again;
step 2-4, writing the top points of the line segments screened in the step 2-3 into a data stream in a longitude-latitude mode;
step 2-5, submitting the terrain data stream and the tail trace segment data stream to step 3 for calculation;
and 2-6, updating the request queue.
4. The method of claim 3, wherein step 3 comprises:
step 3-1, after receiving the terrain grid data and the trail segment coordinate data in the trail segment data stream transmitted in the step 2, distributing GPU computing threads according to the number of the segments, and when the number of the segments is n, setting the size of a thread block to be 1024 and the size of a thread grid to be (n + 1024-1)/1024;
step 3-2, submitting the coordinate data of the control points and the terrain grid data to a GPU by adopting a cuda parallel computing technology;
and 3-3, executing a calculation process in the GPU, taking interpolation of each line segment as an independent calculation process, and constructing a linear equation (y-y1)/(y1-y2) (x-x1)/(x1-x2) according to geographical coordinates of a starting point and an ending point of the line segment, wherein x and y respectively represent longitude and latitude of any point of the line segment, x1 and y1 respectively represent longitude and latitude of the starting point of the line segment, x2 and y2 respectively represent longitude and latitude of the ending point of the line segment, and intersection points of the line segment and all triangles in the terrain grid are calculated to form an interpolation coordinate set together with the starting point and the ending point of the line segment to form a complete ground-attached trail so that the trail can be fully matched with terrain fluctuation.
5. A real-time drawing system of mass three-dimensional ground-attached trails is characterized by comprising a data scheduling module, a data organizing module and a ground wire calculation module;
the data scheduling module is executed by a CPU rendering thread and is used for screening a situation target needing to be updated in a three-dimensional scene, constructing an updating request and submitting the updating request to the data organization module;
the data organization module is executed by a CPU auxiliary thread and is used for carrying out duplication removal on the updating request and filtering the existing request; screening out line segments needing to be updated according to trail cache information, processing terrain grid data and line segment control point information data into data streams, and submitting the data streams to a ground wire calculation module;
the ground wire sticking calculation module is executed by a CPU auxiliary thread and a GPU, and is used for performing ground wire sticking interpolation calculation by adopting a cuda parallel calculation technology based on the data stream obtained in the step 2, allocating GPU resources according to calculation requirements, submitting processed data to the GPU and enabling the GPU to perform interpolation calculation; and performing intersection interpolation calculation according to the screened line segments and the terrain grids to obtain an interpolation result, and calculating the ground tail trace which accords with the terrain relief rule.
6. The system of claim 5, wherein the data scheduling module specifically performs the following steps:
step 1-1, performing visibility judgment on a situation target in a three-dimensional scene, wherein only the current visible target needs to be processed, and the invisible target is not processed;
step 1-2, obtaining an index of a terrain grid used for rendering a current three-dimensional scene, establishing the index of the three-dimensional scene terrain grid according to a form of a hierarchy line column, comparing the index with the terrain grid index in a cache, judging whether the terrain in the three-dimensional scene changes, updating a ground tail only when the terrain changes, and not updating when the terrain does not change;
step 1-3, judging whether a situation target with changed trail points exists or not, and updating the changed situation target by pasting the trail points;
and step 1-4, screening out objects needing to be updated according to the processing of the step 1-1 to the step 1-3, and constructing an updating request.
7. The system of claim 6, wherein the data organization module performs the steps of:
step 2-1, maintaining a request queue for managing the update request constructed in step 1, comparing the update request constructed in step 1 with the requests stored in the request queue, judging whether a repeat request exists, filtering the repeat request, and updating the request queue;
step 2-2, performing subsequent calculation by using topographic data used for current scene drawing acquired from the three-dimensional scene, obtaining topographic grid data according to a current topographic grid index, and writing the geographic coordinates of each vertex of the topographic grid into a data stream in a longitude-latitude-elevation value form;
step 2-3, after finishing updating the tail trace of the point pasting each time, storing coordinates of a starting point and an end point of the line segment and a terrain grid index intersected with the line segment in a tail trace cache; when an update request in a request queue is processed, obtaining a control point line segment set according to a trail control point of a situation target in the update queue, comparing the control point line segment set with a trail cache, judging whether a terrain grid related to a line segment changes, and if so, performing terrain grid interpolation calculation on the line segment again;
step 2-4, writing the top points of the line segments screened in the step 2-3 into a data stream in a longitude-latitude mode;
step 2-5, storing the terrain data stream and the tail trace segment data stream for subsequent calculation;
and 2-6, updating the request queue.
8. The system of claim 7, wherein the ground wire computing module performs the following steps:
step 3-1, loading terrain grid data in the terrain data stream and trail line segment coordinate data in the trail line segment data stream stored in the step 2-5, distributing GPU computing threads according to the number of the line segments, and setting the size of a thread block to be 1024 and the size of a thread grid to be (n +1024-1)/1024 when the number of the thread is n;
step 3-2, submitting the coordinate data of the control points and the terrain grid data to a GPU by adopting a cuda parallel computing technology;
and 3-3, executing a calculation process in the GPU, taking interpolation of each line segment as an independent calculation process, and constructing a linear equation (y-y1)/(y1-y2) (x-x1)/(x1-x2) according to geographical coordinates of a starting point and an ending point of the line segment, wherein x and y respectively represent longitude and latitude of any point of the line segment, x1 and y1 respectively represent longitude and latitude of the starting point of the line segment, x2 and y2 respectively represent longitude and latitude of the ending point of the line segment, and intersection points of the line segment and all triangles in the terrain grid are calculated to form an interpolation coordinate set together with the starting point and the ending point of the line segment to form a complete ground-attached trail so that the trail can be fully matched with terrain fluctuation.
CN202010767626.0A 2020-08-03 2020-08-03 Real-time drawing method and system for mass three-dimensional ground-attaching trails Active CN111932662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010767626.0A CN111932662B (en) 2020-08-03 2020-08-03 Real-time drawing method and system for mass three-dimensional ground-attaching trails

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010767626.0A CN111932662B (en) 2020-08-03 2020-08-03 Real-time drawing method and system for mass three-dimensional ground-attaching trails

Publications (2)

Publication Number Publication Date
CN111932662A true CN111932662A (en) 2020-11-13
CN111932662B CN111932662B (en) 2022-10-04

Family

ID=73306360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010767626.0A Active CN111932662B (en) 2020-08-03 2020-08-03 Real-time drawing method and system for mass three-dimensional ground-attaching trails

Country Status (1)

Country Link
CN (1) CN111932662B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100164983A1 (en) * 2008-12-29 2010-07-01 Microsoft Corporation Leveraging graphics processors to optimize rendering 2-d objects
CN105184017A (en) * 2015-09-30 2015-12-23 成都赫尔墨斯科技有限公司 OpenSceneGraph-based real-time battlefield simulation system and method
CN105336003A (en) * 2015-09-28 2016-02-17 中国人民解放军空军航空大学 Three-dimensional terrain model real-time smooth drawing method with combination of GPU technology
GB201600642D0 (en) * 2016-01-13 2016-02-24 Sony Computer Entertainment Inc Apparatus and method of image rendering

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100164983A1 (en) * 2008-12-29 2010-07-01 Microsoft Corporation Leveraging graphics processors to optimize rendering 2-d objects
CN105336003A (en) * 2015-09-28 2016-02-17 中国人民解放军空军航空大学 Three-dimensional terrain model real-time smooth drawing method with combination of GPU technology
CN105184017A (en) * 2015-09-30 2015-12-23 成都赫尔墨斯科技有限公司 OpenSceneGraph-based real-time battlefield simulation system and method
GB201600642D0 (en) * 2016-01-13 2016-02-24 Sony Computer Entertainment Inc Apparatus and method of image rendering

Also Published As

Publication number Publication date
CN111932662B (en) 2022-10-04

Similar Documents

Publication Publication Date Title
US20080079734A1 (en) Updating Frame Divisions Based on Ray Tracing Image Processing System Performance
US8284195B2 (en) Cooperative utilization of spatial indices between application and rendering hardware
CN108520557B (en) Massive building drawing method with graphic and image fusion
US7808500B2 (en) Method for improving spatial index efficiency by jittering splitting planes
CN107392835B (en) A kind of processing method and processing device of particIe system
CN106446351A (en) Real-time drawing-oriented large-scale scene organization and scheduling technology and simulation system
CN110738721A (en) Three-dimensional scene rendering acceleration method and system based on video geometric analysis
US20080079714A1 (en) Workload Distribution Through Frame Division in a Ray Tracing Image Processing System
US8339398B2 (en) Integrated acceleration data structure for physics and ray tracing workload
CN111445581A (en) Mesh reconstruction using data-driven priors
CN111191728B (en) Deep reinforcement learning distributed training method and system based on asynchronization or synchronization
CN105261066A (en) Real time rendering multi-thread distribution and control method of three-dimensional geographical information system
WO2008023020A2 (en) Methods and systems for partitioning a spatial index
DE102012221502A1 (en) A system and method for performing crafted memory access operations
CN109237999A (en) A kind of batch three-dimensional situation target trail real-time drawing method and system
CN111782745B (en) Space-time big data grid coding efficient visualization method and system
CN112236760A (en) Method, system, computer readable storage medium and equipment for updating graph data
DE112020007087T5 (en) Concurrent hash table updates
CN104700413A (en) Real-time dynamic drawing method for vegetation in three-dimensional virtual scene
DE102012213846A1 (en) Real-time Euler water simulation using a limited large-cell grid
CN106681697B (en) Target access calculates Parallel Implementation method under a kind of CUDA frameworks
CN111932662B (en) Real-time drawing method and system for mass three-dimensional ground-attaching trails
US20080079715A1 (en) Updating Spatial Index Partitions Based on Ray Tracing Image Processing System Performance
CN106484532B (en) GPGPU parallel calculating method towards SPH fluid simulation
CN108875275B (en) Vector field real-time simulation method and system based on large-scale streamline

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant