Color dynamic mapping method, system and storage medium based on Unreal Engine
By creating a material parameter set in Unreal Engine and dynamically adjusting the color value, the problem of color changes in traditional color mapping methods is solved, and flexible visualization and high-resolution display of marine environmental data is realized.
Patent Information
- Application Number
- CN202510787587.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Traditional color mapping methods lead to uneven data distribution or high resolution, resulting in less obvious color changes, making it difficult to observe the details of marine environment data, and reducing the diversity of visual resolution space.
Create a material parameter set in Unreal Engine, and generate a color axis through linear interpolation, combine it with blueprint scripts to form an adjustment interface, and dynamically adjust the color value to achieve visualization of marine environment data.
It improves the flexibility and adaptability of marine environmental data visualization, and enhances the accuracy and visual resolution effect of local area data details.
Smart Images

Figure CN120298510B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of marine science and technology, and in particular relates to a color dynamic mapping method, system and storage medium based on an Unreal Engine. Background Art
[0002] In the field of data visualization, visual information is processed much faster than textual information, making it an efficient and intuitive way to convey information. Through graphs and charts, patterns, trends, relationships, and outliers in the data are clearly presented, greatly enhancing users' ability to understand and analyze data.
[0003] Color mapping, an important data visualization technique, maps data values to corresponding color spaces, using color changes to intuitively display the size and changes of data. Traditional color mapping methods typically use fixed color axes such as linear, nonlinear, or segmented color axes for mapping. This mapping method may lead to color aggregation when data distribution is uneven, data resolution is high, or researchers want to focus on specific areas. This makes color changes unclear within certain data ranges, making it difficult to observe details. This reduces the spatial diversity of visual resolution and prevents the high-resolution advantages of marine environmental data from being fully demonstrated through visualization. Summary of the Invention
[0004] The purpose of the present invention is to solve one of the above-mentioned technical problems and provide a color dynamic mapping method, system and storage medium based on Unreal Engine, which creates a material parameter set in Unreal Engine and discloses its parameters, thereby realizing dynamic adjustment of the color axis used for data visualization during the visualization effect display process, thereby improving the flexibility and adaptability of the visualization expression of marine environment data.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A color dynamic mapping method based on Unreal Engine, comprising the following steps:
[0007] S1: Obtain original ocean environment data; perform normalization processing on the original ocean environment data and generate a texture object; the grayscale value of the texture object is the normalized value of the ocean environment data;
[0008] S2: In Unreal Engine, create a material parameter set with multiple vector parameters;
[0009] S3: Introduce the material parameter set into the material system, use linear interpolation to perform linear color transition on multiple vector parameters in the material system, and generate a color axis for data visualization;
[0010] S4: introducing the generated texture object into the material system, mapping the grayscale value of the texture object to the color in the color axis in the material system, and generating a visualization object of the ocean environment data;
[0011] S5: Expose the numbers and corresponding color values of each vector parameter in the material parameter set as parameters in the blueprint script, forming an interface for adjusting the material parameter set;
[0012] S6: Set the initial color value for each vector parameter in the material parameter set through the interface to achieve visual display of ocean environment data;
[0013] S7: During the mapping process, the color values corresponding to the vector parameters in the material parameter set are dynamically adjusted through the interface, and the color axis is regenerated for data mapping to update the visual display effect of the ocean environment data.
[0014] In some embodiments of the present invention, the following steps are included:
[0015] S8: Slice the original ocean environment data based on a predetermined latitude and longitude coordinate range to obtain sliced ocean environment data, normalize the sliced ocean environment data to obtain a slice texture object, introduce the slice texture object into the material system and perform one-to-one mapping with the color axis generated by the material system to update the visual display effect of the ocean environment data within the predetermined latitude and longitude coordinate range.
[0016] In some embodiments of the present invention, the method for obtaining the predetermined latitude and longitude coordinate range in step S8 includes the following steps:
[0017] Set up the scene camera component in Unreal Engine and create four rays at the origin of the camera component.
[0018] Use the ray detection function to determine whether the four lines intersect with the visual object; if so, return the scene coordinates corresponding to the intersection point;
[0019] The Unreal Engine's georeferencing system is used to convert the four intersection coordinates from scene coordinates to four longitude and latitude coordinates, thereby obtaining a predetermined longitude and latitude coordinate range.
[0020] In some embodiments of the present invention, step S3 specifically includes the following steps:
[0021] S31: Introduce a material parameter set into the material system, where the material parameter set contains n vector parameters;
[0022] S32: In the material system, a complete linear color axis is divided into n linear color sub-intervals;
[0023] For the ith subinterval, its starting color is set to the color value corresponding to the ith vector parameter, and its ending color is set to the color value of the i+1th vector parameter; ;
[0024] S32: using a linear interpolation function to perform linear interpolation on each sub-interval to achieve color transition within the interval;
[0025] S32: Arrange the color values in each sub-interval in interval order to generate a color axis for data visualization.
[0026] In some embodiments of the present invention, the linear interpolation function used in step S32 is:
[0027] ;
[0028] in, is the first color value; is the second color value; is the linear interpolation coefficient.
[0029] In some embodiments of the present invention, the color value after interpolation of each subinterval is expressed as:
[0030] ;
[0031] in, is the color value after interpolation of the i-th subinterval; is the color value corresponding to the i+1th vector parameter, is the relative position of the ith subinterval, The expression is:
[0032] .
[0033] In some embodiments of the present invention, step S6 specifically includes the following steps:
[0034] S61: Create blueprint objects for visual management in Unreal Engine;
[0035] S62: Create a dynamic parameter instance in the blueprint object and associate it with the material parameter set created in step S2 through the interface;
[0036] S63: Determine an initial linear color axis, and use the initial linear color axis to assign a value to each vector parameter in the material parameter set.
[0037] In some embodiments of the present invention, in step S7, the method for dynamically adjusting the color value corresponding to the vector parameter in the material parameter set through the interface specifically includes the following steps:
[0038] Select the color point corresponding to the predetermined data value in the control blueprint and update the RGB value of the color point;
[0039] The control blueprint passes the normalized value and updated RGB value corresponding to the data value into the blueprint script;
[0040] In the blueprint script, the color value of the vector parameter at the corresponding position in the material parameter set corresponding to the normalized value of the data value is modified to the passed-in RGB value.
[0041] Some embodiments of the present invention further provide a color dynamic mapping system based on Unreal Engine, comprising:
[0042] at least one processor;
[0043] at least one memory for storing at least one program;
[0044] When at least one program is executed by at least one processor, the at least one processor implements the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0045] Some embodiments of the present invention further provide a storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to implement the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0046] The beneficial effects of the present invention are:
[0047] 1. The present invention creates a material parameter set in the Unreal Engine and discloses the parameters of the material parameter set in a blueprint script to form an adjustment interface. During the visualization of marine environmental data, that is, during the mapping process between texture objects in the Unreal Engine and the color axis used for data visualization, the color axis in the Unreal Engine can be customized and modified with the help of this interface. This achieves dynamic adjustment of the visual display effect of marine environmental data and improves the flexibility and adaptability of the visual expression of marine environmental data.
[0048] 2. The present invention slices the marine environment data of a specific area and regenerates the texture objects and remaps the color axes, thereby mapping the same color axis to a smaller range of data, thereby improving the accuracy of displaying data details in the local area and better reflecting the high-resolution characteristics of marine environment data.
[0049] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0051] Figure 1 This is a flowchart of a color dynamic mapping method based on Unreal Engine;
[0052] Figure 2 A schematic diagram of the data processing process in the Unreal Engine provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of the principle of the ray detection method provided by an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of ray detection in the Unreal Engine provided by an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of the updating process of the visual display effect of marine environment data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely used to explain this application and are not intended to limit this application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without making any creative efforts are within the scope of protection of this application.
[0057] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.
[0059] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.
[0060] As attached Figure 1 -Attached Figure 5 As shown, in an exemplary embodiment of a color dynamic mapping method based on Unreal Engine of the present invention, the color dynamic mapping method includes the following steps.
[0061] S1: Obtain raw ocean environment data.
[0062] Obtain the numerical range of the ocean environment data to be displayed, normalize the ocean environment data, and generate a texture object based on the data. The grayscale value of the generated texture object is the normalized value of the ocean environment data.
[0063] S2: In Unreal Engine, create a material parameter set with n vector parameters, where the n vector parameters are numbered 1 to n, and each vector parameter corresponds to a color value.
[0064] S3: Introduce the material parameter set into the material system, and use the linear interpolation method in the material system to perform linear color transition on n vector parameters in the order of numbering from 1 to n, to generate a color axis for data visualization.
[0065] In some embodiments of the present invention, step S3 specifically includes the following steps.
[0066] S31: Introduce a material parameter set into the material system, where the material parameter set includes n vector parameters.
[0067] S32: In the material system, a complete linear color axis is divided into n linear color sub-intervals; wherein the i-th sub-interval is represented as:
[0068] .
[0069] in, .
[0070] For the i-th subinterval, its starting color is set to the color value corresponding to the i-th vector parameter, and its ending color is set to the color value of the i+1-th vector parameter.
[0071] S32: Performing linear interpolation on each sub-interval using a linear interpolation function to achieve color transition within the interval.
[0072] S33: Arrange the color values in each sub-interval in interval order to generate a color axis for data visualization.
[0073] In some embodiments of the present invention, the linear interpolation function used in step S32 is:
[0074] .
[0075] in, is the first color value; is the second color value; is the linear interpolation coefficient.
[0076] In some embodiments of the present invention, the step of performing linear interpolation on each subinterval using a linear interpolation function in step S32 includes:
[0077] Defining variables Used to indicate the relative position of the i-th subinterval:
[0078] .
[0079] in, is the clamping function, and the expression of the clamping function is:
[0080] .
[0081] Get the color value corresponding to the vector parameter input of the material parameter set .
[0082] Calculate the interpolated color value of the first interval :
[0083] ;
[0084] By analogy, the interpolated color values of each subinterval are expressed as:
[0085] ;
[0086] in, is the color value after interpolation of the i-th subinterval; is the color value corresponding to the i+1th vector parameter, is the relative position of the ith subinterval.
[0087] S4: The texture object generated in step 1 is introduced into the material system, and the grayscale value of the texture object is mapped one by one to the color in the color axis in the material system to generate a two-dimensional data visualization effect, that is, a visualization object of the marine environment data.
[0088] S5: In the blueprint script, the number of each vector parameter in the material parameter set and the corresponding color value are exposed as parameters to form an interface for adjusting the material parameter set.
[0089] S6: Initialize the color value for each vector parameter in the material parameter set through the interface to achieve visual display of the ocean environment data.
[0090] In some embodiments of the present invention, step S6 specifically includes the following steps:
[0091] S61: Create Blueprint objects for visual management in Unreal Engine.
[0092] S62: Create a dynamic parameter instance in the blueprint object and associate it with the material parameter set created in step S2 through the interface.
[0093] S63: Determine an initial linear color axis, and use the initial linear color axis to assign a value to each vector parameter in the material parameter set.
[0094] S7: In order to better display the colors, during the mapping process, the color values corresponding to the vector parameters in the material parameter set are customized through the interface, and steps S2 to S4 are re-executed to regenerate the color axis for data mapping, so as to achieve the dynamic update of the visual display effect of the marine environment data.
[0095] In some embodiments of the present invention, in step S7, the method of dynamically adjusting the color value corresponding to the vector parameter in the material parameter set through the interface specifically includes the following steps.
[0096] In the Widget Blueprint, select the data point or data range that you want to highlight.
[0097] Get the normalized value x of the predetermined data value corresponding to the data point or data range.
[0098] Get the corresponding color point from the current color axis through x, update the RGB value of the color point, that is, update the color of the color point.
[0099] The widget blueprint passes the normalized value x and updated RGB value corresponding to the data value into the blueprint script.
[0100] In the Blueprint script, by modifying the color value of the vector parameter at the corresponding position in the material parameter set, the normalized value corresponding to the data value, to the passed RGB value, the color mapping effect can be changed in real time during the system operation.
[0101] In the above-mentioned exemplary embodiment, by creating a material parameter set in the Unreal Engine and exposing the parameters of the material parameter set in the blueprint script, an adjustment interface is formed. During the visualization display of the marine environment data, that is, during the mapping process between the texture object in the Unreal Engine and the color axis used for data visualization, the color axis in the Unreal Engine can be customized with the help of this interface, thereby realizing dynamic adjustment of the visualization display effect of the marine environment data, avoiding the occurrence of color aggregation, and improving the flexibility and adaptability of the visualization expression of the marine environment data.
[0102] In some embodiments of the present invention, when data in a certain area is too dense, resulting in unclear color distinction of the data in that area, or when an observer needs to focus on data in a specific area, in order to increase the color contrast of the marine environment data in the local area, the following steps are further included:
[0103] S8: Slicing the original ocean environment data based on a predetermined latitude and longitude coordinate range to obtain sliced ocean environment data, normalizing the sliced ocean environment data to obtain a sliced texture object, and introducing the sliced texture object into the material system for one-to-one mapping with the color axis generated by the material system to update the visual display effect of the ocean environment data within the predetermined latitude and longitude coordinate range. By slicing the ocean environment data and re-performing steps 2 to 4 to remap it with the color axis generated in the Unreal Engine, the color contrast of the local ocean environment data can be effectively improved, resulting in better visual resolution.
[0104] As attached Figure 5 As shown in the figure, when the longitude range of the focus area is reduced from 100°E-150°E to 120°E-150°E, and the latitude range is reduced from 10°N-40°N to 20°N-40°N, slicing the marine environmental data within the area of 120°E-150°E, 20°N-40°N and remapping it with the color axis can effectively improve the visual distinction of the marine environmental data within the area of 120°E-150°E, 20°N-40°N. The same applies when the focus area is further reduced.
[0105] The updating process of the visual display effect of the marine environment data within the predetermined latitude and longitude coordinate range is shown in the attached figure. Figure 5 shown.
[0106] In some embodiments of the present invention, as shown in the attached Figure 3 -Attached Figure 4 The method for obtaining the predetermined latitude and longitude coordinate range in step S8 includes the following steps:
[0107] Set up the scene camera component in Unreal Engine and create four rays at the origin of the camera component. Set the vertical field of view angle to , the horizontal field of view angle is , and stipulate that the forward direction of the camera observation is the positive direction.
[0108] Use the ray detection function to determine whether the four suspected lines intersect with the visual object.
[0109] If they intersect, the scene coordinates corresponding to the intersection are returned.
[0110] The Unreal Engine's georeferencing system is used to convert the four intersection coordinates from scene coordinates to four longitude and latitude coordinates, thereby obtaining a predetermined longitude and latitude coordinate range.
[0111] The original ocean environment data is clipped or expanded using the longitude and latitude coordinates as the boundaries of the data area within the line of sight to regain its value range.
[0112] In Unreal Engine, as shown in the attached Figure 2 As shown, steps S1, S2, S5, and S8 are all implemented in the blueprint script, steps S3 and S4 are implemented in the material system, and step S7 is implemented in the control blueprint.
[0113] Some embodiments of the present invention further provide a color dynamic mapping system based on Unreal Engine, comprising:
[0114] At least one processor.
[0115] At least one memory is used to store at least one program.
[0116] When at least one program is executed by at least one processor, the at least one processor implements the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0117] Some embodiments of the present invention further provide a storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to implement the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0118] Finally, it should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0119] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the same. Although the present invention has been described in detail with reference to preferred embodiments, persons skilled in the art should understand that the specific implementation methods of the present invention may still be modified or some technical features may be replaced by equivalents without departing from the spirit of the technical solutions of the present invention, and all of these should fall within the scope of the technical solutions claimed for protection by the present invention.
Claims
1. A color dynamic mapping method based on Unreal Engine, characterized in that: The following steps are involved: S1: obtaining original ocean environment data; normalizing the original ocean environment data and generating a texture object; the grayscale value of the texture object is the normalized value of the ocean environment data; S2: In Unreal Engine, create a material parameter set with multiple vector parameters; S3: introducing the material parameter set into the material system, performing linear color transition on the multiple vector parameters using a linear interpolation method in the material system, and generating a color axis for data visualization; S4: introducing the generated texture object into the material system, mapping the grayscale value of the texture object to the color in the color axis in the material system, and generating a visualization object of the ocean environment data; S5: Expose the numbers and corresponding color values of each vector parameter in the material parameter set as parameters in the blueprint script, forming an interface for adjusting the material parameter set; S6: setting an initial color value for each vector parameter in the material parameter set through the interface to achieve visual display of the ocean environment data; S7: During the mapping process, the color values corresponding to the vector parameters in the material parameter set are dynamically adjusted through the interface, and the color axis is regenerated for data mapping to update the visual display effect of the ocean environment data.
2. The color dynamic mapping method based on Unreal Engine according to claim 1, characterized in that: The following steps are involved: S8: Slice the original ocean environment data based on a predetermined latitude and longitude coordinate range to obtain sliced ocean environment data, normalize the sliced ocean environment data to obtain a slice texture object, introduce the slice texture object into the material system and perform one-to-one mapping with the color axis generated by the material system to update the visual display effect of the ocean environment data within the predetermined latitude and longitude coordinate range.
3. The color dynamic mapping method based on Unreal Engine according to claim 2, characterized in that: The method for obtaining the predetermined latitude and longitude coordinate range in step S8 includes the following steps: Set up the scene camera component in Unreal Engine and create four rays at the origin of the camera component. Use the ray detection function to determine whether the four lines intersect with the visual object; if so, return the scene coordinates corresponding to the intersection point; The Unreal Engine's georeferencing system is used to convert the four intersection coordinates from scene coordinates to four longitude and latitude coordinates, thereby obtaining a predetermined longitude and latitude coordinate range.
4. The color dynamic mapping method based on Unreal Engine according to claim 1, characterized in that: Step S3 specifically includes the following steps: S31: introducing a material parameter set into a material system, wherein the material parameter set includes n vector parameters; S32: In the material system, a complete linear color axis is divided into n linear color sub-intervals; For the i-th subinterval, its starting color is set to the color value corresponding to the i-th vector parameter, and its ending color is set to the color value of the i+1-th vector parameter; ; S32: using a linear interpolation function to perform linear interpolation on each sub-interval to achieve color transition within the interval; S32: Arrange the color values in each sub-interval in interval order to generate a color axis for data visualization.
5. The color dynamic mapping method based on Unreal Engine according to claim 4, characterized in that: The linear interpolation function used in step S32 is: ; in, is the first color value; is the second color value; is the linear interpolation coefficient.
6. The color dynamic mapping method based on Unreal Engine according to claim 5, characterized in that: The interpolated color values of each subinterval are expressed as: ; in, is the color value after interpolation of the i-th subinterval; is the color value corresponding to the i+1th vector parameter, is the relative position of the ith subinterval, The expression is: 。 7. The color dynamic mapping method based on Unreal Engine according to claim 1, characterized in that: Step S6 specifically includes the following steps: S61: Create blueprint objects for visual management in Unreal Engine; S62: Create a dynamic parameter instance in the blueprint object and associate it with the material parameter set created in step S2 through the interface; S63: Determine an initial linear color axis, and use the initial linear color axis to assign a value to each vector parameter in the material parameter set.
8. The color dynamic mapping method based on Unreal Engine according to claim 1, characterized in that: In step S7, the method for dynamically adjusting the color value corresponding to the vector parameter in the material parameter set through the interface specifically includes the following steps: Select the color point corresponding to the predetermined data value in the control blueprint and update the RGB value of the color point; The control blueprint passes the normalized value and updated RGB value corresponding to the data value into the blueprint script; In the blueprint script, the color value of the vector parameter at the corresponding position in the material parameter set corresponding to the normalized value of the data value is modified to the passed-in RGB value.
9. A color dynamic mapping system based on Unreal Engine, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the color dynamic mapping method based on the Unreal Engine as described in any one of claims 1 to 8.
10. A storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the Unreal Engine-based color dynamic mapping method as claimed in any one of claims 1 to 8 when executed by the processor.
Citation Information
Patent Citations
Method and device for generating dynamic color of model based on Unreal engine
CN117173313A
Model information processing method and device, storage medium and electronic device
CN118217626A