Unity-based system-level pipeline start-stop transition effect implementation method
By building 3D models, drawing mind maps, and calculating UV offsets in Unity, and combining this with flow rate sensor data, an animated display of system-level pipeline start-stop transition effects was achieved. This solved the problem that managers could not perceive pipeline start-stop changes globally, improving efficiency and user experience.
Patent Information
- Application Number
- CN202511292348.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-09-11
AI Technical Summary
In existing technologies, managers cannot have a global perception of the changes in the system pipeline during start-up and shutdown. They mainly rely on changes in measurement point values, which cannot intuitively display the flow velocity and flow direction of the pipeline.
The system-level pipeline start-stop transition effect is implemented using Unity. This involves building a 3D model, drawing a mind map, loading configuration files, binding pipeline connection logic, creating material spheres and calculating UV offsets, and using flow rate sensor data to drive the pipeline start-stop effect animation.
It improves work efficiency, reduces calculation errors, enhances the dynamic effects of virtual scenes and user experience, allows for the reuse of material spheres, has low program performance overhead, and is suitable for the start-up and shutdown management of multiple systems or multiple pipelines.
Smart Images

Figure CN120807808B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual simulation of industrial systems, and in particular to a method for implementing system-level pipeline start-stop transition effects based on Unity. Background Technology
[0002] In the industrial sector, pipelines are a crucial component of the entire system, and the flow direction of the medium within the pipeline during system startup and shutdown is a vital reference standard for managers to assess whether the system is operating correctly. Current monitoring methods primarily rely on changes in measurement points to represent the flow velocity and direction of the medium in the pipeline. While this approach is direct, it only provides managers with numerical changes and does not offer a comprehensive understanding of the entire pipeline startup and shutdown process. Summary of the Invention
[0003] In view of the current state of technology and existing problems, this invention provides a method for implementing system-level pipeline start-stop transition effects based on Unity. This method combines mind mapping with Unity engineering to construct a pipeline system in a 3D virtual scene and provides a method for displaying the transition effects of media during the start-stop process of the system pipeline. The aim is to provide a solution for system-level pipeline start-stop transition effects based on Unity engineering, thereby addressing the issue that administrators cannot globally perceive the start-stop changes of the entire system pipeline during startup and shutdown.
[0004] The technical solution adopted in this invention is as follows: A method for implementing system-level pipeline start-stop transition effects based on Unity includes the following steps:
[0005] Step 1: First, construct a 3D model of the n system-related pipelines.
[0006] Step 2: Import the constructed 3D models of the n system-related pipelines into the Unity project to provide a 3D model foundation for the subsequent pipeline connection logic and the 3D scene representation of the system pipelines.
[0007] Step 3: Edit the pipeline connection logic and export the configuration file: Combine the constructed 3D models of the n system-related pipelines, draw a mind map of the connection relationships of the n system-related pipelines, which is used to intuitively show the connection and hierarchical logic between the n system-related pipelines.
[0008] Step 4: Load the configuration file in the Unity project: Read the TXT format configuration file.
[0009] Step 5: Bind the 3D model objects of the pipeline and the pipeline connection logic: Based on the pipeline names and pipeline hierarchy described in the configuration file, the 3D model objects are processed into layers to form a structure that corresponds one-to-one with the hierarchy described in the configuration file, providing hierarchical and connection logic support for the system-level pipeline start-stop transition effect.
[0010] Step 6: Create a material sphere for the start / stop transition effect of a single pipeline.
[0011] Step 7, UV Offset Calculation: Calculate the offset of the center point of the length of a single pipeline in the UV coordinate system in the n systems to obtain the offset of the 3D model of a single pipeline in the UV coordinate system; finally, convert the offset of the 3D model of a single pipeline in the UV coordinate system to obtain the UV offset of the 3D model of a single pipeline in the n systems.
[0012] 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 the single pipeline, and set the progress control property of the material ball in the Unity script.
[0013] Step 9: Receive flow velocity data collected from n system-related pipeline flow velocity sensors; provide data support for subsequent system start-up and shutdown.
[0014] Step 10: Create a system-level pipeline start / stop transition effect: In the Unity project, first read the configuration file exported from 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 a single pipeline, play the start / stop effect on the corresponding 3D model of the pipeline in the virtual scene, and finally form a complete system-level pipeline start / stop transition effect.
[0015] Compared with existing technologies, this invention features high configurability, strong versatility, and high reusability, and is applicable to the start-stop transition effects of all pipelines in Unity-based projects. It can achieve start-stop management of multiple systems or multiple pipelines, effectively improving work efficiency.
[0016] The beneficial effects of this 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 the calculation error caused by manual calculation.
[0017] 2. Materials created using Shader Graph can be referenced multiple times in a project for other 3D models of the same type, greatly improving the reusability of materials.
[0018] 3. In a Unity project, the offset of a UV map can be calculated only once using a C# script and then reused multiple times, resulting in lower performance overhead for the program and eliminating the need to recalculate every time it is used.
[0019] 4. Using Unity program scripts to implement system-level pipeline start-stop transition effects according to pipeline connection logic, thereby greatly improving the dynamic effects of virtual scenes and the twin relationship between the actual system, and the resulting dynamic effect screen provides a better user sensory experience. Attached Figure Description
[0020] Figure 1 This is a flowchart of a method for implementing system-level pipeline start-stop transition effects based on Unity according to the present invention;
[0021] Figure 2 This is a mind map example of the pipeline connections in an embodiment of the present invention;
[0022] Figure 3 This is a flowchart of the process of creating a single pipeline start-stop transition effect using ShaderGraph in an embodiment of the present invention. Detailed Implementation
[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0024] like Figure 1 As shown, a method for implementing a system-level pipeline start / stop transition effect based on Unity includes the following steps:
[0025] Step 1: First, construct a 3D model of the n system-related pipelines.
[0026] Step 2: Import the constructed 3D models of the n system-related pipelines into the Unity project to provide a 3D model foundation for the subsequent pipeline connection logic and the 3D scene representation of the system pipelines.
[0027] Step 3: Edit the pipeline connection logic and export the configuration file: Combine the 3D models of the n system-related pipelines, use EdrawMind Pro software to draw a mind map of the connection relationships between the n system-related pipelines, which is used to intuitively show the connection and hierarchical logic between the n system-related pipelines.
[0028] like Figure 2 As shown, this method uses EdrawMind Pro software to draw a mind map, which represents the pipelines "XX System XX Pipeline 002" and "XX System XX Pipeline 011" under "XX System XX Pipeline 002", and the pipelines "XX System XX Pipeline 003" and "XX System XX Pipeline 004" under "XX System XX Pipeline 002", and so on, forming a complete connection logic diagram of the system.
[0029] In EdrawMind Pro, select File → Export → TXT to export the mind map. Utilize the hierarchical structure of the mind map to describe the pipeline connections 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's pipeline start-stop effect.
[0030] Step 4: Load the configuration file in the Unity project: Read the TXT format configuration file.
[0031] In a Unity project, there are various ways to read and parse configuration files of different formats, such as TXT, XML, JSON, and INI. This method uses the TXT format, which requires using the file reading methods of the System.File utility class in a Unity project.
[0032] Step 5: Bind the 3D model objects of the pipeline and the pipeline connection logic: Based on the pipeline names and pipeline hierarchy described in the configuration file, the 3D model objects are processed into layers to form a structure that corresponds one-to-one with the hierarchy described in the configuration file, providing hierarchical and connection logic support for the system-level pipeline start-stop transition effect.
[0033] Step 6: Create a material sphere for the start / stop transition effect of a single pipeline.
[0034] like Figure 3 As shown, the steps to create a material sphere for a single pipeline start / stop transition effect in Unity's ShaderGraph component are as follows:
[0035] A1. Use the UV function in the ShaderGraph component to obtain the UV properties of a single pipeline 3D model.
[0036] 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.
[0037] A3. Use the multiplication function in the ShaderGraph component to multiply the V property in the extracted single pipeline 3D model UV property with the constant -1, which is used to invert the V property value and obtain the corresponding negative value of the V property.
[0038] A4. Use the addition function in the ShaderGraph component to add the corresponding negative value of the V attribute to the constant 1, and then offset the corresponding negative value of the V attribute by one UV coordinate unit to obtain the starting point coordinates of the start and stop effect of a single pipeline 3D model in the V axis direction of the UV coordinate system.
[0039] A5. Pass the minimum UV offset, maximum UV offset, and the transition progress control Clip_UV during the transition of a single pipeline 3D model to the Lerp function in the ShaderGraph component. Based on the size of the Clip_UV value, dynamically transition the minimum UV offset and maximum UV offset to obtain the offset value of the UV attribute of the current single pipeline 3D model in the V-axis direction of the UV coordinate system.
[0040] A6. Use the addition function in the ShaderGraph component to add the offset value in the V-axis direction to the coordinate value of the starting point of the V-axis start / stop effect to obtain the target value of the single pipeline 3D model in the Y-axis of the UV coordinate system.
[0041] A7. By assigning the target value of a single pipeline 3D model in the Y-axis of the UV coordinate system to the transparency property of the fragment shader, the function of dynamically setting the transparency of the pipeline 3D model along the Y-axis direction can be realized.
[0042] First, you need to create a new Shader Graph editor by going to Assets -> Create -> Shader Graph -> URP -> LitShader Graph in the menu bar. Then, select Fragment Shader in the editor's panel and follow the steps... Figure 3 Set the transparency parameter in the Shader Graph.
[0043] Step 7, UV Offset Calculation: Calculate the offset of the center point of the length of a single pipeline in the UV coordinate system in the n systems to obtain the offset of the 3D model of a single pipeline in the UV coordinate system; finally, convert the offset of the 3D model of a single pipeline in the UV coordinate system to obtain the UV offset of the 3D model of a single pipeline in the n systems.
[0044] The calculation process for the minimum and maximum offsets of the material sphere 3D model for the start-stop transition effect of a single pipeline is as follows:
[0045] B1. Using the GetComponent method of the GameObject object <mesh>The () method obtains the mesh attribute object of the material sphere 3D model of a single pipeline start-stop transition effect.
[0046] B2. Obtain the UV point information list through the GetUV method of the grid property object.
[0047] B3. Traverse the UV point information list and find the minimum and maximum values in the Y-axis direction.
[0048] B4. The minimum and maximum UV offsets are obtained through the offset algorithm.
[0049] The offset algorithm formula is as follows:
[0050] float _sizeY = (_max_uv - _min_uv) * 0.5f;
[0051] float _centerY = 0.5f - (_sizeY + _min_uv);
[0052] float uv_min = _centerY - _sizeY;
[0053] float uv_max = _centerY + _sizeY;
[0054] In the formula, max_uv is the maximum value of the Y-axis at the UV point;
[0055] min_uv is the minimum value of the Y-axis at the UV point;
[0056] float _sizeY is half of the total length value in the Y-axis direction of the UV point information of the pipeline 3D model;
[0057] sizeY is half of the total length in the Y-axis direction of the UV point information;
[0058] float _centerY represents the center point coordinates in the Y-axis direction of the UV point information in the 3D model of the pipeline;
[0059] centerY is the coordinate value of the center point in the Y-axis direction of the UV point information;
[0060] float uv_min is the minimum offset of uv values in the UV point information of the pipeline 3D model;
[0061] float uv_max is the offset of the maximum value of uv in the UV point information of the pipeline 3D model.
[0062] The offset algorithm formula is derived by calculating the maximum and minimum values of the Y-axis of the UV point information in the UV coordinate system of the pipeline 3D model. The steps for running the offset algorithm formula are explained below:
[0063] float _sizeY = (_max_uv - _min_uv) * 0.5f;
[0064] The length of the UV point information in the Y-axis direction of the pipeline 3D model is obtained by subtracting the maximum value of the Y-axis _max_uv and the minimum value of the Y-axis _min_uv in the UV coordinate system. The length in the Y-axis direction is then multiplied by a constant 0.5 to obtain half of the length value in the Y-axis direction of the UV point information of the pipeline 3D model, and this value is assigned to a single-precision floating-point variable _sizeY.
[0065] float _centerY = 0.5f - (_sizeY + _min_uv);
[0066] Add half the length along the Y-axis to the minimum Y-axis value 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, i.e., the center point along the Y-axis. Subtract the center point offset from 0.5 to obtain the coordinate value of the center point of the UV point information along the Y-axis in the UV coordinate system, and assign this coordinate value to a single-precision floating-point variable _centerY.
[0067] float uv_min = _centerY - _sizeY;
[0068] The minimum offset of the UV point information in the UV coordinate system is obtained by subtracting half of the length value in the Y-axis direction of the UV point information of the pipeline 3D model from the center point coordinate value in the Y-axis direction of the UV point information. This coordinate value is then assigned to a single-precision floating-point variable uv_min.
[0069] float uv_max = _centerY + _sizeY;
[0070] The UV point information is obtained by adding half the length value of the UV point information in the Y-axis direction of the 3D pipeline model to the center point coordinate value in the Y-axis direction of the UV coordinate system. The maximum offset of the UV point information in the UV coordinate system is then obtained and the coordinate value is assigned to a single-precision floating-point variable uv_max.
[0071] The UV offset of this pipeline 3D model is calculated, providing the maximum and minimum UV displacement values for the transition effect of a single pipeline.
[0072] 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 the single pipeline, and set the progress control property of the material ball in the Unity script.
[0073] Taking the value range of the attribute Clip_uv from 0 to 1 as an example, when the attribute Clip_uv is 0, the three-dimensional model of a single pipeline is represented as a solid state, and when the attribute Clip_uv is 1, the three-dimensional model of a single pipeline is represented as a fluid state.
[0074] The progress control attribute of the material sphere is set to adjust the appearance of the pipeline 3D model and the ratio of the solid state to the fluid state. The smaller the progress control value of the material sphere, the smaller the volume of the fluid state and the larger the volume of the solid state. The larger the progress control value of the material sphere, the larger the volume of the fluid state and the smaller the volume of the solid state. By setting the progress control attribute of the material sphere, the transition effect of a single pipeline in n systems from the solid state to the fluid state can be achieved.
[0075] Step 9: Receive flow velocity data from n system-related pipeline flow velocity sensors; this provides data support for subsequent system start-up and shutdown. Pipeline flow velocity measurement data are shown in Table 1.
[0076] Table 1. Measurement Point Data Table
[0077] .
[0078] Step 10: Create a system-level pipeline start / stop transition effect: In Unity, first read the configuration file exported from 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, the hierarchical relationship of the pipelines is used to gradually call the 3D model of each individual pipeline. Then, combined with the flow velocity data transmitted from the flow velocity sensors of each pipeline, when the flow velocity data of a single pipeline is greater than 0, it indicates that fluid is passing through the pipeline. Then, the progress control attribute of the material ball in the corresponding 3D model of the pipeline is controlled by the program, and the progress control attribute is gradually increased from 0 to 1, thus forming the start / stop effect animation of the 3D model of the individual pipeline. The start / stop effect is played on the corresponding 3D model of the pipeline in the virtual scene, finally forming a complete system-level pipeline start / stop transition effect.
[0079] This method uses C# scripts in Unity to calculate UV offsets, involving adjustments to texture coordinates. UV coordinates are two-dimensional, and by modifying these coordinates, various visual effects can be achieved, such as animation and deformation.
[0080] UV offset refers to the method of changing the position of the texture on the model surface by adjusting the offset of the UV coordinates during the UV mapping process. The UV offset amount represents the magnitude of the UV offset value.
[0081] This method calculates the UV offset by first using the UV coordinate information recorded in the 3D model and the flow direction of the pipeline. When the pipeline flows along the Y-axis, the maximum and minimum values of the UV coordinate points on the Y-axis in the UV coordinate system need to be calculated using code to obtain the length of the pipeline model in the UV coordinate axis.
[0082] In the Shader Graph editor, click the Settings icon in the upper right corner. In the pop-up panel, select the Create Material Preset option. This will create a Material sphere file based on the current Shader Graph.
[0083] Exporting a Shader Graph as a material file is a common practice in Unity development. The material file generated in this method is an important carrier for UV material animation. It can not only be used to display UV animation, but also supports adjusting properties at runtime, providing strong support for the diversity of special effects in the project.
[0084] This method first requires constructing a 1:1 scale 3D model of the system piping according to the client's requirements, and adjusting the UV mapping of the system piping as needed. Specific requirements for UV mapping are: the UV mapping of a single pipe 3D model must correspond to the pipe diameter on the U-axis and the pipe length on the V-axis. UV mapping must be constructed in this manner to adjust the fluid flow direction of the system piping. The system can provide flow velocity sensor data for each pipe. Based on this, a mind map is used to construct the connection logic of the system piping and form a mind map. The mind map is exported as a configuration file and formatted as text for the Unity program. Then, UV materials are created for the 3D pipes using Unity's Shader Graph. UV map offset calculations are then performed in the Unity program script to add "individual pipe transition effects" to each pipe segment. The Unity program script loads the configuration file of the pipe connection logic to control each pipe segment. Finally, the flow velocity data provided by the industrial system drives and presents the system-level pipe start-stop transition effects.< / mesh>
Claims
1. A method for implementing system-level pipeline start / stop transition effects based on Unity, characterized in that, The implementation method involves the following steps:
1. Construct three-dimensional models 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; IV. Load Configuration File: Reads a TXT format configuration file; V. Binding Pipeline 3D Model Objects and Pipeline Connection Logic: Based on the pipeline name and pipeline hierarchy, the 3D model objects are layered to form a structure that corresponds one-to-one with the hierarchy in the configuration file; 6. Create a material sphere for the start-stop transition effect of a single pipeline; VII. UV Offset Calculation: Calculate the center point offset of the length of a single pipeline 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 start-stop transition effects for a single pipeline: Obtain the material sphere for the start-stop transition effect through the 3D model and set the progress control properties of the material sphere; 9. Receive flow velocity data collected from relevant pipeline flow velocity sensors; 10. Create system-level pipeline start / stop transition effects: Read the configuration file exported from the pipeline connection logic, bind the pipeline hierarchy to the pipeline objects in the virtual scene; use the pipeline hierarchy to gradually call the 3D model of a single pipeline, play the start / stop effect on the corresponding 3D model of the pipeline in the virtual scene, and finally form a complete system-level pipeline start / stop transition effect. To create a material for a single pipeline start / stop transition effect in the ShaderGraph component of a Unity project, follow these steps: A1. Use the UV function in the ShaderGraph component to get 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 property in the extracted single pipeline 3D model UV property by the constant -1, which is used to invert the V property value and obtain the corresponding negative value of the V property. A4. Use the addition function in the ShaderGraph component to add the corresponding negative value of the V property to the constant 1, and offset the corresponding negative value of the V property by one UV coordinate system unit in the positive direction to obtain the starting point coordinate value of the start and stop effect of a single pipeline 3D model in the V axis direction of the UV coordinate system. A5. Pass the minimum UV offset, maximum UV offset, and the transition progress control Clip_UV during the transition of a single pipeline 3D model to the Lerp function in the ShaderGraph component. Based on the size of the Clip_UV value, dynamically transition the minimum UV offset and maximum UV offset to obtain the offset value of the UV attribute of the current single pipeline 3D model in the V-axis direction of the UV coordinate system. A6. Use the addition function in the ShaderGraph component to add the offset value in the V-axis direction to the coordinate value of the starting point of the start / stop effect in the V-axis direction to obtain the target value of the 3D model of a single pipeline in the Y-axis of the UV coordinate system. A7. By assigning the target value of a single pipeline 3D model in the Y-axis of the UV coordinate system to the transparency property of the fragment shader, the function of dynamically setting the transparency of the pipeline 3D model along the Y-axis direction can be realized.
2. The method for implementing system-level pipeline start / stop transition effects based on Unity according to claim 1, characterized in that, In step three, use EdrawMind Pro software to draw a mind map showing the connection relationships of the n system-related pipelines.
3. The method for implementing system-level pipeline start / stop transition effects based on Unity according to claim 1, characterized in that, In step eight, the progress control attribute of the material sphere is set to adjust the appearance of the pipeline 3D model and the ratio of the solid state part and the fluid state part of the pipeline 3D model. The smaller the progress control value of the material sphere, 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 sphere, 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 sphere, the transition effect of the individual pipeline 3D model of n systems from solid state to fluid state can be achieved.
4. The method for implementing system-level pipeline start / stop transition effects based on Unity according to claim 2, characterized in that, In EdrawMind Pro, select File → Export → TXT to export the mind map. Utilize the hierarchical structure of the mind map to describe the pipeline connections 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's pipeline start-stop effect.
5. The method for implementing system-level pipeline start / stop transition effects based on Unity according to claim 1, characterized in that, The calculation process for the minimum and maximum offsets of the material sphere 3D model for the start-stop transition effect of a single pipeline is as follows: B1. Using the GetComponent method of the GameObject object <mesh> The () method obtains the mesh attribute object of the material sphere 3D model of a single pipeline start-stop transition effect;< / mesh> B2. Obtain the UV point information list through the GetUV method of the grid attribute object; B3. Traverse the UV point information list and find the minimum and maximum values in the Y-axis direction; B4. The minimum and maximum UV offsets are obtained through the offset algorithm.
6. The method for implementing system-level pipeline start / stop transition effects based on Unity according to claim 5, 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; In the formula, _max_uv is the maximum value of the Y-axis at the UV point; _min_uv is the minimum value of the Y-axis at the UV point; float _sizeY is half of the total length value in the Y-axis direction of the UV point information of the pipeline 3D model; _sizeY is half of the total length in the Y-axis direction of the UV point information; float _centerY represents the center point coordinates in the Y-axis direction of the UV point information in the 3D model of the pipeline; _centerY represents the center point coordinates along the Y-axis in the UV location information; float uv_min is the minimum offset of uv values in the UV point information of the pipeline 3D model; float uv_max is the offset of the maximum value of uv in the UV point information of the pipeline 3D model.
Citation Information
Patent Citations
Method for realizing dynamic simulation of fluid characteristics in three-dimensional pipeline based on shader
CN118334224A