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

Figure CN120298510A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of marine science and technology, and particularly relates to a color dynamic mapping method, system and storage medium based on the Unreal Engine. Background Art
[0002] In the field of data visualization, the processing speed of visual information far exceeds that of text information, which makes data visualization an efficient and intuitive way of information transmission. Through forms such as graphics and charts, information such as patterns, trends, relationships, and outliers in the data can be clearly presented, greatly improving the user's ability to understand and analyze data.
[0003] As an important data visualization technology, color mapping maps data values to the corresponding color space and uses color changes to intuitively display the size and changes of data. Traditional color mapping methods usually use fixed color axes such as linear color axes, non-linear color axes, or segmented color axes for mapping. In the case of uneven data distribution, high data resolution, or when researchers want to focus on specific regions, there may be color aggregation phenomena, making the color changes less obvious within certain data ranges, making it difficult to observe the details, reducing the spatial diversity of visual resolution, and resulting in the high-resolution advantage of marine environmental data not being fully demonstrated through visualization effects. Summary of the Invention
[0004] The purpose of the present invention is to solve one of the above technical problems, and provides a color dynamic mapping method, system and storage medium based on the Unreal Engine. By creating a material parameter set in the Unreal Engine and exposing its parameters, it realizes dynamically adjusting the color axis used for data visualization during the visualization effect display, improving the flexibility and adaptability of the visualization expression of marine environmental data.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is: A color dynamic mapping method based on the Unreal Engine, comprising the following steps: S1: Obtain the original marine environmental data; perform normalization processing on the original marine environmental data and generate a texture object; the gray value of the texture object is the normalized value of the marine environmental data; S2: In the Unreal Engine, create a material parameter set with multiple vector parameters; S3: Introduce the material parameter set into the material system, and use the method of linear interpolation in the material system to perform linear color transition on multiple vector parameters to generate a color axis for data visualization; S4: Introduce the generated texture object into the material system, and map the gray value of the texture object to the colors in the color axis one by one in the material system to generate a visualization object of the marine environmental data; S5: In the blueprint script, disclose the numbers of the vector parameters in the material parameter set and the corresponding color values as parameters to form an interface for adjusting the material parameter set. S6: Set initial color values for the vector parameters in the material parameter set through the interface to achieve visual display of ocean environment data. S7: During the mapping process, dynamically adjust the color values corresponding to the vector parameters in the material parameter set through the interface, and regenerate the color axis for data mapping to update the visual display effect of the ocean environment data.
[0006] In some embodiments of the present invention, the following steps are included: S8: Perform slicing processing on the original ocean environment data based on a predetermined longitude and latitude coordinate range to obtain sliced ocean environment data, perform normalization processing on the sliced ocean environment data to obtain sliced texture objects, and introduce the sliced texture objects into the material system to map them one by one with the color axis generated by the material system to update the visual display effect of the ocean environment data within the predetermined longitude and latitude coordinate range.
[0007] In some embodiments of the present invention, the method for obtaining the predetermined longitude and latitude coordinate range in step S8 includes the following steps: Set a scene camera component in the Unreal Engine, and create four rays respectively at the origin of the camera component. Use the ray detection function to determine whether the four rays intersect with the visualization object; if they intersect, return the scene coordinates corresponding to the intersection points. Use the geographic registration system of the Unreal Engine to convert the four intersection point coordinates from scene coordinates to four longitude and latitude coordinates, thereby obtaining the predetermined longitude and latitude coordinate range.
[0008] In some embodiments of the present invention, step S3 specifically includes the following steps: S31: Introduce the material parameter set into the material system, and the material parameter set contains n vector parameters. S32: In the material system, divide a complete linear color axis into n linear color sub-intervals. For the i-th sub-interval among them, set its starting color as the color value corresponding to the i-th vector parameter, and the ending color as the color value of the (i + 1)-th vector parameter; where ; S32: Use a linear interpolation function to perform linear interpolation on each sub-interval to achieve color transition within the interval. S32: Arrange the color values within each sub-interval in the order of the intervals to generate a color axis for data visualization.
[0009] In some embodiments of the present invention, the linear interpolation function used in step S32 is: ; Wherein, is the first color value; is the second color value; is the linear interpolation coefficient.
[0010] In some embodiments of the present invention, the color values after interpolation in each sub - interval are expressed as: ; Wherein, is the color value after interpolation in the i - th sub - interval; is the color value corresponding to the (i + 1) - th vector parameter, is the relative position of the i - th sub - interval, The expression of is: .
[0011] In some embodiments of the present invention, step S6 specifically includes the following steps: S61: Create a blueprint object for visual management in the 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 an interface; S63: Determine an initial linear color axis and use this initial linear color axis to assign values to each vector parameter in the material parameter set.
[0012] In some embodiments of the present invention, in step S7, the method for dynamically adjusting the color values corresponding to the vector parameters in the material parameter set through an 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 this color point; The control blueprint passes the normalized value corresponding to this data value and the updated RGB value into the blueprint script; In the blueprint script, modify the color value of the vector parameter at the corresponding position in the material parameter set corresponding to the normalized value of this data value to the passed - in RGB value.
[0013] Some embodiments of the present invention further provide a color dynamic mapping system based on the Unreal Engine, including: At least one processor; At least one memory for storing at least one program; When at least one program is executed by at least one processor, at least one processor implements the above - mentioned color dynamic mapping method based on the Unreal Engine.
[0014] Some embodiments of the present invention further provide a storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0015] The beneficial effects of the present invention are as follows: 1. The present invention creates a material parameter set in the Unreal Engine, exposes the parameters of the material parameter set in the blueprint script, forms an adjustment interface, and can customize and modify the color axis in the Unreal Engine during the visualization display process of ocean environment data, that is, during the mapping process between the texture object in the Unreal Engine and the color axis for data visualization, realizing the dynamic adjustment of the visualization display effect of ocean environment data and improving the flexibility and adaptability of the visualization expression of ocean environment data. 2. The present invention realizes mapping the same color axis to a smaller range of data by slicing the ocean environment data in a specific area and regenerating the texture object to remap it with the color axis, thereby improving the accuracy of data detail display in the local area and being able to better reflect the characteristics of high-resolution ocean environment data.
[0016] Other features and advantages of the present invention will be described in the subsequent description, and some of them will become obvious from the description, or be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures pointed out in the description, claims, and drawings. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will describe the specific embodiments of the present invention in detail with reference to the drawings. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a flowchart of a color dynamic mapping method based on the Unreal Engine; Figure 2 It is a schematic diagram of the data processing process in the Unreal Engine provided by the embodiment of the present invention; Figure 3 It is a schematic diagram of the principle of the ray detection method provided by the embodiment of the present invention; Figure 4 It is a schematic diagram of ray detection in the Unreal Engine provided by the embodiment of the present invention; Figure 5 It is a schematic diagram of the update process of the visualization display effect of ocean environment data provided by the embodiment of the present invention. Detailed Embodiments
[0019] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be described and explained below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments provided in the present application without creative efforts belong to the scope of protection of the present application.
[0020] 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 otherwise clearly specified in the context, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.
[0021] In the case of no conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0022] The technical solutions of the present invention will be described in detail below in conjunction with specific embodiments and the accompanying drawings of the specification.
[0023] As shown in the attached Figure 1 - attached Figure 5 In a schematic embodiment of a color dynamic mapping method based on the Unreal Engine in the present invention, the color dynamic mapping method includes the following steps.
[0024] S1: Obtain the original ocean environment data.
[0025] Obtain the numerical range of the ocean environment data to be displayed, perform normalization processing on the ocean environment data, and generate a texture object from the data. The grayscale value of the generated texture object is the normalized value of the ocean environment data.
[0026] S2: In the Unreal Engine, create a material parameter set with n vector parameters. Among them, the numbers of the n vector parameters are 1 to n respectively, and each vector parameter corresponds to a color value.
[0027] S3: Introduce the material parameter set into the material system, and use the method of linear interpolation in the material system to perform linear color transition on the n vector parameters in the order of numbers from 1 to n, and generate a color axis for data visualization.
[0028] In some embodiments of the present invention, step S3 specifically includes the following steps.
[0029] S31: Introduce a set of material parameters into the material system, where the set of material parameters contains n vector parameters.
[0030] S32: In the material system, divide a complete linear color axis into n linear color sub-intervals; among them, the i-th sub-interval is expressed as: .
[0031] Among them, .
[0032] For the i-th sub-interval among them, set its starting color to the color value corresponding to the i-th vector parameter, and set the ending color to the color value of the (i + 1)-th vector parameter.
[0033] S32: Use a linear interpolation function to perform linear interpolation on each sub-interval to achieve color transition within the interval.
[0034] S33: Arrange the color values within each sub-interval in the order of the intervals to generate a color axis for data visualization.
[0035] In some embodiments of the present invention, the linear interpolation function used in step S32 is: .
[0036] Among them, is the first color value; is the second color value; is the linear interpolation coefficient.
[0037] In some embodiments of the present invention, the steps of using the linear interpolation function to perform linear interpolation on each sub-interval in step S32 include: Define a variable used to represent the relative position of the i-th sub-interval: .
[0038] Among them, is a clamping function, and the expression of the clamping function is: .
[0039] Obtain the color value corresponding to the vector parameter input by the set of material parameters .
[0040] Calculate the color value after interpolation for the first interval : ; And so on, the color value after interpolation for each sub-interval is expressed as: ; Among them, The color value after interpolation for the i-th sub-interval; is the color value corresponding to the (i + 1)-th vector parameter, is the relative position of the i-th sub-interval.
[0041] S4: Introduce the texture object generated in step 1 into the material system, and map the gray value of the texture object to the colors in the color axis one by one in the material system to generate a two-dimensional effect of data visualization, that is, the visualization object of ocean environment data.
[0042] S5: In the blueprint script, expose the numbers of the vector parameters in the material parameter set and the corresponding color values as parameters to form an interface for adjusting the material parameter set.
[0043] S6: Set the initial color values for the vector parameters in the material parameter set through the interface to achieve the visualization display of ocean environment data.
[0044] In some embodiments of the present invention, step S6 specifically includes the following steps: S61: Create a blueprint object for visualization management in the Unreal Engine.
[0045] 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.
[0046] S63: Determine an initial linear color axis and use this initial linear color axis to assign values to each vector parameter in the material parameter set.
[0047] S7: In order to better display the colors, during the mapping process, customize and adjust the color values corresponding to the vector parameters in the material parameter set through the interface, and re-execute steps S2 to S4, and then regenerate the color axis for data mapping to achieve dynamic updating of the visualization display effect of ocean environment data.
[0048] In some embodiments of the present invention, in step S7, the method of dynamically adjusting the color values corresponding to the vector parameters in the material parameter set through the interface specifically includes the following steps.
[0049] Select the data points or data ranges that the user wants to highlight in the control blueprint.
[0050] Obtain the normalized value x of the predetermined data value corresponding to the data point or data range.
[0051] Obtain the corresponding color point from the current color axis through x and update the RGB values of the color point, that is, update the color of the color point.
[0052] The control blueprint passes the normalized value x corresponding to the data value and the updated RGB value into the blueprint script.
[0053] In the blueprint script, modify the color value of the vector parameter at the corresponding position in the material parameter set for the normalized value corresponding to the data value to the passed-in RGB value, and the color mapping effect can be changed in real time during the system operation.
[0054] In the above-mentioned illustrative embodiments, by creating a material parameter set in the Unreal Engine and exposing the parameters of the material parameter set in the blueprint script to form an adjustment interface, during the visualization display process of ocean environment data, that is, during the mapping process between the texture object in the Unreal Engine and the color axis for data visualization, the color axis in the Unreal Engine can be customarily modified through this interface, thereby realizing the dynamic adjustment of the visualization display effect of ocean environment data, avoiding the occurrence of color aggregation phenomena, and improving the flexibility and adaptability of the visualization expression of ocean environment data.
[0055] In some embodiments of the present invention, when the data in some areas is too dense, resulting in unclear color distinction of the data in that area, or when the observer needs to focus on the data in a certain specific area, in order to increase the color contrast of the ocean environment data in the local area, the following steps are further included: S8: Perform slicing processing on the original ocean environment data based on a predetermined longitude and latitude coordinate range to obtain sliced ocean environment data, perform normalization processing on the sliced ocean environment data to obtain sliced texture objects, and introduce the sliced texture objects into the material system to perform one-to-one mapping with the color axis generated by the material system to update the visualization display effect of the ocean environment data within the predetermined longitude and latitude coordinate range. By performing slicing processing on the ocean environment data and re-executing steps 2 to 4 to remap it with the color axis already generated in the Unreal Engine, the color contrast of the local ocean environment data can be effectively improved, making it have a better visual resolution effect.
[0056] As shown in the attachment Figure 5 When the longitude range of the area of concern is reduced from 100°E to 150°E to 120°E to 150°E and the latitude range is reduced from 10°N to 40°N to 20°N to 40°N, by performing slicing processing on the ocean environment data within the area of 120°E to 150°E and 20°N to 40°N and remapping it with the color axis, the visual discrimination effect of the ocean environment data within the area of 120°E to 150°E and 20°N to 40°N can be effectively improved. The same is true when the area of concern is further reduced.
[0057] The update process of the visualization display effect of the ocean environment data within the predetermined longitude and latitude coordinate range is as shown in the attachment Figure 5 shown.
[0058] In some embodiments of the present invention, as shown in the appendix Figure 3 - appendix Figure 4 , the method for obtaining the predetermined longitude and latitude coordinate range in step S8 includes the following steps: Set up a scene camera component in the Unreal Engine, and create four rays respectively at the origin of the camera component. Set the angle of its vertical field of view to be , and the horizontal field of view angle to be , and stipulate that the forward direction of the camera observation is the positive direction.
[0059] Use the ray detection function to determine whether the four rays intersect with the visualization object.
[0060] If they intersect, return the scene coordinates corresponding to the intersection points.
[0061] Use the georegistration system of the Unreal Engine to convert the four intersection point coordinates from scene coordinates to four longitude and latitude coordinates, and thus obtain the predetermined longitude and latitude coordinate range.
[0062] Use the longitude and latitude coordinates as the boundaries of the data area within the line of sight to crop or expand the original ocean environment data, and re-obtain its numerical range.
[0063] In the Unreal Engine, as shown in the appendix Figure 2 , steps S1, S2, S5, and S8 are all implemented in the blueprint script, steps S3 to S4 are implemented in the material system, and step S7 is implemented in the control blueprint.
[0064] Some embodiments of the present invention further provide a color dynamic mapping system based on the Unreal Engine, including: At least one processor.
[0065] At least one memory for storing at least one program.
[0066] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned color dynamic mapping method based on the Unreal Engine.
[0067] Some embodiments of the present invention further provide a storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used to implement the above-mentioned color dynamic mapping method based on the Unreal Engine when executed by the processor.
[0068] Finally, it should be noted that: the various embodiments in this specification are described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. The same and similar parts among the various embodiments can be referred to each other.
[0069] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it; although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that: it is still possible to modify the specific implementation manners of the present invention or perform equivalent replacements on some technical features; without departing from the spirit of the technical solutions of the present invention, they should all be covered within the scope of the technical solutions claimed by the present invention.
Claims
1. A color dynamic mapping method based on the Unreal Engine, characterized in that, It includes the following steps: S1: Obtain the original marine environment data; perform normalization processing on the original marine environment data and generate a texture object; the gray value of the texture object is the normalized value of the marine environment data; S2: In the Unreal Engine, create a material parameter set with multiple vector parameters; S3: Introduce the material parameter set into the material system, and use linear interpolation in the material system to perform linear color transition on the multiple vector parameters to generate a color axis for data visualization; S4: Introduce the generated texture object into the material system, and map the gray value of the texture object to the colors in the color axis one by one in the material system to generate a visualization object of the marine environment data; S5: In the blueprint script, make the numbers of each vector parameter in the material parameter set and the corresponding color values public as parameters to form an interface for adjusting the material parameter set; S6: Set the initial color values for each vector parameter in the material parameter set through the interface to achieve the visualization display of the marine environment data; S7: During the mapping process, dynamically adjust the color values corresponding to the vector parameters in the material parameter set through the interface, and regenerate the color axis for data mapping to update the visualization display effect of the marine environment data.
2. The color dynamic mapping method based on the Unreal Engine according to claim 1, characterized in that It includes the following steps: S8: Perform slicing processing on the original marine environment data based on a predetermined longitude and latitude coordinate range to obtain sliced marine environment data, perform normalization processing on the sliced marine environment data to obtain a sliced texture object, and introduce the sliced texture object into the material system to map it to the color axis generated by the material system one by one to update the visualization display effect of the marine environment data within the predetermined longitude and latitude coordinate range.
3. The color dynamic mapping method based on the Unreal Engine according to claim 2, characterized in that The method for obtaining the predetermined longitude and latitude coordinate range in step S8 includes the following steps: Set a scene camera component in the Unreal Engine, and create four rays respectively at the origin of the camera component; Use the ray detection function to determine whether the four rays intersect with the visualization object; if they intersect, return the scene coordinates corresponding to the intersection points; Use the geographic registration system of the Unreal Engine to convert the four intersection point coordinates from scene coordinates to four longitude and latitude coordinates, and then obtain the predetermined longitude and latitude coordinate range.
4. The color dynamic mapping method based on the Unreal Engine according to claim 1, wherein, Step S3 specifically includes the following steps: S31: Introduce the material parameter set into the material system, and the material parameter set contains n vector parameters; S32: In the material system, divide a complete linear color axis into n linear color sub-intervals; For the i-th sub-interval among them, set its starting color to the color value corresponding to the i-th vector parameter, and set the ending color to the color value of the (i + 1)-th vector parameter; where ; S32: Use a linear interpolation function to perform linear interpolation on each sub-interval to achieve color transition within the interval; S32: Arrange the color values within each sub-interval in the interval order to generate a color axis for data visualization.
5. The color dynamic mapping method based on the Unreal Engine according to claim 4, wherein The linear interpolation function used in step S32 is: ; Wherein, is the first color value; is the second color value; is the linear interpolation coefficient.
6. The color dynamic mapping method based on the Unreal Engine according to claim 5, characterized in that The color values after interpolation of each sub-interval are expressed as: ; Among them, is the color value after interpolation in the i-th sub-interval; is the color value corresponding to the (i + 1)-th vector parameter, is the relative position of the i-th sub-interval, The expression of 。 7. The color dynamic mapping method based on the Unreal Engine according to claim 1, characterized in that Step S6 specifically includes the following steps: S61: Create a blueprint object for visualization management in the 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 this initial linear color axis to assign values to each vector parameter in the material parameter set.
8. The color dynamic mapping method based on the 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 a color point corresponding to a predetermined data value in the control blueprint and update the RGB value of the color point; The control blueprint passes the normalized value corresponding to the data value and the updated RGB value into the blueprint script; In the blueprint script, modify the color value of the vector parameter at the corresponding position in the material parameter set of the normalized value corresponding to the data value to the passed-in RGB value.
9. A color dynamic mapping system based on the Unreal Engine, characterized in that, Comprising: 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 according to any one of claims 1-8.
10. A storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the color dynamic mapping method based on the Unreal Engine according to any one of claims 1-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
Visualization method for ocean three-dimensional temperature-salt flow data
CN118708644A
Ocean data visualization method and system based on unreal engine and medium
CN118736158A
Ocean data visual color mapping method based on unreal engine
CN118840464A
Cited By
A multi-modal three-dimensional color map visualization method and system for space environmental particle density data
CN122548001A
A multi-modal three-dimensional color map visualization method and system for space environmental particle density data
CN122548001B