CN113744123B - Large-scale dynamic object drawing method and system based on global instantiation - Google Patents

Large-scale dynamic object drawing method and system based on global instantiation Download PDF

Info

Publication number
CN113744123B
CN113744123B CN202111304836.7A CN202111304836A CN113744123B CN 113744123 B CN113744123 B CN 113744123B CN 202111304836 A CN202111304836 A CN 202111304836A CN 113744123 B CN113744123 B CN 113744123B
Authority
CN
China
Prior art keywords
vehicle
instantiation
global
scene
position information
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.)
Active
Application number
CN202111304836.7A
Other languages
Chinese (zh)
Other versions
CN113744123A (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.)
Sichuan Jianshan Technology Co ltd
Original Assignee
Sichuan Jianshan Technology Co ltd
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 Sichuan Jianshan Technology Co ltd filed Critical Sichuan Jianshan Technology Co ltd
Priority to CN202111304836.7A priority Critical patent/CN113744123B/en
Publication of CN113744123A publication Critical patent/CN113744123A/en
Application granted granted Critical
Publication of CN113744123B publication Critical patent/CN113744123B/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
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation

Abstract

The invention relates to the technical field of graph drawing, in particular to a large-scale dynamic object drawing method and a system based on global instantiation, which comprises the following steps: creating a traffic flow line object in a scene, wherein the traffic flow line object generates a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles, position information of the vehicles and a speed value which need to be generated in the spline line component; creating a global instantiation manager object, and associating the global instantiation manager object with each traffic line object; selecting static grid bodies of the vehicle and generating instantiated static grid body components corresponding to each static grid body; the instantiation static grid body generates an instance corresponding to each vehicle in a scene according to the vehicle information array; and traversing the vehicle information array, and updating the position information of the instance in the scene. The method is used for solving the problem that a large number of vehicle drawing calls are high, the drawing calls are reduced by utilizing the global instantiation manager, and the drawing performance is improved so as to improve the technical problem.

Description

Large-scale dynamic object drawing method and system based on global instantiation
Technical Field
The invention relates to the technical field of graph drawing, in particular to a large-scale dynamic object drawing method and system based on global instantiation.
Background
A large number of buildings, vegetation, roads, vehicles running on the roads and the like are built in the virtual large scene, wherein the buildings, the vegetation and the roads are static objects, and the vehicles are dynamic objects. For static objects, after dragging and dropping to a designated position in a scene, the system is normally loaded; for the dynamic object, position information can be continuously calculated and changed in a scene in the running process of the system, and more memory and CPU (central processing unit) computing resources are occupied.
For drawing of small-scale dynamic vehicles, the conventional method is to independently generate each vehicle on each road and update position information in real time, the applied algorithm is to take each vehicle in a scene as an independent grid body, in the drawing process, a CPU sends an instruction to notify a GPU to execute a specified rendering task, namely one Draw Call (Draw Call), and each grid body needs to execute one Draw Call. The method is also adopted for drawing the large-scale dynamic object, the drawing calling is very high under the condition that the number of the grid bodies is too large, and the frame rate is low, as shown in fig. 1, the frame rate obtained by the system is only 24.5FPS, so that the situation that the scene cannot be normally used occurs, and the effect of moving the vehicle on a large scale cannot be expressed in the virtual scene.
Disclosure of Invention
The invention aims to provide a large-scale dynamic object drawing method and system based on global instantiation, which are used for solving the problem of high drawing call of a large number of vehicles, reducing the drawing call by using a global instantiation manager and improving the drawing performance so as to improve the technical problem.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
a large-scale dynamic object drawing method based on global instantiation comprises the following steps:
creating one or more traffic line objects in a scene, wherein the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles needing to be generated in the spline line component, position information of the vehicles and a speed value;
creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
selecting static grid volumes of one or more vehicles from the global instantiation manager object, and generating instantiation static grid volume components corresponding to each static grid volume;
instantiating a static grid body to generate an instance corresponding to each vehicle in a scene according to the vehicle information array;
and traversing the vehicle information array, and updating the position information of the instance in the scene.
Further, the step of generating the spline line assembly comprises:
clicking to generate a plurality of spline points, and connecting the spline points to form a self-defined curve to obtain a spline line assembly;
setting the tangent entry and exit directions of the spline points controls the shape of the spline line assembly.
Further, the step of calculating the number of vehicles to be generated in the spline assembly comprises:
calculating the position information of the vehicle needing to be generated on the spline line assembly according to the length of the spline line assembly and the distance between adjacent vehicles;
calculating the number of vehicles required to be generated on the spline line assembly, and assigning a speed value for the vehicles on the spline line assembly;
and saving the position information and the speed value of each vehicle into the vehicle information array.
Further, the one traffic line object includes only one spline line component.
Further, creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each streamline object, the method comprises the following steps:
storing the global instantiation manager object into each traffic line object;
the global instantiation manager object searches and stores all traffic line objects existing in the current scene.
Further, the instantiating static grid entity generates an instance corresponding to each vehicle in a scene according to the vehicle information array, and the generating includes:
traversing the vehicle information array;
randomly assigning a static grid body for each vehicle;
generating, by an instantiated static mesh component corresponding to the static mesh, an instance and identifier pair corresponding to a vehicle in a scene;
saving the identifier pair to the vehicle information array.
Further, the identifier pair consists of the order in which the instances were generated in the instantiated static grid volume component and the information of the instantiated static grid volume component.
Further, the traversing the vehicle information array, and updating the location information of the instance in the scene, includes:
sequentially traversing the vehicle information arrays of each traffic flow object in one frame to obtain vehicles to be generated in the current spline assembly;
acquiring an identifier pair, current position information and a speed value of the vehicle;
searching corresponding instances in the instantiated static grid body component by using the identifier pair;
calculating the next frame of position information of the vehicle by using the current position information, storing the next frame of position information into a vehicle information array, and replacing the current position information;
and instantiating a static grid body component to regenerate the instance in the scene according to the position information of the next frame.
Further, the method for calculating the next frame of position information of the vehicle by using the current position information includes:
Figure DEST_PATH_IMAGE001
wherein, the
Figure 628125DEST_PATH_IMAGE002
Represents the time of a frame, said
Figure DEST_PATH_IMAGE003
Represents the current position of the vehicle, said
Figure 359320DEST_PATH_IMAGE004
Representing the speed of the vehicle, said
Figure DEST_PATH_IMAGE005
Represents a route, said
Figure 946159DEST_PATH_IMAGE006
Representing paths on a spline assembly, said
Figure DEST_PATH_IMAGE007
Indicating the position of the vehicle in the next frame.
A large scale dynamic object rendering system based on global instantiation, the system comprising:
a flow line object generation unit: creating one or more traffic line objects in a scene, wherein the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles needing to be generated in the spline line component, position information of the vehicles and a speed value;
an association unit: creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
static mesh body selection unit: selecting static grid volumes of one or more vehicles from the global instantiation manager object, and generating instantiation static grid volume components corresponding to each static grid volume;
an instance generation unit: instantiating a static grid body to generate an instance corresponding to each vehicle in a scene according to the vehicle information array;
a location information update unit: and traversing the vehicle information array, and updating the position information of the instance in the scene.
The invention has the beneficial effects that:
1. in the invention, one instantiation static grid body component comprises one type of example, the same static grid resource is used in the process of generating the example, and the instantiation static grid body component can draw all the examples of the instantiation static grid body component only by executing drawing call once. Compared with the traditional method, one instance corresponds to one static grid body, one instance is generated by executing one drawing call, and the hardware environment is a central processing unit: intel (R) core (TM) i 7-9700K; memory: 64gb 3200 MHz; a display card: under the condition of NVIDIA GeForce RTX 2070 SUPER, the frame rate is improved from the original 22.26FPS to 44.93FPS, the drawing efficiency is improved by 102%, and the system performance is greatly optimized.
2. The invention draws a plurality of instances through one instantiation static grid body component, and the plurality of instances are distributed on different sample line components, and because each instance has no identifier information associated with the instantiation static grid body component, the instances which can not be directly found from the corresponding instantiation static grid body component in the process of updating the position of the instance can not be directly found. In order to solve the above problem, the present invention generates a unique identifier pair for an instance when the instance is generated for the first time, wherein the identifier pair is composed of a sequence number of a static grid body component to be instantiated and a sequence number of the instance generated by the component, and the identifier pair can be used to accurately find a corresponding instance in the static grid body component to be instantiated.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a prior art system display diagram;
FIG. 2 is a flowchart of a large-scale dynamic object rendering method based on global instantiation in the embodiment;
fig. 3 is a construction diagram of a spline line assembly in the present embodiment;
fig. 4 is a flowchart of S5 in the present embodiment;
FIG. 5 is a diagram showing a large-scale dynamic object rendering system based on global instantiation in the present embodiment;
fig. 6 is a large-scale dynamic object rendering system display diagram two based on global instantiation in the present embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers or letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 2, the present embodiment provides a large-scale dynamic object rendering method based on global instantiation, including the following steps:
s1, one or more traffic line objects are created in a scene, the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles, position information of the vehicles and speed values, which need to be generated in the spline line component.
Specifically, the embodiment is completed in a graphic Engine, a scene is preferably built in the UE4 (universal Engine 4), and all functions in the method are implemented by using a component provided by the UE 4.
As shown in fig. 3, lane lines on which vehicles travel are autonomously selected from all roads in a scene, an object is generated on one lane line, a spline line component is generated according to a path of the lane line, the number of vehicles on the spline line component and initial position information of each vehicle on the spline line component need to be customized after the spline line component is generated, and the initial position information needs to be acquired for generating an instance, namely, a vehicle, when the system is initialized, so that it is ensured that a vehicle travels on the lane line when the system runs for a first frame.
The embodiment sets a same speed value for the vehicle on each spline assembly so that the vehicle does not collide during running.
Based on the above embodiment, the generating of the spline line assembly specifically includes the following steps:
s11, clicking to generate a plurality of spline points, and connecting the spline points to form a self-defined curve to obtain a spline line assembly;
s12, setting the entering direction and the leaving direction of the tangent of the spline point to control the shape of the spline line assembly.
In this embodiment, the radian of the spline line assembly is changed by setting the entering direction and the leaving direction of the tangent line of the spline point so as to be adapted to the shape of the lane line. Meanwhile, the position information coordinates of each point on the spline line assembly can be automatically acquired.
Based on the above embodiment, the calculation process of the number of vehicles to be generated in the spline assembly specifically includes the following steps:
s13, calculating the position information of the vehicle to be generated on the spline line assembly according to the length of the spline line assembly and the distance between adjacent vehicles;
specifically, the S13 includes the following steps:
s131, acquiring a length value of a spline assembly in a scene;
s132, setting a range value of the vehicle distance d, preferably setting the range value of the d as [1,10] m;
s133, starting calculation by using the starting end of the spline assembly, and randomly calling a numerical value x in a range value [1,10] as the distance between the vehicle needing to be generated at present and the starting end to obtain the vehicle position information needing to be generated at present:
s134, randomly calling a numerical value x in the range value [1,10] as the distance between the next vehicle and the previous vehicle to obtain the position information of the next vehicle;
s135, repeating the steps until the numerical value in the random calling range value is larger than the distance between the vehicle needing to be generated and the previous vehicle, and stopping calculating the position information;
and S136, counting the number of vehicles required or capable of being generated on the spline line assembly.
It should be noted that the S131-S136 need only calculate which positions on the spline assembly generate vehicles, and the vehicles (examples) are not generated in the scene temporarily.
S14, calculating the number of vehicles needing to be generated on the spline line assembly, and assigning a speed value for the vehicles on one spline line assembly, wherein the speed values assigned by the vehicles on one spline line assembly are the same;
and S15, storing the position information and the speed value of each vehicle into the vehicle information array.
Based on the above embodiment, the one vehicle flow line object only comprises one spline line component, and the information of the vehicles in the spline line component is maintained by the vehicle flow line object.
S2, creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
based on the above embodiment, the S2 specifically includes the following steps:
s21, storing the global instantiation manager object into each traffic line object;
and S22, searching and storing all traffic flow objects existing in the current scene by the global instantiation manager object.
In this embodiment, only one global instantiation manager object is generated in the whole scene, and the global instantiation manager object needs to store data information of each other together with each traffic line object for mutual data access.
S3, selecting one or more static grid bodies of vehicles from the global instantiation manager object, and generating instantiation static grid body components corresponding to each static grid body;
in this embodiment, there are several static grids in the UE4, and the number of static grids representing the model of the vehicle is manually selected according to actual needs. Preferably, in this embodiment, 12 static grid volumes are selected, an array [0,1,2,3,4,5,6,7,8,9,10,11] is composed of instantiated static grid volume components corresponding to the selected 12 static grid volumes, and is stored in the global instantiation manager object.
In this embodiment, the static grid volumes and instantiated static grid volume components are in a one-to-one correspondence relationship, so that 12 static grid volumes correspond to 12 instantiated static grid volume components, and the instantiated static grid volume components directly generate instances, where the instances refer to vehicles generated in a scene.
S4, instantiating a static grid body component to generate an instance corresponding to the vehicle in a scene according to the vehicle information array; specifically, all vehicles in all the streamline objects are generated by the 12 instantiated static grid volume components, and each vehicle is randomly assigned to one instantiated static grid volume component, that is, one model is randomly selected from the 12 models, so as to avoid that all vehicles in the scene use the same model.
Based on the above embodiment, the S4 specifically includes the following steps:
s41, the global instantiation manager object executes the instantiation function when the system starts to operate, and sequentially traverses the vehicle information arrays in each traffic line object;
s42, randomly assigning a static grid body for each vehicle, and after the vehicle assigns a static grid body, indicating that the vehicle always uses an instantiation static grid body component corresponding to the assigned static grid body to draw an instance in a scene, but the process of drawing the instance is executed by the instantiation static grid body component;
s43, generating an instance and an identifier pair corresponding to a vehicle in a scene by an instantiated static grid body component corresponding to the static grid body, wherein the identifier pair specifically comprises an instance generation sequence and information of the instantiated static grid body component;
it should be noted that the order in which the instances are generated refers to the order in which the instances (or vehicles) are generated in instantiating the static grid volume component, for example, the 1 st generated instance (or vehicle) generated by instantiating the static grid volume component is labeled as 1, the 2 nd generated instance is labeled as 2, and so on.
The instantiated static grid element information refers to the above mentioned instantiated static grid element array, for example, if the 1 st generated instance specifies 2 instantiated static grid elements, then the identifier pair of the instance (or vehicle) is [1,2], and the corresponding instance can be found in the instantiated static grid element group by using the identifier pair.
And S44, storing the identifier pair into the vehicle information array.
It should be noted that, in this embodiment, one instantiated static grid volume component is used as an independent grid volume, and all corresponding instances can be rendered by executing a rendering call on the instantiated static grid volume component.
And S5, traversing the vehicle information array, and updating the position information of the instance in the scene.
As shown in fig. 4, based on the above embodiment, the S5 specifically includes the following steps:
s51, sequentially traversing the vehicle information arrays of each traffic flow object in one frame to obtain the vehicles to be generated in the current spline line assembly;
in this embodiment, the instances in one spline line assembly are sequentially traversed according to the order in which the instances are first generated, and the information of the instances or the vehicles is sequentially read according to the order.
S52, acquiring an identifier pair, current position information and a speed value of the vehicle;
s53, searching a corresponding instance in the instantiated static grid body component by using the identifier pair;
s54, calculating the next frame of position information of the vehicle by using the current position information, storing the next frame of position information into a vehicle information array, and replacing the current position information;
and S55, instantiating a static grid body component and generating an instance in the scene again according to the position information of the next frame.
Based on the above embodiment, the method for calculating the next frame of position information of the vehicle by using the current position information includes:
Figure 434910DEST_PATH_IMAGE001
;(1)
wherein, the
Figure 906342DEST_PATH_IMAGE002
Represents the time of a frame, said
Figure 288782DEST_PATH_IMAGE003
Represents the current position of the vehicle, said
Figure 453047DEST_PATH_IMAGE004
Representing the speed of the vehicle, said
Figure 694673DEST_PATH_IMAGE005
Represents a route, said
Figure 704217DEST_PATH_IMAGE006
Paths on a spline assembly, said
Figure 82109DEST_PATH_IMAGE007
Indicating the position of the vehicle in the next frame.
It should be noted that the time for drawing all instances in a scene once is 1 frame, and when a traditional method is used, the hardware environment is a central processing unit: intel (R) core (TM) i 7-9700K; memory: 64gb 3200 MHz; a display card: under the condition of NVIDIA GeForce RTX 2070 SUPER, the frame rate of the system is about 22FPS, and after the optimization by the method provided by the embodiment, the frame rate that the system can achieve is about 45FPS, the frame rate is increased by 102%, and the drawing efficiency is greatly improved, and the system display diagrams are shown in fig. 5 and 6, wherein fig. 6 is a system display diagram including a terrain.
Example 2
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a large-scale dynamic object rendering system based on global instantiation, and the large-scale dynamic object rendering device based on global instantiation described below and the large-scale dynamic object rendering method based on global instantiation described above may be referred to correspondingly.
The system comprises:
a flow line object generation unit: creating one or more traffic line objects in a scene, wherein the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles needing to be generated in the spline line component, position information of the vehicles and a speed value;
an association unit: creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
static mesh body selection unit: selecting static grid volumes of one or more vehicles from the global instantiation manager object, and generating instantiation static grid volume components corresponding to each static grid volume;
an instance generation unit: instantiating a static grid body to generate an instance corresponding to each vehicle in a scene according to the vehicle information array;
a location information update unit: and traversing the vehicle information array, and updating the position information of the instance in the scene.
It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a large-scale dynamic object rendering device based on global instantiation, and a large-scale dynamic object rendering device based on global instantiation described below and a large-scale dynamic object rendering method based on global instantiation described above may be referred to in correspondence with each other.
The electronic device may include: a processor, a memory. The electronic device may also include one or more of a multimedia component, an input/output (I/O) interface, and a communication component.
The processor is used for controlling the overall operation of the electronic device to complete all or part of the steps in the OD passenger flow prediction method. The memory is used to store various types of data to support operation at the electronic device, which may include, for example, instructions for any application or method operating on the electronic device, as well as application-related data such as contact data, messaging, pictures, audio, video, and so forth. The Memory may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in a memory or transmitted through a communication component. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface provides an interface between the processor and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component is used for carrying out wired or wireless communication between the electronic equipment and other equipment. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so that the corresponding communication component may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, for performing the above-described large-scale dynamic object rendering method based on global instantiation.
In another exemplary embodiment, a computer readable storage medium is also provided, which comprises program instructions, which when executed by a processor, implement the steps of the above-described large-scale dynamic object rendering method based on global instantiation. For example, the computer readable storage medium may be the above-mentioned memory comprising program instructions executable by a processor of an electronic device to perform the above-mentioned large-scale dynamic object rendering method based on global instantiation.
Example 4
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium, and a readable storage medium described below and a large-scale dynamic object rendering method based on global instantiation described above may be correspondingly referred to each other.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the large-scale dynamic object rendering method based on global instantiation of the above-described method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A large-scale dynamic object drawing method based on global instantiation is characterized by comprising the following steps:
creating one or more traffic line objects in a scene, wherein the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles needing to be generated in the spline line component, position information of the vehicles and a speed value;
creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
selecting static grid volumes of one or more vehicles from the global instantiation manager object, and generating instantiation static grid volume components corresponding to each static grid volume;
instantiating a static grid body to generate an instance corresponding to each vehicle in a scene according to the vehicle information array;
the method comprises the following steps:
traversing the vehicle information array;
randomly assigning a static grid body for each vehicle;
generating, by an instantiated static mesh component corresponding to the static mesh, an instance and identifier pair corresponding to a vehicle in a scene;
saving the identifier pair to the vehicle information array;
and traversing the vehicle information array, and updating the position information of the instance in the scene.
2. The large-scale dynamic object rendering method based on global instantiation as claimed in claim 1, wherein the generation of the spline line component specifically comprises the following steps:
clicking in the scene to generate a plurality of sample strip points, and connecting the plurality of sample strip points to form a self-defined curve to obtain a sample strip assembly;
setting the tangent entry and exit directions of the spline points controls the shape of the spline line assembly.
3. The large-scale dynamic object rendering method based on global instantiation according to claim 1 or 2, wherein calculating the number of vehicles required to be generated in the spline assembly specifically comprises the following steps:
calculating the position information of the vehicle needing to be generated on the spline line assembly according to the length of the spline line assembly and the distance between adjacent vehicles;
calculating the number of vehicles required to be generated on the spline line assembly, and assigning a speed value for the vehicles on the spline line assembly;
and saving the position information and the speed value of each vehicle into the vehicle information array.
4. The method of claim 1, wherein the one traffic line object comprises only one spline line component.
5. The large-scale dynamic object rendering method based on global instantiation as claimed in claim 1, wherein creating a global instantiation manager object in the scene, associating the global instantiation manager object with each streamline object, comprises:
storing the global instantiation manager object into each traffic line object;
the global instantiation manager object searches and stores all traffic line objects existing in the current scene.
6. The large-scale dynamic object rendering method based on global instantiation according to claim 1, wherein the identifier pair is composed of an order in which instances are generated in instantiating a static grid volume component and information of the instantiating a static grid volume component.
7. The large-scale dynamic object rendering method based on global instantiation according to claim 1, wherein traversing the vehicle information array and updating the position information of the instance in a scene comprises:
sequentially traversing the vehicle information arrays of each traffic flow object in one frame to obtain vehicles to be generated in the current spline assembly;
acquiring an identifier pair, current position information and a speed value of the vehicle;
searching corresponding instances in the instantiated static grid body component by using the identifier pair;
calculating the next frame of position information of the vehicle by using the current position information, storing the next frame of position information into a vehicle information array, and replacing the current position information;
and instantiating a static grid body component to regenerate the instance in the scene according to the position information of the next frame.
8. The large-scale dynamic object drawing method based on global instantiation according to claim 7, wherein the calculation method for calculating the position information of the next frame of the vehicle by using the current position information is:
Figure FDA0003406752290000021
where Δ t represents the time of one frame, r (t) represents the current position of the vehicle, v represents the speed of the vehicle, Δ r represents the trip, Δ r' represents the trip on the spline assembly, and r (t + Δ t) represents the position of the vehicle at the next frame.
9. A large-scale dynamic object rendering system based on global instantiation, comprising:
a flow line object generation unit: creating one or more traffic line objects in a scene, wherein the traffic line objects generate a spline line component and a vehicle information array, and the vehicle information array comprises the number of vehicles needing to be generated in the spline line component, position information of the vehicles and a speed value;
an association unit: creating a global instantiation manager object in the scene, and associating the global instantiation manager object with each traffic line object;
static mesh body selection unit: selecting static grid volumes of one or more vehicles from the global instantiation manager object, and generating instantiation static grid volume components corresponding to each static grid volume;
an instance generation unit: and the instantiation static grid body generates an instance corresponding to each vehicle in a scene according to the vehicle information array, and the instantiation static grid body comprises the following steps:
traversing the vehicle information array;
randomly assigning a static grid body for each vehicle;
generating, by an instantiated static mesh component corresponding to the static mesh, an instance and identifier pair corresponding to a vehicle in a scene;
saving the identifier pair to the vehicle information array;
traversing the vehicle information array, and updating the position information of the instance in a scene;
a location information update unit: and traversing the vehicle information array, and updating the position information of the instance in the scene.
CN202111304836.7A 2021-11-05 2021-11-05 Large-scale dynamic object drawing method and system based on global instantiation Active CN113744123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111304836.7A CN113744123B (en) 2021-11-05 2021-11-05 Large-scale dynamic object drawing method and system based on global instantiation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111304836.7A CN113744123B (en) 2021-11-05 2021-11-05 Large-scale dynamic object drawing method and system based on global instantiation

Publications (2)

Publication Number Publication Date
CN113744123A CN113744123A (en) 2021-12-03
CN113744123B true CN113744123B (en) 2022-01-25

Family

ID=78727624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111304836.7A Active CN113744123B (en) 2021-11-05 2021-11-05 Large-scale dynamic object drawing method and system based on global instantiation

Country Status (1)

Country Link
CN (1) CN113744123B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109509247A (en) * 2018-09-21 2019-03-22 苏州蜗牛数字科技股份有限公司 A method of support the geometry of light-maps instantiates to draw
CN112990114A (en) * 2021-04-21 2021-06-18 四川见山科技有限责任公司 Traffic data visualization simulation method and system based on AI identification

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080079737A1 (en) * 2003-11-19 2008-04-03 Reuven Bakalash Multi-mode parallel graphics rendering and display system supporting real-time detection of mode control commands (MCCS) programmed within pre-profiled scenes of the graphics-based application
US20100091018A1 (en) * 2008-07-11 2010-04-15 Advanced Micro Devices, Inc. Rendering Detailed Animated Three Dimensional Characters with Coarse Mesh Instancing and Determining Tesselation Levels for Varying Character Crowd Density
CN102157008B (en) * 2011-04-12 2014-08-06 电子科技大学 Large-scale virtual crowd real-time rendering method
CN102903146B (en) * 2012-09-13 2015-09-16 中国科学院自动化研究所 For the graphic processing method of scene drawing
US20200302699A1 (en) * 2018-09-20 2020-09-24 Intuitive Research And Technology Corporation Virtual Reality Anchored Annotation Tool
EP3857531A1 (en) * 2018-09-27 2021-08-04 KPIT Technologies Limited A system for grid-based merge cut-in prediction and method thereof
US11393180B2 (en) * 2020-01-31 2022-07-19 Unity Technologies Sf Applying non-destructive edits to nested instances for efficient rendering

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109509247A (en) * 2018-09-21 2019-03-22 苏州蜗牛数字科技股份有限公司 A method of support the geometry of light-maps instantiates to draw
CN112990114A (en) * 2021-04-21 2021-06-18 四川见山科技有限责任公司 Traffic data visualization simulation method and system based on AI identification

Also Published As

Publication number Publication date
CN113744123A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
CN102662664B (en) Interface animation realization method and system
US20180240062A1 (en) Collaborative algorithm development, deployment, and tuning platform
CN111310936A (en) Machine learning training construction method, platform, device, equipment and storage medium
US20180276508A1 (en) Automated visual information context and meaning comprehension system
US20190114541A1 (en) Method and system of controlling computing operations based on early-stop in deep neural network
CN106803790A (en) The upgrade control method and device of a kind of group system
CN113010612B (en) Visual construction method, query method and device for graph data
CN109388458A (en) Management method, terminal device and the computer readable storage medium of interface control
CN111913885A (en) Log processing method and device, computer readable storage medium and equipment
CN113515672A (en) Data processing method and device, computer readable medium and electronic equipment
CN110096356B (en) Resource scheduling method, device, electronic equipment and storage medium
CN114529658A (en) Graph rendering method and related equipment thereof
CN109724617A (en) A kind of method for drafting and relevant device of navigation routine
WO2023000261A1 (en) Regional traffic prediction method and device
CN112634401B (en) Plane track drawing method, device, equipment and storage medium
CN102541544B (en) The processing method of Tree control, Apparatus and system
CN113744123B (en) Large-scale dynamic object drawing method and system based on global instantiation
CN113205601A (en) Roaming path generation method and device, storage medium and electronic equipment
CN112906554A (en) Model training optimization method and device based on visual image and related equipment
WO2021068247A1 (en) Neural network scheduling method and apparatus, computer device, and readable storage medium
CN108520532B (en) Method and device for identifying motion direction of object in video
CN114449063B (en) Message processing method, device and equipment
CN111966767B (en) Track thermodynamic diagram generation method, device, electronic equipment and storage medium
CN114510173A (en) Construction operation method and device based on augmented reality
CN114419322A (en) Image instance segmentation method and device, electronic equipment and storage medium

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