Unity-based system-level pipeline start-stop transition effect implementation method
By building 3D models and drawing mind maps in Unity, and combining them with flow rate data to achieve pipeline start-stop transition effects, the problem of managers being unable to globally perceive changes in system pipeline start-stop was solved, improving work efficiency and dynamic effect display, and reducing calculation errors.
Patent Information
- Application Number
- CN202511292348.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-11
AI Technical Summary
In existing technologies, managers cannot perceive the changes in the system pipeline during start-up and shutdown, and mainly rely on changes in measurement point values, lacking an intuitive display of transition effects.
This method employs a Unity-based system-level pipeline start/stop transition effect. It achieves the pipeline start/stop transition effect by constructing a 3D model, drawing a mind map, loading configuration files, binding pipeline logic and materials, and combining flow rate data. It also utilizes UV offset calculations and Shader Graph to create materials, providing a dynamic display of start/stop effects.
It improved the work efficiency of managers, reduced calculation errors, enhanced the dynamic effects of virtual scenes and user experience, and also improved the reusability of material spheres and program performance.
Smart Images

Figure CN120807808A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of industrial system virtual simulation, in particular to a system-level pipeline start-stop transition effect implementation method based on Unity. BACKGROUND
[0002] In the industrial field, the pipeline is a very important component of the entire system, and the flow direction state of the medium in the pipeline during system start-stop is an important reference standard for management personnel to determine whether the system starts and stops normally. The current observation method mainly shows the flow rate and flow direction of the medium in the pipeline through the change of the measured value, which is direct, but for management personnel, only the change of the number cannot globally perceive the start-stop change process of the entire system pipeline. SUMMARY
[0003] In view of the existing technical conditions and problems, the present application provides a system-level pipeline start-stop transition effect implementation method based on Unity. The method is based on the combination of mind map and Unity engineering, constructs a pipeline system in a three-dimensional virtual scene, and provides a transition performance effect method of the medium in the system pipeline start-stop process. The purpose is to provide a system-level pipeline start-stop transition effect solution based on Unity engineering to solve the problem that management personnel cannot globally perceive the start-stop change process of the entire system pipeline.
[0004] The technical scheme adopted by the present application is as follows: Step one, first construct a three-dimensional model of n system-related pipelines.
[0005] Step two, import the constructed three-dimensional model of n system-related pipelines into the Unity engineering to provide a three-dimensional model basis for subsequent pipeline connection logic and three-dimensional scene performance of the system pipeline.
[0006] Step three, edit the pipeline connection logic and export the configuration file: combine the constructed three-dimensional model of n system-related pipelines, draw a mind map of the connection relationship of n system-related pipelines, and use it to intuitively show the connection and hierarchical logic between n system-related pipelines.
[0007] Step four, load the configuration file in the Unity engineering: read the TXT format configuration file.
[0008] Step five, bind the pipeline three-dimensional model object and the pipeline connection logic: according to the pipeline name and pipeline hierarchical relationship described in the configuration file, perform hierarchical processing on the three-dimensional model object to form a structure corresponding to the hierarchical relationship described in the configuration file, and provide hierarchical and connection logic relationship support for the system-level pipeline start-stop transition effect.
[0009] Step 6. Create a material ball for the start-stop transition effect of a single pipeline.
[0010] Step 7: UV offset calculation: Calculate the center point offset of the length of a single pipeline in the n systems in the UV coordinate system to obtain the offset of the single pipeline 3D model in the UV coordinate system; finally, convert the offset of the single pipeline 3D model in the UV coordinate system to obtain the UV offset of the single pipeline 3D model in the n systems.
[0011] Step 8. Create a start-stop transition effect for a single pipeline: In the Unity project, obtain the material ball for the start-stop transition effect of a single pipeline through the 3D model of a single pipeline, and set the progress control properties of the material ball in the Unity script.
[0012] Step 9: Receive flow rate data collected from n system-related pipeline flow rate sensors; provide data support for subsequent system start and stop.
[0013] Step 10. Create a system-level pipeline start-stop transition effect: In the Unity project, first read the configuration file exported by editing the pipeline connection logic, and bind the pipeline hierarchy in the configuration file to the pipeline objects in the virtual scene. When the system starts, use the pipeline hierarchy to gradually call the 3D model of each pipeline, and play the start-stop effect for the corresponding 3D model of the pipeline in the virtual scene, finally forming a complete system-level pipeline start-stop transition effect.
[0014] Compared to existing technologies, this invention offers high configurability, versatility, and reusability, making it suitable for all pipeline start / stop transition effects in Unity projects. It can manage the start / stop of multiple systems or pipelines, effectively improving work efficiency.
[0015] The beneficial effects of the present invention are: 1. The system-level pipeline length calculation process supports the participation of non-technical personnel, which can greatly reduce the workload of technical personnel, not only improve work efficiency, but also greatly reduce calculation errors caused by manual calculations.
[0016] 2. The material created by Shader Graph can be referenced multiple times in other 3D models of the same type in the project, greatly improving the reuse rate of materials.
[0017] 3. In Unity projects, using C# scripts to calculate the offset of the UV map only requires one calculation and can be used multiple times, which reduces the performance overhead of the program and eliminates the need to recalculate each time it is used.
[0018] 4. Using Unity program script according to the pipeline connection logic, realizing the system-level pipeline start-stop transition effect, so as to greatly improve the virtual scene dynamic effect and the twin association of the actual system, and the dynamic effect picture formed is better for the experience of user's sense organ. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a system-level pipeline start-stop transition effect implementation method flowchart based on Unity of the present application; Figure 2 is a mind map example diagram between pipeline connections in the embodiment of the present application; Figure 3 is a flowchart of ShaderGraph for making a single pipeline start-stop transition effect in the embodiment of the present application. DETAILED DESCRIPTION
[0020] The present application will be further described below in combination with the drawings and embodiments.
[0021] As shown in Figure 1 , a system-level pipeline start-stop transition effect implementation method based on Unity has the following steps: Step 1: First, build a three-dimensional model of n system-related pipelines.
[0022] Step 2: Import the built three-dimensional model of n system-related pipelines into the Unity project, providing a three-dimensional model basis for the subsequent pipeline connection logic and three-dimensional scene performance of the system pipeline.
[0023] Step 3: Edit the pipeline connection logic and export the configuration file: combine the built three-dimensional model of n system-related pipelines, use EdrawMind Pro software to draw a mind map of the connection relationship of n system-related pipelines, which is used to intuitively show the connection and hierarchical logic between n system-related pipelines.
[0024] As shown in Figure 2 , the mind map drawn by the EdrawMind Pro software of the present method represents that the pipeline “XX system XX pipeline 002” and “XX system XX pipeline 011” are connected under “XX system XX pipeline 001”, the pipeline “XX system XX pipeline 003” and “XX system XX pipeline 004” are connected under “XX system XX pipeline 002”, and so on, forming a complete connection logic diagram of the system.
[0025] In EdrawMind Pro, select File -> Export -> TXT to complete the export of the mind map; use the hierarchical structure of the mind map to represent the pipeline connection and segmentation logic, so as to extract the pipeline connection logic and pipeline segmentation logic in the Unity script, and provide pipeline segmentation logic support for system pipeline start-stop effect.
[0026] Step four, load the configuration file in the Unity project: read the TXT format configuration file.
[0027] Loading the configuration file in the Unity project can use various ways to read and parse configuration files in different formats, such as TXT, XML, JSON, INI, etc. The format used in this method is TXT, and the file reading method of the System.File file tool class needs to be used to read the TXT format configuration file in the Unity project.
[0028] Step five, bind the pipeline three-dimensional model object and the pipeline connection logic: according to the pipeline name and pipeline hierarchical relationship described in the configuration file, the three-dimensional model object is processed in layers to form a structure corresponding to the hierarchical relationship described in the configuration file, providing support for hierarchical and connection logic relationships for system-level pipeline start-stop transition effects.
[0029] Step six, create a material ball for single pipeline start-stop transition effect.
[0030] As shown in Figure 3 , the following steps are taken to create a material ball for single pipeline start-stop transition effect in the ShaderGraph component of Unity: A1, use the UV function in the ShaderGraph component to get the UV attribute of the single pipeline three-dimensional model.
[0031] A2, pass the UV attribute of the single pipeline three-dimensional model into the Split decomposition function, and extract the V attribute in the UV attribute.
[0032] A3, use the multiplication function in the ShaderGraph component to multiply the extracted V attribute of the single pipeline three-dimensional model UV attribute and the constant-1, which is used to perform the NOT operation on the V attribute value, to get the corresponding negative value of the V attribute value.
[0033] A4, use the addition function in the ShaderGraph component to add the corresponding negative value of the V attribute value and the constant 1, which is used to positively offset the corresponding negative value of the V attribute value by one UV coordinate system unit, to get the starting point coordinate value of the single pipeline three-dimensional model in the V axis direction of the UV coordinate system.
[0034] A5, respectively, uv minimum offset, uv maximum offset and single pipeline three-dimensional model transition transition progress control Clip_UV passed to ShaderGraph component in Lerp function, according to the size of Clip_UV value to dynamically transition uv minimum offset and uv maximum offset, get the current single pipeline three-dimensional model of UV attribute in the V axis direction of UV coordinate system offset value.
[0035] A6, using ShaderGraph component in the addition function of V axis direction of the offset value and V axis direction start-stop effect starting point coordinate value added to get single pipeline three-dimensional model in the Y axis of UV coordinate system target value.
[0036] A7, the single pipeline three-dimensional model in the Y axis of UV coordinate system target value is assigned to the transparency attribute of the fragment shader, that is, the function of the dynamic transparent setting of the pipeline three-dimensional model along the Y axis direction can be realized.
[0037] First, you need to create a new Shader Graph editor through the menu Assets—>Create—>Shader Graph—>URP—>LitShader Graph, select the fragment shader in the editor panel, and follow the steps below Figure 3 Set the transparency parameter in Shader Graph.
[0038] Step seven, UV offset calculation: calculate the center point offset of the single pipeline length in the UV coordinate system in the n system, get the offset of the single pipeline three-dimensional model in the UV coordinate system; Finally, the offset of the single pipeline three-dimensional model in the UV coordinate system is converted, that is, the UV offset of the single pipeline three-dimensional model in the n system is obtained.
[0039] The calculation process of the minimum offset and the maximum offset of the material ball three-dimensional model of the single pipeline start-stop transition effect is as follows: B1, through GameObject object's GetComponent <mesh>The method obtains the mesh attribute object of the material sphere three-dimensional model of the single pipeline start-stop transition effect.
[0040] B2, obtain the UV point information list through the GetUV method of the mesh attribute object.
[0041] B3, traverse the UV point information list to find the minimum value and the maximum value in the Y-axis direction.
[0042] B4, obtain the uv minimum offset and the uv maximum offset through the offset algorithm.
[0043] The offset algorithm formula is as follows: float _sizeY = (_max_uv - _min_uv) * 0.5f; float _centerY = 0.5f - (_sizeY + _min_uv); float uv_min = _centerY - _sizeY; float uv_max = _centerY + _sizeY; In the formula, max_uv is the maximum value of the Y-axis in the UV point position; min_uv is the minimum value of the Y-axis in the UV point position; float _sizeY is half of the total length value of the Y-axis in the UV point information of the pipeline three-dimensional model; sizeY is half of the total length of the Y-axis in the UV point information; float _centerY is the center point coordinate value of the Y-axis in the UV point information of the pipeline three-dimensional model; centerY is the center point coordinate value of the Y-axis in the UV point information; float uv_min is the uv minimum offset in the UV point information of the pipeline three-dimensional model; float uv_max is the uv maximum offset in the UV point information of the pipeline three-dimensional model.
[0044] The offset algorithm formula is obtained by operating the maximum value of the Y-axis and the minimum value of the Y-axis in the UV point information of the pipeline three-dimensional model in the UV coordinate system. The operation steps of the offset algorithm formula are as follows: float _sizeY = (_max_uv - _min_uv) * 0.5f; The length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by subtracting the minimum value_min_uv of the Y-axis from the maximum value_max_uv of the Y-axis in the UV coordinate system of the UV point information. The half of the length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by multiplying the length of the Y-axis direction by a constant 0.5, and the value is assigned to a single-precision floating-point variable_sizeY.
[0045] float _centerY = 0.5f - (_sizeY + _min_uv); The half of the length of the Y-axis direction is added to the minimum value of the Y-axis in the UV point information to obtain the center point offset of the UV point information in the UV coordinate system. Since the standard unit of the UV coordinate system in Unity is 1, 0.5 is half of the standard unit, that is, the center point of the Y-axis direction. The center point coordinate value of the Y-axis direction in the UV coordinate system of the UV point information is obtained by subtracting the center point offset from 0.5, and the coordinate value is assigned to a single-precision floating-point variable_centerY.
[0046] float uv_min = _centerY - _sizeY; The half of the length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by subtracting the minimum value_min_uv of the Y-axis from the maximum value_max_uv of the Y-axis in the UV coordinate system of the UV point information. The half of the length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by multiplying the length of the Y-axis direction by a constant 0.5, and the value is assigned to a single-precision floating-point variable_sizeY.
[0047] float uv_max = _centerY + _sizeY; The half of the length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by subtracting the minimum value_min_uv of the Y-axis from the maximum value_max_uv of the Y-axis in the UV coordinate system of the UV point information. The half of the length of the Y-axis direction in the UV point information of the pipeline three-dimensional model is obtained by multiplying the length of the Y-axis direction by a constant 0.5, and the value is assigned to a single-precision floating-point variable_sizeY.
[0048] The UV offset of this pipeline three-dimensional model is obtained by calculation, which provides the maximum offset and minimum offset of UV displacement for the single pipeline transition effect.
[0049] Step eight, creating start-stop transition effect of single pipeline: in Unity project, the material ball of single pipeline start-stop transition effect is obtained through single pipeline three-dimensional model, and the progress control attribute of the material ball is set in Unity script.
[0050] Taking the value range of the attribute Clip_uv as an example, when the attribute Clip_uv is 0, the single pipeline three-dimensional model is in a solid state, and when the attribute Clip_uv is 1, the single pipeline three-dimensional model is in a fluid state.
[0051] The progress control attribute of the material ball is set to adjust the performance state of the pipeline three-dimensional model and the proportion of the solid state part and the fluid state part; the smaller the progress control value of the material ball, the smaller the volume of the fluid part and the larger the volume of the solid state part; the larger the progress control value of the material ball, the larger the volume of the fluid state part and the smaller the volume of the solid state part; by setting the progress control attribute of the material ball, the transition effect of the single pipeline of the n systems from the solid state to the fluid state is realized.
[0052] Step nine, receiving flow rate data collected from n system related pipeline flow rate sensors; providing data support for subsequent system start and stop. The pipeline flow rate measurement point data is shown in Table 1: Table 1. Measurement point data table .
[0053] Step ten, creating a system-level pipeline start-stop transition effect: in Unity, first read the configuration file exported by editing the pipeline connection logic, and bind the pipeline level of the configuration file with the pipeline object in the virtual scene; when the system starts, gradually call the three-dimensional model of the single pipeline by using the hierarchical relationship of the pipeline, and then combine the flow rate data transmitted by each pipeline flow rate sensor; when the flow rate data of the single pipeline is greater than 0, it indicates that the pipeline has fluid passing through; then the progress control attribute of the material ball in the three-dimensional model corresponding to the pipeline is controlled by the program, and the progress control attribute is gradually increased from 0 to 1, thereby forming the start-stop effect animation of the single pipeline three-dimensional model; the three-dimensional model corresponding to the pipeline in the virtual scene is played with the start-stop effect, and finally the complete system-level pipeline start-stop transition effect is formed.
[0054] The method uses C# script to operate the offset of UV in Unity, which involves adjusting the texture coordinates. UV coordinates are two-dimensional, and by modifying these coordinates, various visual effects such as animation and deformation can be achieved.
[0055] UV offset refers to a method of changing the position of a map on a model surface by adjusting the offset of UV coordinates during UV mapping. The UV offset represents the size of the value when UV offset occurs.
[0056] When the method calculates the UV offset, it first needs to calculate the UV coordinate information recorded in the three-dimensional model and the flow direction of the pipeline. When the flow direction of the pipeline is along the Y axis, the maximum and minimum values of the Y axis of the UV coordinate point in the UV coordinate system are calculated through the code, so as to obtain the length of the pipeline model in the UV coordinate axis.
[0057] In the Shader Graph editor, click the Settings icon in the upper right corner, and in the panel that pops up, select the Create Material Preset option. This will create a Material material sphere file based on the current Shader Graph.
[0058] Exporting Shader Graph as a material sphere file is a common practice in Unity development. The material sphere file generated in this method is an important carrier of UV material animation, which can not only be used to display UV animation, but also support attribute adjustment during program execution, providing strong support for the diversity of project special effects.
[0059] This method first needs to build a one-to-one system pipeline three-dimensional model according to the customer's requirements, and adjust the UV map of the system pipeline according to the requirements. The specific requirements for the UV map are: the UV map of a single pipeline three-dimensional model must have the diameter of the pipeline corresponding to the U axis and the length of the pipeline corresponding to the V axis. The UV map must be constructed in this way to adjust the fluid flow direction of the system pipeline. And the system can provide flow rate sensor data for each pipeline, on the basis of which the connection logic of the system pipeline is constructed using mind mapping and a mind map is formed; the mind map is exported as a configuration file and its format is set to text format for Unity program; then Shader Graph in Unity is used to create a UV material sphere for the three-dimensional pipeline; then UV map offset calculation is performed in the Unity program script, so as to add "single pipeline transition effect" to each pipeline; the configuration file of the pipeline connection logic is loaded using the Unity program script to control each pipeline, and finally the system-level pipeline start-stop transition effect is data-driven and presented through the flow rate data provided by the industrial system.< / mesh>
Claims
1. A method for realizing system-level pipeline start-stop transition effect based on Unity, characterized in that: The implementation steps are as follows:
1. Build a 3D model of n system-related pipelines; 2. Import the constructed 3D model into the Unity project; 3. Edit the pipeline connection logic and export the configuration file: draw a mind map of the relevant pipeline connection relationships; 4. Load configuration file: read the configuration file in TXT format; 5. Bind pipeline 3D model objects and pipeline connection logic: According to pipeline names and pipeline hierarchical relationships, 3D model objects are layered to form a structure that corresponds one-to-one with the hierarchical relationship in the configuration file; 6. Create a material ball for the start-stop transition effect of a single pipeline; 7. UV offset calculation: Calculate the center point offset of a single pipeline length in n systems to obtain the offset of the 3D model; finally, convert the offset of the 3D model to obtain the UV offset of the 3D model of a single pipeline; 8. Create the start-stop transition effect for a single pipeline: obtain the material ball for the start-stop transition effect through the 3D model, and set the progress control properties of the material ball; 9. Receive flow rate data collected from relevant pipeline flow rate sensors; 10. Create system-level pipeline start-stop transition effects: Read the configuration file exported by editing the pipeline connection logic, bind the pipeline hierarchy and the pipeline objects in the virtual scene; use the pipeline hierarchy to gradually call the 3D model of a single pipeline, and play the start-stop effect on the 3D model of the corresponding pipeline in the virtual scene, finally forming a complete system-level pipeline start-stop transition effect.
2. The method for realizing a system-level pipeline start-stop transition effect based on Unity according to claim 1, characterized in that: In step three, use EdrawMind Pro software to draw a mind map of the connection relationships of n system-related pipelines.
3. The method for realizing system-level pipeline start-stop transition effect based on Unity according to claim 1, characterized in that: In step eight, the progress control attribute of the material ball is set to adjust the performance state of the pipeline three-dimensional model and the ratio of the solid state part and the fluid state part of the pipeline three-dimensional model; the smaller the progress control value of the material ball, the smaller the volume of the fluid part and the larger the volume of the solid state part; the larger the progress control value of the material ball, the larger the volume of the fluid state part and the smaller the volume of the solid state part; by setting the progress control attribute of the material ball, the transition effect of a single pipeline three-dimensional model of n systems from the solid state to the fluid state is achieved.
4. The method for realizing a system-level pipeline start-stop transition effect based on Unity according to claim 2, characterized in that: In EdrawMind Pro, select File → Export → TXT to export the mind map. Use the hierarchical structure of the mind map to express the pipeline connection and segmentation logic, so that the pipeline connection logic and pipeline segmentation logic can be extracted in the Unity script, providing pipeline segmentation logic support for the system pipeline start and stop effects.
5. The method for realizing system-level pipeline start-stop transition effect based on Unity according to claim 3, characterized in that: To create a shader for a single pipeline start / stop transition effect in the Unity project's ShaderGraph component, follow these steps: A1. Use the UV function in the ShaderGraph component to obtain the UV properties of a single pipeline 3D model; A2. Pass the UV attributes of a single pipeline 3D model to the Split decomposition function and extract the V attribute from the UV attributes. A3. Use the multiplication function in the ShaderGraph component to multiply the V attribute in the UV attribute of the extracted single pipeline 3D model by the constant -1 to negate the V attribute value and obtain the corresponding negative value of the V attribute value; A4. Use the addition function in the ShaderGraph component to add the corresponding negative value of the V attribute value to the constant 1, and then positively offset the corresponding negative value of the V attribute value by one UV coordinate unit to obtain the starting point coordinate value of the start and stop effect of the single pipeline 3D model in the UV coordinate system V axis direction. A5. Pass the UV minimum offset, UV maximum offset, and the transition progress control Clip_UV for the transition of a single pipeline 3D model to the Lerp function in the ShaderGraph component. Dynamically transition the UV minimum offset and UV maximum offset based on the value of Clip_UV to obtain the offset value of the UV attribute of the current single pipeline 3D model in the V-axis direction in the UV coordinate system. A6. Use the addition function in the ShaderGraph component to add the V-axis offset value to the V-axis start / stop effect starting point coordinate value to obtain the target value of the single pipeline 3D model in the Y-axis of the UV coordinate system. A7. Assign the target value of a single pipeline 3D model in the Y-axis of the UV coordinate system to the transparency attribute of the fragment shader to achieve the function of dynamic transparency setting of the pipeline 3D model along the Y-axis direction.
6. The method for realizing system-level pipeline start-stop transition effect based on Unity according to claim 5, characterized in that: The calculation process for the minimum and maximum offsets of the shader ball 3D model for a single pipeline start-stop transition effect is as follows: B1. GetComponent of GameObject <mesh> () method obtains the mesh attribute object of the material ball 3D model of the start-stop transition effect of a single pipeline;< / mesh> B2. Get the UV point information list through the GetUV method of the mesh attribute object; B3. Traverse the UV point information list and find the minimum and maximum values along the Y axis. B4. Obtain the minimum uv offset and the maximum uv offset through the offset algorithm.
7. The method for realizing system-level pipeline start-stop transition effect based on Unity according to claim 6, characterized in that: The offset algorithm formula is as follows: float _sizeY = (_max_uv - _min_uv) * 0.5f; float _centerY = 0.5f - (_sizeY + _min_uv); float uv_min = _centerY - _sizeY; float uv_max = _centerY + _sizeY; Where max_uv is the maximum value of the Y axis in the UV point; min_uv is the minimum value of the Y axis in the UV point; float_sizeY is half of the total length in the Y-axis direction of the UV point information of the pipeline 3D model; sizeY is half of the total length of the UV point information in the Y-axis direction; float_centerY is the Y-axis center coordinate value in the UV point information of the pipeline 3D model; centerY is the center point coordinate value in the Y-axis direction of the UV point information; float uv_min is the UV minimum value offset in the UV point information of the pipeline 3D model; float uv_max is the UV maximum value offset in the UV point information of the pipeline 3D model.
Citation Information
Patent Citations
3D game development method based on Unity
CN111563942A
Method for simulating oil flow in hydraulic loop pipeline based on Unity
CN112365776A
Ship pipeline model and scene generation method and system based on mobile terminal
CN115859468A
Three-dimensional presentation method and system for dynamic flow of energy of cold and hot air power grid frame pipeline
CN116704150A
Method for realizing dynamic simulation of fluid characteristics in three-dimensional pipeline based on shader
CN118334224A