Wind field three-dimensional visualization rendering method and device, equipment and medium
By converting 3D wind field data into a 1D texture array and utilizing ray rendering technology, the problems of information loss and low rendering efficiency in traditional wind field visualization are solved, achieving efficient and intuitive 3D wind field visualization, and supporting real-time interaction and scene fusion of high-density grid points.
Patent Information
- Application Number
- CN202511498374.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-02-17
AI Technical Summary
Traditional wind field visualization techniques cannot fully express the structure and dynamic changes of wind fields in the vertical direction, resulting in the loss of key information and making it difficult to support in-depth analysis and decision-making of complex atmospheric phenomena. In particular, it is difficult to achieve efficient and smooth visualization of large-scale wind field data in a Web environment.
By converting 3D wind field data into a 1D texture array, ray rendering technology is used to simulate light passing through the wind field bounding box. Wind speed data is sampled point by point and mapped to color and opacity. Combined with depth buffer to detect opaque object occlusion, true 3D volume rendering is achieved, simplifying the transmission and rendering mechanism.
It improves the efficiency and scene integration of 3D visualization rendering of wind fields, ensures the physical consistency between wind fields and terrain or buildings in the scene, avoids rendering clipping problems, and achieves efficient and intuitive wind field visualization.
Smart Images

Figure CN121544780A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image rendering technology, and in particular to a method, apparatus, device and medium for three-dimensional visualization rendering of wind fields. Background Technology
[0002] 3D visualization and rendering of wind fields is of great significance for meteorological forecasting, aviation and maritime safety, environmental monitoring, urban planning, and wind power generation. Traditional 2D visualization methods cannot fully express the vertical structure and dynamic changes of wind fields, resulting in the loss of key information and hindering in-depth analysis and decision-making regarding complex atmospheric phenomena. 3D volumetric rendering technology can intuitively display the three-dimensional structure, wind speed distribution, and flow trends of wind fields, improving the understanding of overall wind field behavior and local characteristics, and providing more accurate and intuitive data support for various industries.
[0003] Existing wind field visualization technologies mainly include two-dimensional planar heatmaps, streamline tracing, and isosurface modeling. However, two-dimensional heatmaps can only represent wind speed distribution at a certain height and cannot reflect the wind field structure in the vertical dimension; streamline tracing can show the wind flow path, but it is prone to visual confusion when data is dense and it is difficult to quantitatively express wind speed; isosurface methods construct three-dimensional surfaces by extracting specific wind speed thresholds, but they can only represent the wind field discretely and cannot present continuous changes, and the superposition of multiple isosurfaces will lead to increased rendering burden and visual occlusion problems. These methods have significant shortcomings in terms of three-dimensional expressiveness, information integrity, and real-time interactive performance, and are particularly difficult to achieve efficient and smooth visualization of large-scale wind field data in a web environment. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and medium for three-dimensional visualization rendering of wind fields, which can improve the rendering efficiency and scene integration of three-dimensional visualization rendering of wind fields.
[0005] In a first aspect, embodiments of the present invention provide a three-dimensional visualization rendering method for wind fields, including:
[0006] Based on the pre-collected wind field data and the preset three-dimensional grid, a one-dimensional texture array is generated; wherein, the one-dimensional texture array includes several grid points, and each grid point includes a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component includes a longitude wind speed component, a latitude wind speed component, and an altitude wind speed component.
[0007] The system simulates several light rays passing through a preset 3D wind field bounding box. Based on the 1D texture array and a preset 1D transfer function lookup table, it iterates through each light ray and samples each step point along its direction until an opaque object is detected obstructing the corresponding light ray or the corresponding light ray meets a preset light stepping condition. At this point, sampling along the corresponding light ray direction stops, and the color and opacity of the corresponding light ray are output. The 1D transfer function lookup table is constructed based on preset wind speed-color and wind speed-opacity mapping relationships. The opaque objects include pre-defined building models and terrain models within the 3D wind field bounding box.
[0008] Once the color and opacity of each ray are obtained, a 3D visualization rendering of the wind field is achieved based on the corresponding color and opacity of each ray.
[0009] This invention addresses the low loading efficiency of 3D data in traditional methods by converting 3D data into 1D storage, reducing transmission limitations. By simulating light passing through a wind field bounding box, it samples wind speed data point-by-point and maps color and opacity, enabling continuous rendering of the entire wind field space without information gaps, achieving true 3D volumetric rendering. Furthermore, by progressively sampling based on the 1D texture array and a preset 1D transfer function lookup table, it simplifies the transmission and rendering mechanisms, achieving efficient rendering and supporting real-time interaction of high-density mesh points. By detecting occlusion by opaque objects, it ensures physical consistency between the wind field and the terrain or buildings in the scene, avoiding clipping problems in traditional techniques. By stopping sampling based on occlusion or preset conditions, it balances rendering quality and performance, saving computational overhead. Compared to existing technologies, this invention improves the rendering efficiency and scene integration of 3D wind field visualization.
[0010] Furthermore, before generating the one-dimensional texture array, a one-dimensional transfer function lookup table is constructed based on preset wind speed-color mapping and wind speed-opacity mapping relationships.
[0011] Specifically, the construction of a one-dimensional transfer function lookup table based on preset wind speed-color mapping and wind speed-opacity mapping relationships is as follows:
[0012] Based on the three-dimensional wind speed components in each grid point, the modulus of the data in each grid point is calculated to obtain the wind speed intensity of each grid point.
[0013] By using linear interpolation, based on the preset wind speed-color mapping relationship and wind speed-opacity mapping relationship, the wind speed intensity, the corresponding color, and the corresponding opacity are mapped to a continuous RGBA array to obtain a one-dimensional transfer function lookup table.
[0014] This invention calculates the modulus of wind speed using three-dimensional wind speed components, quantifies the wind speed magnitude, and provides a basis for color and opacity mapping. By constructing a one-dimensional transfer function lookup table, the mapping between wind speed and color and opacity is pre-generated into gradient textures, reducing the computational load of subsequent shader rendering, improving rendering speed, and ensuring real-time rendering of large-scale data.
[0015] Furthermore, the step of generating a one-dimensional texture array based on the pre-collected wind field data and a preset three-dimensional mesh specifically involves:
[0016] The pre-collected wind field data is filled into a preset three-dimensional grid;
[0017] The three-dimensional mesh is traversed, and during the traversal, the three-dimensional wind speed components and wind speed intensity corresponding to each traversed mesh point are sequentially placed into a preset one-dimensional array to obtain a one-dimensional texture array.
[0018] The embodiments of the present invention ensure data texture format compatibility by traversing a three-dimensional mesh and storing it in a flattened form, supports direct sampling by the GPU, and improves sampling efficiency.
[0019] Furthermore, the simulation of several light rays passing through a preset three-dimensional wind field enclosure specifically involves:
[0020] For each pixel within the three-dimensional wind field bounding box, a ray is emitted from the viewpoint position and passes through the pixel.
[0021] This invention achieves full-screen volumetric rendering by emitting rays through the wind field bounding box to each pixel, ensuring the spatial integrity of the wind field visualization and realizing full-space coverage rendering of the wind field.
[0022] Furthermore, the step of traversing each ray and sampling each step point along the direction of each ray, based on the one-dimensional texture array and a preset one-dimensional transfer function lookup table, specifically involves:
[0023] Obtain the three-dimensional spatial coordinates of the current step point, and generate the corresponding three-dimensional texture coordinates based on the three-dimensional spatial coordinates;
[0024] By using a preset indexing function, the one-dimensional texture array is sampled according to the three-dimensional texture coordinates to obtain the wind speed intensity corresponding to the current step point;
[0025] Based on the wind speed intensity and the one-dimensional transfer function lookup table, the color and opacity corresponding to the current step point are obtained.
[0026] This invention utilizes three-dimensional coordinate normalization and texture sampling to map spatial coordinates to texture coordinates, quickly obtaining wind speed data from a one-dimensional texture array and avoiding the overhead of data interaction between the CPU and GPU. By combining a transfer function lookup table to obtain visual parameters, color and transparency are obtained directly through texture sampling, thereby reducing rendering computation costs and achieving efficient data sampling and visual mapping.
[0027] Furthermore, while traversing each ray and sampling each step point along the direction of each ray, it also includes detecting whether there are opaque objects blocking the corresponding ray;
[0028] Specifically, detecting whether an opaque object is blocking the corresponding light source involves:
[0029] Obtain the three-dimensional spatial coordinates of the current step point, and project the three-dimensional spatial coordinates onto a preset clipping space to obtain the step depth value of the current step point;
[0030] Obtain the scene depth value of the current step point from the preset depth buffer, and compare the step depth value with the scene depth value;
[0031] If the step depth value is greater than the scene depth value, it is determined that there is an opaque object blocking the corresponding light.
[0032] This invention compares the step depth value with the scene depth value to detect occlusion in real time during light stepping, thus avoiding the rendering clipping problem in traditional techniques.
[0033] Furthermore, the output corresponds to the color and opacity of the light, specifically as follows:
[0034] Along the corresponding ray direction, for the first step point, the accumulated color and opacity of the current step point are the color and opacity of the current step point;
[0035] Starting from the second step point, the color accumulated at the current step point is obtained by multiplying the color, opacity, and remaining opacity of the current step point, and then adding the color accumulated at the previous step point. The opacity accumulated at the current step point is obtained by multiplying the opacity of the current step point and the remaining opacity, and then adding the opacity accumulated at the previous step point. This process is repeated iteratively along the corresponding ray direction to calculate the color and opacity accumulated at each step point until the calculation of the step point where the corresponding ray stops sampling is completed.
[0036] The accumulated color and opacity calculated at the step point where sampling stops are determined as the color and opacity of the corresponding light rays, respectively.
[0037] This invention employs a front-to-back compositing algorithm to accumulate color and opacity, ensuring visual coherence in volumetric rendering, accurately representing the volumetric stacking effect of wind fields, and improving the visual expressiveness of the rendering.
[0038] Secondly, embodiments of the present invention provide a three-dimensional visualization rendering device for wind fields, including a one-dimensional storage module, a texture sampling module, and a visualization rendering module, wherein...
[0039] The one-dimensional storage module is used to generate a one-dimensional texture array based on the pre-collected wind field data and the preset three-dimensional grid; wherein, the one-dimensional texture array includes several grid points, and each grid point includes a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component includes a longitude wind speed component, a latitude wind speed component and an altitude wind speed component.
[0040] The texture sampling module is used to simulate several light rays passing through a preset three-dimensional wind field bounding box, and to traverse each light ray and sample each step point along the direction of each light ray according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table, until an opaque object is detected that blocks the corresponding light ray or the corresponding light ray meets a preset light stepping condition, at which point sampling in the direction of the corresponding light ray stops, and the color and opacity of the corresponding light ray are output; wherein, the one-dimensional transfer function lookup table is constructed according to a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship; the opaque object includes a pre-set building model and terrain model in the three-dimensional wind field bounding box;
[0041] The visualization rendering module is used to achieve three-dimensional visualization rendering of the wind field based on the color and opacity of each ray when the color and opacity of each ray are obtained.
[0042] This invention employs a one-dimensional storage module to structure wind field data and transform it into a one-dimensional texture array, reducing transmission limitations and solving the problem of low 3D data loading efficiency in traditional methods. A texture sampling module simulates light passing through the wind field bounding box, sampling wind speed data point-by-point and mapping color and opacity, enabling continuous rendering of the entire wind field space without information gaps, achieving true 3D volumetric rendering. Furthermore, based on the one-dimensional texture array and a preset one-dimensional transfer function lookup table, progressive sampling simplifies the transmission and rendering mechanisms, achieving efficient rendering and supporting real-time interaction of high-density grid points. Finally, a depth buffer is used to detect opaque object occlusion, ensuring physical consistency between the wind field and the terrain or buildings in the scene, avoiding clipping problems in traditional techniques. A visualization rendering module, based on the color and opacity corresponding to each ray, achieves 3D visualization rendering of the wind field, providing a more intuitive and comprehensive display of wind speed compared to line drawing in traditional techniques.
[0043] Thirdly, embodiments of the present invention provide a terminal device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0044] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the wind field 3D visualization rendering method as described above.
[0045] Fourthly, embodiments of the present invention provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device or apparatus where the computer-readable storage medium is located to perform the wind field three-dimensional visualization rendering method as described in any of the above.
[0046] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of a three-dimensional visualization rendering method for wind fields provided in an embodiment of the present invention;
[0048] Figure 2 This invention provides a visual mapping strategy based on wind force level;
[0049] Figure 3 This is a structural diagram of a three-dimensional visualization rendering device for wind fields provided in an embodiment of the present invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] Example 1:
[0052] like Figure 1 As shown, a three-dimensional visualization rendering method for wind fields provided by an embodiment of the present invention includes the following steps:
[0053] S101, Based on the pre-collected wind field data and the preset three-dimensional grid, a one-dimensional texture array is generated; wherein, the one-dimensional texture array includes several grid points, and each grid point includes a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component includes a longitude wind speed component, a latitude wind speed component and an altitude wind speed component.
[0054] Preferably, the present invention is primarily applicable to WebGL.
[0055] In one specific embodiment, the required metadata mainly includes latitude and longitude range (Region), number of longitude segments (N) Lon ), number of latitude segments (N) lat ), number of altitude segments (N) Altitude ), maximum wind speed (Vmax).
[0056] In one specific embodiment, the wind field data collected by the wind radar is filled into a three-dimensional grid (with dimensions of width × height × depth), where width is the number of longitude segments, height is the number of latitude segments, depth is the number of altitude segments, and missing data points are filled with 0.
[0057] In one specific embodiment, data normalization and encoding are performed for WebGL: the data of each grid point in the wind field contains three components, U, V, and W, representing the wind speed in the longitude, latitude, and altitude directions, respectively. To be suitable for texture transfer and rendering in WebGL, the floating-point wind speed data must be normalized to an 8-bit unsigned integer (0-255) for compressed encoding.
[0058] In one specific embodiment, the velocity direction vector components (U, V, W) are normalized, specifically:
[0059] First, calculate the wind speed at each point:
[0060]
[0061] Then, divide each directional component by the magnitude to obtain the unit direction vector:
[0062]
[0063] Among them, u n v n w n These represent the components of a unit wind direction in the three directions of longitude, latitude, and altitude.
[0064] Then map it to the range [0, 255]:
[0065]
[0066] Note: The unit vector components range from [-1, 1] and are normalized to 8 bits through linear mapping.
[0067] In one specific embodiment, the wind speed intensity is compared with a preset maximum wind speed V. max Normalize:
[0068]
[0069] Furthermore, RGBA encoding is performed. Specifically, the normalized wind field data is encoded into a four-channel RGBA format, with each channel being an 8-bit unsigned integer (0-255). The meanings of each channel are as follows: R represents the longitude wind speed component u8, G represents the latitude wind speed component v8, B represents the altitude wind speed component w8, and A represents the wind speed modulus intensity m8.
[0070] It should be noted that the three RGB channels together represent the wind speed direction (unit vector), which is achieved by normalizing each directional component and linearly mapping it to [0,255]. The A channel represents the normalized value of the wind speed magnitude, and after mapping to [0,255], it reflects the wind strength.
[0071] In this embodiment, generating a one-dimensional texture array based on pre-collected wind field data and a preset three-dimensional grid specifically involves: filling the pre-collected wind field data into the preset three-dimensional grid; traversing the three-dimensional grid, and sequentially placing the three-dimensional wind speed components and wind speed intensity corresponding to each traversed grid point into the preset one-dimensional array during the traversal process, thereby obtaining a one-dimensional texture array.
[0072] In one specific embodiment, for each 3D grid point, an RGBA-encoded wind direction and speed value is stored. Data in the WebGL texture is stored using a 3D flattened architecture, with the order being: x column (longitude) first, y row (latitude) second, and z layer (height) last. That is, the index increment order in the one-dimensional array is: const index = x + y * width + z * width * height
[0073] This encoding method can directly pass the sampler3D texture in the WebGL shader to achieve fast wind speed decoding and visualization calculation.
[0074] Optionally, to further improve the transmission efficiency of large-scale wind field data, this invention can use the Zstandard (Zstd) lossless compression algorithm to compress the texture data after RGBA encoding. This is suitable for scenarios where client bandwidth is limited, data needs to be dynamically transmitted from the server, and scenarios involving multiple time frames or dynamic layer switching.
[0075] The specific process of Zstandard compression is as follows:
[0076] First, the encoded data above is used to generate a .zst file or a compressed byte stream using the Zstd compression library (such as the zstd CLI tool or the WebAssembly wrapper library).
[0077] Furthermore, after the client loads, it uses the corresponding Zstd decompression library to decompress the data and restore it to the original texture number. Then, the decompressed data is uploaded to the GPU as a 3D texture.
[0078] It should be noted that Zstd compression is a lossless process that does not affect the RGBA data content or rendering accuracy; it is only used to optimize file size and transmission speed.
[0079] It should be noted that Zstandard compression, as an optional optimization scheme of this invention, significantly reduces the volume and transmission overhead of wind field data without affecting the accuracy of RGBA data. This method is suitable for scenarios with limited bandwidth and frequent dynamic loading, and has advantages such as high compression ratio, fast decompression speed, and easy integration. It can be flexibly enabled as needed to improve the overall system performance and adaptability.
[0080] In this embodiment, before generating the one-dimensional texture array, a one-dimensional transfer function lookup table is constructed based on a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship. Specifically, constructing the one-dimensional transfer function lookup table based on the preset wind speed-color mapping relationship and the wind speed-opacity mapping relationship involves: calculating the modulus of the data at each grid point based on the three-dimensional wind speed component at each grid point to obtain the wind speed intensity at each grid point; and mapping the wind speed intensity, the corresponding color, and the corresponding opacity to a continuous RGBA array through linear interpolation based on the preset wind speed-color mapping relationship and the wind speed-opacity mapping relationship to obtain the one-dimensional transfer function lookup table.
[0081] like Figure 2 As shown, Figure 2 The present invention provides a visual mapping strategy based on wind force level, which assigns corresponding colors and opacities to wind speed ranges of different intensities.
[0082] In one specific embodiment, before performing color and opacity mapping, the wind speed intensity M needs to be normalized to fall within the interval [0,1] to adapt to one-dimensional transfer function lookup table (LUT) sampling. The normalization method is as follows:
[0083]
[0084] in, V represents the wind speed modulus at the current grid point; max It is the preset maximum wind speed, used for unified normalization scale.
[0085] In one specific embodiment, in order to efficiently implement color lookup in the shader, the system preprocesses the above mapping into a one-dimensional gradient texture (1D Lookup Table). The principle is to map the normalized wind speed (0.0–1.0) to a continuous RGBA array and generate it through linear interpolation. Therefore, there is no need to judge the branch at runtime. The shader can directly obtain the color and transparency quickly through texture sampling, which greatly improves the performance of volumetric rendering (Ray Marching).
[0086] Furthermore, the normalized M norm The value will be used as the sampling coordinates (LUT texture coordinates) of the lookup table:
[0087] color = texture1D(LUT, M norm )
[0088] Overall, this transfer function design balances visual expressiveness and rendering efficiency, making it suitable for complex visualization needs such as dynamic layers and multi-frame wind fields.
[0089] S102, simulate several light rays passing through a preset three-dimensional wind field bounding box, and according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table, traverse each light ray and sample each step point along the direction of each light ray until an opaque object is detected that blocks the corresponding light ray or the corresponding light ray meets the preset light stepping condition, then stop sampling in the direction of the corresponding light ray, and output the color and opacity of the corresponding light ray; wherein, the one-dimensional transfer function lookup table is constructed according to the preset wind speed-color mapping relationship and wind speed-opacity mapping relationship; the opaque object includes the pre-set building model and terrain model in the three-dimensional wind field bounding box;
[0090] In this embodiment, simulating several rays of light passing through a preset three-dimensional wind field bounding box specifically means that for each pixel within the three-dimensional wind field bounding box, a ray is emitted from the viewpoint position and passes through the pixel.
[0091] In one specific embodiment, for each fragment (pixel) of the rendering target (typically a screen-aligned quadrilateral), a virtual ray is emitted from the viewpoint (camera position), passes through the fragment, and is directed toward the bounding box that encloses the 3D texture of the wind field.
[0092] In this embodiment, the step of traversing each ray and sampling each step point along the direction of each ray according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table specifically involves: obtaining the three-dimensional spatial coordinates of the current step point, and generating corresponding three-dimensional texture coordinates based on the three-dimensional spatial coordinates; sampling the one-dimensional texture array according to the three-dimensional texture coordinates using a preset index function to obtain the wind speed intensity corresponding to the current step point; and obtaining the color and opacity corresponding to the current step point based on the wind speed intensity and the one-dimensional transfer function lookup table.
[0093] In one specific embodiment, the light ray starts from the entry point into the bounding box and moves forward along its direction at fixed sampling intervals (Step Size). At each step point: the normalized coordinates of the current step point in the 3D texture are obtained; using these coordinates, the sampler3D wind field texture constructed in S101 is sampled to obtain the RGBA encoded value of that point; in the shader, the sampled RGBA value is decoded back into the wind speed direction vector (U,V,W) and wind speed modulus M; using the decoded wind speed modulus M (after normalization), texture sampling is performed in the one-dimensional transfer function lookup table (LUT) constructed in S101 to obtain the color and opacity (Alpha) of that point.
[0094] In this embodiment, while traversing each ray and sampling each step point along the direction of each ray, the method also includes detecting whether an opaque object is obstructing the corresponding ray. Specifically, detecting whether an opaque object is obstructing the corresponding ray involves: obtaining the three-dimensional spatial coordinates of the current step point and projecting the three-dimensional spatial coordinates onto a preset clipping space to obtain the step depth value of the current step point; obtaining the scene depth value of the current step point from a preset depth buffer and comparing the step depth value with the scene depth value; if the step depth value is greater than the scene depth value, it is determined that an opaque object is obstructing the corresponding ray.
[0095] In one specific embodiment, to ensure that the wind field volume rendered by this invention can be correctly blended with other existing 3D objects in the scene (such as the Earth, terrain, and building models) and to avoid errors such as visual penetration or floating, this invention employs an occlusion blending technique based on a depth buffer. The specific implementation scheme is as follows: First, before rendering the wind field volume, all opaque objects (Opaque Geometry) in the scene are rendered normally. This rendering writes their depth information into the GPU's depth buffer.
[0096] Furthermore, the depth buffer content generated in the previous step is passed as a depth texture to the fragment shader used for wind field volume rendering;
[0097] Furthermore, when executing the ray stepping algorithm, a depth determination is performed for each ray at each step.
[0098] In one specific embodiment, depth determination is performed for each step of each ray, specifically by calculating the position of the current sampling point in the world coordinate system and projecting it onto the clipping space to obtain the depth value Z of that point. ray ; Get the scene depth value Z stored in the depth texture for the current fragment (pixel). scene If Z ray >Z scene This means that the sampling point on the current light source is located behind an opaque object, i.e., it is blocked by that object.
[0099] It should be noted that once occlusion is detected, Z... ray >Z scene The current ray's stepping process is immediately terminated, and the fragment's color is set to the currently accumulated color (usually fully transparent or the accumulated color of the previous step). If the ray's entry point is already behind an opaque object when it enters the bounding box, the fragment is discarded. This method ensures that wind volume is correctly occluded by opaque geometry in the scene; for example, wind will circle around mountains instead of directly "passing through" them. This achieves a seamless and accurate fusion of volumetric rendering results with the 3D scene, greatly enhancing the realism and credibility of the visualization.
[0100] In this embodiment, the output of the color and opacity of the corresponding light ray is specifically as follows: along the direction of the corresponding light ray, for the first step point, the color and opacity accumulated at the current step point are the color and opacity of the current step point; starting from the second step point, the color accumulated at the current step point is obtained by multiplying the color, opacity, and remaining opacity of the current step point by the color accumulated at the previous step point, and the opacity accumulated at the current step point is obtained by multiplying the opacity of the current step point by the remaining opacity by the opacity of the current step point by the opacity accumulated at the previous step point. This process is repeated iteratively along the direction of the corresponding light ray to calculate the color and opacity accumulated at each step point until the calculation of the step point where the corresponding light ray stops sampling is completed; the accumulated color and opacity calculated at the step point where sampling stops are determined as the color and opacity of the corresponding light ray, respectively.
[0101] In one specific embodiment, the color and opacity sampled at each step are accumulated along the light stepping direction. Specifically, the present invention adopts a front-to-back compositing method, and its accumulation formula is as follows:
[0102] C new =C old +(1-α old )·α sample ·C sample
[0103] α new =α old +(1-α old )·α sample
[0104] Among them, C old and α old It is the accumulated color and opacity of the preceding steps, C sample and α sample It represents the color and opacity obtained at the current sampling point.
[0105] In one specific embodiment, the light stepping terminates when any of the following conditions are met:
[0106] (1) The light completely passes through the wind field data enclosure.
[0107] (2) Cumulative opacity (α) new When the value reaches or exceeds a threshold (such as 0.99), it indicates that the light has been almost completely absorbed, and subsequent sampling points contribute very little to the final pixel color.
[0108] (3) The number of steps reaches the preset maximum number of steps (Max Steps) to ensure rendering performance and prevent infinite loops.
[0109] By adjusting the sampling interval and maximum number of steps, a trade-off can be struck between rendering quality and performance to suit the needs of different hardware and application scenarios.
[0110] S103: When the color and opacity of each ray are obtained, the three-dimensional visualization rendering of the wind field is achieved based on the corresponding color and opacity of each ray.
[0111] In one specific embodiment, a 3D visualization rendering of the wind field is achieved based on the color and opacity corresponding to each ray. Specifically, this involves drawing a geometric patch covering the entire screen, writing a fragment shader for the geometry, and in the shader's main function, where each pixel represents a ray. The calculations are performed using the steps described above, and the calculated ray color is then passed through the function gl_fragColor = vec4(C new ,α new Output.
[0112] This invention addresses the low loading efficiency of 3D data in traditional methods by converting 3D data into 1D storage, reducing transmission limitations. By simulating light passing through a wind field bounding box, it samples wind speed data point-by-point and maps color and opacity, enabling continuous rendering of the entire wind field space without information gaps, achieving true 3D volumetric rendering. Furthermore, by progressively sampling based on the 1D texture array and a preset 1D transfer function lookup table, it simplifies the transmission and rendering mechanisms, achieving efficient rendering and supporting real-time interaction of high-density mesh points. By detecting occlusion by opaque objects, it ensures physical consistency between the wind field and the terrain or buildings in the scene, avoiding clipping problems in traditional techniques. By stopping sampling based on occlusion or preset conditions, it balances rendering quality and performance, saving computational overhead. Compared to existing technologies, this invention improves the rendering efficiency and scene integration of 3D wind field visualization.
[0113] Example 2:
[0114] like Figure 3 As shown, this embodiment provides an Nk fault early warning device based on spatiotemporal analysis, including a one-dimensional storage module 201, a texture sampling module 202, and a visualization rendering module 203, wherein...
[0115] The one-dimensional storage module 201 is used to generate a one-dimensional texture array based on the pre-collected wind field data and the preset three-dimensional grid; wherein, the one-dimensional texture array includes a number of grid points, and each grid point includes a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component includes a longitude wind speed component, a latitude wind speed component and an altitude wind speed component.
[0116] In this embodiment, the one-dimensional storage module 201 generates a one-dimensional texture array based on the pre-collected wind field data and the preset three-dimensional mesh. Specifically, the one-dimensional storage module 201 fills the pre-collected wind field data into the preset three-dimensional mesh; it traverses the three-dimensional mesh, and during the traversal, it sequentially puts the three-dimensional wind speed components and wind speed intensity corresponding to each traversed mesh point into the preset one-dimensional array to obtain the one-dimensional texture array.
[0117] The texture sampling module 202 is used to simulate several light rays passing through a preset three-dimensional wind field bounding box, and according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table, traverse each light ray and sample each step point along the direction of each light ray until an opaque object is detected that obstructs the corresponding light ray or the corresponding light ray meets a preset light stepping condition, at which point sampling in the direction of the corresponding light ray stops, and the color and opacity of the corresponding light ray are output; wherein, the one-dimensional transfer function lookup table is constructed according to a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship; the opaque object includes a pre-set building model and terrain model in the three-dimensional wind field bounding box;
[0118] In this embodiment, the texture sampling module 202 simulates several rays of light passing through a preset three-dimensional wind field bounding box. Specifically, for each pixel within the three-dimensional wind field bounding box, a ray is emitted from the viewpoint position and passes through the pixel.
[0119] In this embodiment, the texture sampling module 202, based on the one-dimensional texture array and a preset one-dimensional transfer function lookup table, traverses each ray and samples each step point along the direction of each ray. Specifically, the texture sampling module 202 obtains the three-dimensional spatial coordinates of the current step point and generates corresponding three-dimensional texture coordinates based on the three-dimensional spatial coordinates; it samples the one-dimensional texture array using a preset index function based on the three-dimensional texture coordinates to obtain the wind speed intensity corresponding to the current step point; and it obtains the color and opacity corresponding to the current step point based on the wind speed intensity and the one-dimensional transfer function lookup table.
[0120] In this embodiment, the texture sampling module 202 outputs the color and opacity of the corresponding light. Specifically, along the direction of the corresponding light, for the first step point, the color and opacity accumulated at the current step point are the color and opacity of the current step point. Starting from the second step point, the color accumulated at the current step point is obtained by multiplying the color, opacity, and remaining opacity of the current step point by the color accumulated at the previous step point. The opacity accumulated at the current step point is obtained by multiplying the opacity of the current step point by the remaining opacity by the opacity of the current step point by the opacity accumulated at the previous step point. The color and opacity accumulated at each step point are iteratively calculated along the direction of the corresponding light until the step point where the corresponding light stops sampling is calculated. The accumulated color and opacity calculated at the step point where sampling stops are determined as the color and opacity of the corresponding light.
[0121] The visualization rendering module 203 is used to achieve three-dimensional visualization rendering of the wind field based on the color and opacity of each ray when the color and opacity of each ray are obtained.
[0122] For a more detailed explanation of the working principle and procedures of this embodiment, please refer to the relevant description in Embodiment 1.
[0123] This invention employs a one-dimensional storage module 201 to structure and transform wind field data into a one-dimensional texture array, reducing transmission limitations and solving the problem of low 3D data loading efficiency in traditional methods. A texture sampling module 202 simulates light passing through the wind field bounding box, sampling wind speed data point-by-point and mapping color and opacity, enabling continuous rendering of the entire wind field space without information gaps, achieving true 3D volumetric rendering. Furthermore, based on the one-dimensional texture array and a preset one-dimensional transfer function lookup table, progressive sampling simplifies the transmission and rendering mechanisms, achieving efficient rendering and supporting real-time interaction of high-density grid points. Finally, a depth buffer is used to detect opaque object occlusion, ensuring physical consistency between the wind field and the terrain or buildings in the scene, avoiding clipping problems in traditional techniques. A visualization rendering module 203 achieves 3D visualization rendering of the wind field based on the color and opacity corresponding to each ray, providing a more intuitive and comprehensive display of wind speed compared to line drawing in traditional techniques.
[0124] Example 3:
[0125] This embodiment provides a terminal device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0126] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the wind field 3D visualization rendering method as described above.
[0127] Example 4:
[0128] This invention provides a computer-readable storage medium including a stored computer program, wherein the computer program, when running, controls the device or apparatus containing the computer-readable storage medium to execute the wind field three-dimensional visualization rendering method as described above.
[0129] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0130] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for three-dimensional visualization and rendering of wind fields, characterized in that, The method comprises the following steps: According to the pre-acquired wind field data and the preset three-dimensional grid, a one-dimensional texture array is generated; wherein the one-dimensional texture array comprises a plurality of grid points, and each grid point comprises a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component comprises a longitude wind speed component, a latitude wind speed component and a height wind speed component; A plurality of light rays are simulated to pass through the preset three-dimensional wind field bounding box, and according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table, each light ray is traversed and each step point is sampled along the direction of each light ray until it is detected that there is an opaque object to cause occlusion to the corresponding light ray or the corresponding light ray meets a preset light ray step condition, the sampling in the direction of the corresponding light ray is stopped, and the color and opacity of the corresponding light ray are output; wherein the one-dimensional transfer function lookup table is constructed according to a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship; the opaque object comprises a building model and a terrain model preset in the three-dimensional wind field bounding box; When the color and opacity of each light ray are obtained, according to the corresponding color and opacity on each light ray, the three-dimensional visualization rendering of the wind field is realized.
2. The method of claim 1, wherein, Before generating the one-dimensional texture array, the method further comprises constructing a one-dimensional transfer function lookup table according to a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship; According to the three-dimensional wind speed component in each grid point, the modulus length of the data in each grid point is calculated to obtain the wind speed intensity of each grid point; According to the preset wind speed-color mapping relationship and the wind speed-opacity mapping relationship, the wind speed intensity, the corresponding color and the corresponding opacity are mapped into a continuous RGBA array by linear interpolation to obtain the one-dimensional transfer function lookup table. According to the pre-acquired wind field data and the preset three-dimensional grid, the one-dimensional texture array is generated in the following way:
3. The method of claim 1, wherein, The pre-acquired wind field data is filled into the preset three-dimensional grid; The three-dimensional grid is traversed, and the three-dimensional wind speed component and the wind speed intensity of each grid point traversed are sequentially put into a preset one-dimensional array during the traversal process to obtain the one-dimensional texture array. The plurality of light rays are simulated to pass through the preset three-dimensional wind field bounding box in the following way:
4. The method of claim 1, wherein, For each pixel in the three-dimensional wind field bounding box, a ray is emitted from a viewpoint position to pass through the pixel. According to the one-dimensional texture array and the preset one-dimensional transfer function lookup table, each light ray is traversed and each step point is sampled along the direction of each light ray in the following way:
5. The method of claim 1, wherein, The three-dimensional space coordinates of the current step point are obtained, and the corresponding three-dimensional texture coordinates are generated according to the three-dimensional space coordinates; According to the three-dimensional texture coordinates, the one-dimensional texture array is sampled by a preset index function to obtain the wind speed intensity corresponding to the current step point; According to the wind speed intensity and the one-dimensional transfer function lookup table, the color and opacity corresponding to the current step point are obtained. 6. The method of claim 1, wherein, The method further comprises detecting whether an opaque object exists to block the corresponding light ray while traversing each light ray and sampling each step point in the direction of each light ray; The detection of whether the opaque object exists to block the corresponding light ray comprises: obtaining a three-dimensional space coordinate of the current step point, and projecting the three-dimensional space coordinate to a preset clipping space to obtain a step depth value of the current step point; obtaining a scene depth value of the current step point from a preset depth buffer, and comparing the step depth value with the scene depth value; if the step depth value is greater than the scene depth value, it is determined that the opaque object exists to block the corresponding light ray.
7. The method of claim 5, wherein, The output of the color and opacity of the corresponding light ray comprises: for the first step point in the direction of the corresponding light ray, the color and opacity accumulated by the current step point are the color and opacity of the current step point; starting from the second step point, the color accumulated by the current step point is obtained by multiplying the color and opacity of the current step point by the remaining transparency, superimposed on the color accumulated by the previous step point, and the opacity accumulated by the current step point is obtained by multiplying the opacity of the current step point by the remaining transparency, superimposed on the opacity accumulated by the previous step point, and the color and opacity accumulated by each step point are iteratively calculated in the direction of the corresponding light ray until the calculation of the step point stopping sampling is completed; the accumulated color and opacity calculated at the step point stopping sampling are respectively determined as the color and opacity of the corresponding light ray.
8. A device for three-dimensional visualization rendering of a wind farm, characterized in that, The system comprises a one-dimensional storage module, a texture sampling module and a visual rendering module, wherein the one-dimensional storage module is configured to generate a one-dimensional texture array according to pre-acquired wind field data and a preset three-dimensional grid; the one-dimensional texture array comprises a plurality of grid points, and each grid point comprises a three-dimensional wind speed component and a wind speed intensity; the three-dimensional wind speed component comprises a longitude wind speed component, a latitude wind speed component and an altitude wind speed component; the texture sampling module is configured to simulate a plurality of light rays passing through a preset three-dimensional wind field bounding box, and to traverse each light ray and sample each step point in the direction of each light ray according to the one-dimensional texture array and a preset one-dimensional transfer function lookup table until an opaque object is detected to block the corresponding light ray or the corresponding light ray satisfies a preset light ray step condition, the sampling in the direction of the corresponding light ray is stopped, and the color and opacity of the corresponding light ray are output; the one-dimensional transfer function lookup table is constructed according to a preset wind speed-color mapping relationship and a wind speed-opacity mapping relationship; the opaque object comprises a building model and a terrain model pre-set in the three-dimensional wind field bounding box; the visual rendering module is configured to, when the color and opacity of each light ray are obtained, realize three-dimensional visual rendering of the wind field according to the corresponding color and opacity of each light ray.
9. A terminal device, comprising: The system comprises: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus; The memory is configured to store at least one executable instruction, and the executable instruction is configured to enable the processor to perform the operation of the wind farm three-dimensional visualization rendering method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, and the computer program is configured to control the device or apparatus where the computer readable storage medium is located to perform the operation of the wind farm three-dimensional visualization rendering method according to any one of claims 1 to 7 when the computer program is running.