A ray-casting volume rendering method for interface grid models

By using the ray projection volume drawing method of the InterfaceGrid mesh model, the problems of accuracy and efficiency in expressing complex geological structures by 3D geological models are solved, and efficient and accurate visualization of 3D geological models is achieved. In particular, it significantly improves computational efficiency and visualization effect when processing large-scale data.

CN120495497BActive Publication Date: 2025-11-18CHINA UNIV OF MINING & TECH (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510553967.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-11-18
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Existing 3D geological models suffer from insufficient accuracy and low efficiency when representing complex geological structures, especially in terms of their limited ability to represent irregular shapes and complex faults. Furthermore, existing models have high computational complexity when processing large-scale data, making it difficult to achieve efficient visualization.

Method used

The method of ray casting volume rendering using the InterfaceGrid mesh model maps geological interface information to the InterfaceGrid mesh system. It uses texture objects to record the elevation, spatial structure and attribute information of the geological model, and uses ray casting algorithm to quickly locate spatial position. It combines GPU acceleration and multi-resolution meshing algorithm for volume rendering, and uses binary search algorithm to improve query efficiency.

Benefits of technology

It significantly improves the visualization speed and accuracy of large-scale 3D geological models, maintains low computational complexity, and enhances the efficiency and accuracy of geological feature presentation, especially showing significant advantages when rapidly visualizing large-scale models of different regions and scales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495497B_ABST
    Figure CN120495497B_ABST
Patent Text Reader

Abstract

The application provides a ray casting volume rendering method for an InterfaceGrid grid model, relates to the field of ray casting volume rendering, and comprises the following steps: converting the InterfaceGrid grid model from display storage into an implicit storage structure of an InterfaceGridBlock, transmitting the InterfaceGrid grid model to a GPU, and performing partial storage; using a vertex shader to perform coordinate transformation on vertex coordinates of a texture according to an implicit storage texture set, so as to obtain transformed vertex coordinates; transmitting the transformed vertex coordinates to a fragment shader, combining the implicit storage texture set, and obtaining implicit storage information corresponding to a current fragment by using a texture sampling technology; performing volume rendering of the InterfaceGrid grid model according to the implicit storage information corresponding to the current fragment, and finding out attributes of the InterfaceGrid grid model at a current sampling point; updating the color and transparency of the sampling point, synthesizing by using a lighting model, and obtaining accumulated volume rendering color; and outputting to a screen, so as to complete volume visualization of the InterfaceGrid model. The application is used to solve the problem of insufficient expression capability of a traditional three-dimensional geological model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ray projection volume drawing technology, and in particular to a method for drawing ray projection volumes for InterfaceGrid mesh models. Background Technology

[0002] The construction of three-dimensional geological data models is mainly based on the geometric shape of geological objects and the topological relationships between these objects. Among them, the irregular triangular network model has defects such as insufficient spatial calculation and analysis capabilities, difficulty in maintaining topological consistency, instability of triangle cutting, difficulty in local data updating and maintenance, and the complexity of organization and management caused by large data volume.

[0003] Regular grids in mesh models have limited ability to represent complex geological structures. The SBRT model suffers from accuracy issues; while using regular grids to represent the hierarchical structure of geological bodies, its accuracy is limited, especially in complex geological structures. It cannot effectively represent irregularly shaped geological interfaces, and its expressive power is limited for complex faults (such as Y-type faults). The triangular prism model divides horizontal space using triangular meshes and constructs triangular prisms vertically by connecting the vertices of triangles. This approach performs poorly with complex geological structures, especially when dealing with variable or irregular geological bodies. While the VPTN model uses triangular meshes horizontally and can record vertical stratification points, it may not effectively capture subtle geological changes in complex geological structures. Furthermore, this model has low flexibility, particularly when facing irregular geological structures, where it may not be able to adapt to complex spatial relationships, resulting in insufficient expressive power. Corner grids, due to the large amount of data recorded at eight corner points, are not conducive to online visualization, especially when rapidly visualizing large-scale models of different regions and scales. Summary of the Invention

[0004] This invention provides a method for drawing ray projection volumes for InterfaceGrid mesh models, in order to solve the problems of insufficient expressive power and low efficiency of traditional three-dimensional geological models.

[0005] On one hand, the present invention provides a method for drawing ray projectors for an InterfaceGrid mesh model, comprising:

[0006] The InterfaceGrid model is converted from explicit storage to implicit storage structure of InterfaceGridBlock to obtain implicit storage data. The implicit storage structure of InterfaceGridBlock includes five arrays.

[0007] Implicit memory data is transferred to the GPU and stored in parts to obtain an implicit memory texture set;

[0008] Based on the implicitly stored texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain the transformed vertex coordinates, which include the texture coordinates, normals, and texture coordinates.

[0009] The transformed vertex coordinates are transmitted to the fragment shader and combined with the implicit storage texture set. The implicit storage information corresponding to the current fragment is obtained through texture sampling techniques.

[0010] Based on the implicit storage information corresponding to the current segment, the InterfaceGrid mesh model body is drawn, and the attributes of the InterfaceGrid mesh model at the current sampling point are retrieved;

[0011] Based on the attributes of the current sampling point, update the color and transparency of the sampling point, and use the lighting model to synthesize the cumulative volume rendering color;

[0012] The colors are drawn based on the accumulated volume, and the results are output to the screen to complete the volume visualization of the InterfaceGrid model.

[0013] Furthermore, the implicit memory data is transferred to the GPU and stored in portions to obtain an implicit memory texture set, including:

[0014] Extract the first array of implicitly stored data, and store the cylinder cell data of the first array into the RG channel of the first texture of the GPU in row-major order to obtain the filled first texture;

[0015] Based on the implicit storage data, extract the vertex height values ​​of the second array and store them in the RGBA channels of the GPU's second texture to obtain the filled second texture;

[0016] Based on the implicit storage data, the inorder sequence information of the third array is extracted and stored in the RG channel of the GPU's third texture to obtain the filled third texture.

[0017] Based on the implicit storage data, extract the upper and lower attributes of the fifth array and store them in the RG channel of the fourth texture of the GPU to obtain the filled fourth texture.

[0018] The four filled textures are bound to the GPU rendering pipeline to form an implicitly stored texture set.

[0019] Furthermore, based on the implicitly stored texture set, a vertex shader is used to transform the vertex coordinates of the texture to obtain the transformed vertex coordinates. These vertex coordinates include the texture coordinates, normals, and texture coordinates, including:

[0020] Extract vertex data of the texture from the implicitly stored texture set;

[0021] Based on the vertex data, the vertex shader transforms the vertex coordinates from model space to clip space to obtain the transformed vertex coordinates.

[0022] Furthermore, the transformed vertex coordinates are transmitted to the fragment shader, and combined with the implicit storage texture set, the implicit storage information corresponding to the current fragment is obtained through texture sampling techniques, including:

[0023] The transformed vertex coordinates are used to calculate the 3D texture coordinates for texture sampling using the fragment shader, thus obtaining the 3D texture coordinates;

[0024] Based on the 3D texture coordinates, the fragment shader is used to obtain the implicit storage information corresponding to the current fragment in the implicit storage texture set, so as to obtain the sampling result;

[0025] Based on the sampling results, the implicit storage information required for the current segment is extracted.

[0026] Furthermore, based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model is drawn, and the attributes of the InterfaceGrid mesh model at the current sampling point are retrieved, including:

[0027] Based on the implicit storage information corresponding to the current fragment, the camera viewpoint is transformed to the model coordinate system using the inverse matrix, and the ray direction from the viewpoint to the texture vertex is calculated;

[0028] Based on the direction of the ray, the sampling point is moved step by step in the loop to sample along the ray path in order to obtain the sampling results;

[0029] Calculate the spatial coordinates of the current sampling point based on the sampling results;

[0030] Based on the spatial coordinates of the sampling points, the attribute values ​​are obtained using a tree-based binary sampling function.

[0031] Furthermore, based on the spatial coordinates of the sampling points, a tree-based binary sampling function is used to obtain attribute values, including:

[0032] Based on the spatial coordinates of the sampling points, locate the cylindrical grid and determine the grid index;

[0033] Based on the first texture, obtain the surface information and inorder sequence index of the cylinder;

[0034] Based on the face information and inorder sequence index of the cylinder, calculate the intermediate index, obtain the face index from the third texture, calculate the face value, determine the vertical relationship between the point and the face, and obtain the result of the first binary search.

[0035] Based on the result of the first binary search, reset the calculation of the patch index and state, and perform the binary search again to obtain the result of the second binary search;

[0036] Based on the results of the second binary search, the upper and lower information of the found point on the face is determined, and the corresponding attribute value is obtained from the fifth array.

[0037] Furthermore, based on the attributes of the current sampling point, the color and transparency of the sampling point are updated, and a lighting model is used for compositing to obtain the accumulated volume rendering color, including:

[0038] Obtain ambient light;

[0039] Based on the model's properties at the current sampling point, calculate the dot product of the light source direction and the surface normal to obtain diffuse illumination;

[0040] Based on diffuse lighting, calculate the half-angle vector between the line of sight and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain specular lighting.

[0041] Based on the specular reflection of light, the phenomenon of light intensity decreasing with increasing distance is simulated to obtain the light source attenuation.

[0042] The cumulative volume rendering color is obtained by multiplying diffuse and specular lighting by light attenuation and then adding the effect of ambient lighting.

[0043] Furthermore, based on the accumulated volume, colors are drawn and output to the screen to complete the volume visualization of the InterfaceGrid model, including:

[0044] Draw colors based on the accumulated volume and assign the colors to the output color variable of the fragment shader;

[0045] The color is drawn based on the accumulated volume, and the transparency of the color is processed to obtain the result.

[0046] Based on the processing results and color variables, the rendering pipeline will use the color value for blending, depth testing, and writing to the frame buffer to obtain the fragment shader at the end of the process.

[0047] The fragment shader that has finished executing is output to the screen, completing the volume visualization of the InterfaceGrid model.

[0048] This invention provides a ray-casting volume rendering method for InterfaceGrid mesh models. By mapping geological interface information to the InterfaceGrid mesh system and utilizing texture objects to efficiently record the elevation, spatial structure, and attribute information of the geological model, the invention improves visualization efficiency and accuracy. Through a ray-casting algorithm, it quickly locates spatial positions intersecting with the model and achieves rapid positioning of arbitrary-position pillars. Using a binary search algorithm, attribute queries are completed in O(logn) time complexity, significantly improving query efficiency. Simultaneously, by employing a multi-resolution meshing algorithm and GPU-accelerated volume rendering technology, this invention significantly improves the volume visualization speed of large-scale 3D geological models while maintaining low computational complexity when processing massive amounts of data. Test results demonstrate that the InterfaceGrid visualization algorithm of this invention achieves several times higher computational efficiency than traditional methods in large-scale geological model visualization tasks, while ensuring high-precision geological feature presentation during the visualization process. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating the method for drawing ray projection volumes for an InterfaceGrid mesh model provided in an embodiment of the present invention.

[0051] Figure 2 This is a simplified diagram of the InterfaceGrid model;

[0052] Figure 3 This is a schematic diagram of the spatial relationship between the facets in a unit column;

[0053] Figure 4 This is a schematic diagram of the InterfaceGrid model data structure;

[0054] Figure 5 This is a schematic diagram illustrating the calculation of the relationship between spatial points and spatial surfaces;

[0055] Figure 6 This is a diagram illustrating attribute lookup;

[0056] Figure 7 This is a schematic diagram of the ray casting algorithm.

[0057] Figure 8This is a schematic diagram of the overall process of a GPU volume rendering algorithm based on ray casting;

[0058] Figure 9 This is a schematic diagram of texture management for the InterfaceGrid model;

[0059] Figure 10 It is a schematic diagram of a volumetric texture cube;

[0060] Figure 11 This is a schematic diagram of the ray projection of the InterfaceGrid mesh model;

[0061] Figure 12 This is another schematic diagram of the light projection of the InterfaceGrid mesh model. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0063] Figure 1 This is one of the flowcharts illustrating the method for drawing ray projectors for an InterfaceGrid mesh model provided in this embodiment of the invention.

[0064] like Figures 1 to 12 As shown in the figure, the method for drawing ray projectors for an InterfaceGrid mesh model provided in this embodiment of the invention mainly includes the following steps:

[0065] 11. Convert the InterfaceGrid grid model from explicit storage to implicit storage structure of InterfaceGridBlock to obtain implicit storage data. The implicit storage structure of InterfaceGridBlock includes five arrays.

[0066] 12. Transfer the implicit memory data to the GPU and perform partial storage to obtain the implicit memory texture set;

[0067] 13. Based on the implicitly stored texture set, use the vertex shader to perform coordinate transformation on the vertex coordinates of the texture to obtain the transformed vertex coordinates, wherein the vertex coordinates include the texture coordinates, normals, and texture coordinates;

[0068] 14. Transmit the transformed vertex coordinates to the fragment shader, and combine them with the implicit storage texture set to obtain the implicit storage information corresponding to the current fragment through texture sampling techniques;

[0069] 15. Based on the implicit storage information corresponding to the current segment, draw the InterfaceGrid mesh model and find the attributes of the InterfaceGrid mesh model at the current sampling point;

[0070] 16. Based on the attributes of the current sampling point, update the color and transparency of the sampling point, and use the lighting model to synthesize the cumulative volume rendering color;

[0071] 17. Draw colors based on the accumulated volume and output them to the screen to complete the volume visualization of the InterfaceGrid model.

[0072] In this embodiment of the invention, the elevation information, attribute information, and spatial relationship information of the geological model are organized into a grid system through an array mapping strategy. By sampling attributes at any position in each unit column and accelerating the process using the parallel capabilities of a general-purpose graphics processing unit (GPGPU), the volume visualization of the InterfaceGrid model is completed using a ray casting algorithm, which significantly improves the volume visualization efficiency of the geological model. Given the highly parallel nature of the ray attribute sampling task in each column, this invention adopts an efficient strategy: decomposing the attribute query task in each column into multiple subtasks that can be processed independently in parallel, and accelerating the process using the parallel computing capabilities of a general-purpose graphics processing unit (GPGPU). As an advanced computing platform, GPGPU's powerful parallel processing units (stream processors) can process large amounts of data simultaneously, demonstrating significant computational advantages when handling large-scale two-dimensional survey line datasets. Compared to traditional CPU (Central Processing Unit) computing, GPGPU stands out with its powerful parallel computing capabilities and high portability, especially when processing large-scale datasets. Furthermore, although CUDA (Compute Unified Device Architecture) is also a powerful GPU programming model, GPGPU is more suitable for the application scenarios of this invention due to its higher ease of programming and wider hardware compatibility. Therefore, this invention, by combining gridded model information, attribute query technology, and GPGPU parallel capabilities, realizes an efficient volumetric visualization algorithm for InterfaceGrid three-dimensional geological models, significantly improving the model's visualization efficiency and providing strong technical support for research in related fields.

[0073] In this embodiment of the invention, the InterfaceGrid model is an advanced technology for 3D geological modeling, specifically designed to enhance the expressive power of complex geological structures. The core of the model is to use quadrilaterals to approximate layered geological structures. Each vertical column is composed of stacked quadrilaterals that share a common column and are either connected or independent. In this model, each column represents a set of vertically stacked quadrilaterals arranged in a uniform grid on the XY plane and extending towards the top of the 3D geological model along the Z-axis. This is visually represented by the top and bottom quadrilaterals, which mark the upper and lower boundaries of the geological features being modeled. Figure 2 The black vertices highlight the corners of the grid structure, emphasizing the arrangement of the system;

[0074] Suppose P = {Qi,j | i = 1, 2, ..., n; j = 1, 2, ..., mi}, where P represents the entire set of unit columns, each Qi,j represents the j-th quadrilateral in the i-th unit column, and mi is the number of quadrilaterals in that unit column. Therefore, we can also say that the InterfaceGrid model is composed of individual unit columns, and each unit column is composed of multiple quadrilaterals.

[0075] The InterfaceGrid geological model consists of multiple pillars, each uniformly defined as an InterfaceColumn. Assuming the base grid size is 3×3, this example InterfaceGrid model comprises 9 pillars. Each pillar stores a spatially structured binary tree. In this binary tree, the spatial relationship between parent and child nodes is determined by their positions: the left child node is above the parent node, and the right child node is below the parent node. During the construction of the binary tree structure, the first node inserted becomes the root node, and subsequent inserted nodes become children of the root node according to their spatial relationships. Assuming one pillar in the model contains five geological interface segments A, B, C, D, and E, as shown... Figure 3 As shown, the binary tree in the figure reflects the spatial relationships of these segments.

[0076] In this embodiment of the invention, the specific structural design of InterfaceGridBlock is as follows:

[0077] First array: XYGrid array<InterfaceNum,StartPos> Store the number of geological interface segments (InterfaceNum) in the columnar cell and the index in the array of geological interface segments (StartPos: the index of the patch in the Interfaces array) in row-major order;

[0078] Second array: Interfaces array<z1,z2,z3,z4> : Store the elevation information (four z values ​​of the surface patch) of the geological interface segment in each column in the binary tree preorder traversal;

[0079] Third array: InterfacesTreeInfo <infoindex>: Store the index information of geological interface fragments according to the inorder sequence of the binary tree in the column;

[0080] Fourth array: InterfacesFeatureID <featureid>: Store the FeatureID of the global geological interface (fault or stratum) to which each geological interface segment belongs in the binary tree preorder of the column;

[0081] Fifth array: InterfaceUpAndDownProps<up,down> Store the upper and lower attribute values ​​of each geological interface segment in the binary tree preorder traversal of the column;

[0082] Among them, XYGrid<InterfaceNum,StartPos> The array stores the number of geological interface segments in the columnar unit (InterfaceNum) and the index of the geological interface segment array (StartPos: the index of the patch in the Interfaces array) in row-major order; Interfaces<z1,z2,z3,z4> The array stores the elevation information (z1, z2, z3, z4) of the geological interface segments in each column in a binary tree preorder retrieval; InterfacesTreeInfo <infoindex>The array stores the index information of geological interface fragments according to the inorder sequence of the binary tree in the column; InterfacesFeatureID <featureid>The array stores the FeatureID of the global geological interface (fault or stratum) to which each geological interface segment belongs, in a binary tree preorder traversal within the column; InterfaceUpAndDownProps<up,down> The array stores the upper and lower attribute values ​​of each geological interface segment in the binary tree preorder of the column.

[0083] like Figure 1 As shown in Figure 12, implicit memory data is transferred to the GPU and stored in parts to obtain an implicit memory texture set, including:

[0084] 121. Extract the first array of implicit storage data, and store the cylinder cell data of the first array into the RG channel of the first texture of the GPU in row-major order to obtain the filled first texture;

[0085] 122. Based on the implicit storage data, extract the vertex height values ​​of the second array and store them in the RGBA channel of the GPU's second texture to obtain the filled second texture;

[0086] 123. Based on the implicit storage data, extract the inorder sequence information of the third array and store it in the RG channel of the GPU's third texture to obtain the filled third texture.

[0087] 124. Based on the implicit storage data, extract the upper and lower attributes of the fifth array and store them in the RG channel of the fourth texture of the GPU to obtain the filled fourth texture.

[0088] 125. Bind the four filled textures to the GPU rendering pipeline to form an implicitly stored texture set.

[0089] In this embodiment of the invention, the vertex shader and fragment shader in GPU programming use GLSL (OpenGL Shading Language). This language does not support traditional complex data structures such as binary trees and vectors. Therefore, in order to enable the InterfaceGrid model data to be efficiently transferred to the GPU for processing, we need to convert the original display storage method, which relies on a binary tree structure, into an implicit storage method based on multiple one-dimensional arrays. This conversion allows the model data to be organized into a linear structure for efficient processing by the vertex shader and fragment shader. As mentioned above, InterfaceGridBlock uses one-dimensional arrays such as XYGrid, Interfaces, InterfacesTreeInfo, and InterfaceUpAndDownProps to meet GPU programming requirements. Therefore, we use two-dimensional textures to transmit model data, transferring the implicit storage method of InterfaceGridBlock data to the GPU for volume rendering. In the texture management strategy, we use four two-dimensional textures: xyGridTexture (first texture), interfacesZDataTexture (second texture), interfacesInfoTexture (third texture), and interfacesUpDownTexture (fourth texture), which correspond to the data array of the InterfaceGridBlock model, as shown in the figure. The resolution of xyGridTexture is consistent with the resolution of the InterfaceGridBlock model grid in the XY direction. For example, if the XY direction resolution of the model grid is 128×128, then the width and height of xyGridTexture are both 128. In this way, the texture units correspond one-to-one with the unit columns of the model, and the unit columns are stored in row-major order, using the R and G components of RGBA to represent them.<interfaceNum,dataPos> In the interfacesZDataTexture data texture, the RGBA components store the height values ​​z1, z2, z3, and z4 of the four vertices of the interface, respectively. For the interfacesInfoTexture texture, it stores the inorder sequence information of the binary tree and fills it using the R and G channels respectively. Tests show that using only the R channel is insufficient to meet the requirements. Finally, in the interfacesUpDownTexture texture, the R component represents the "up" attribute of the face, and the G component represents the "down" attribute. Figure 9 As shown; then, by passing in the resolution, starting coordinates, and other information of the InterfaceGrid model, along with the four texture information mentioned above, the volumetric visualization of the model can be completed in the GPU using the ray casting algorithm.

[0090] like Figure 1 As shown in Figure 13, based on the implicitly stored texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain the transformed vertex coordinates. The vertex coordinates include the texture coordinates, normals, and texture coordinates, including:

[0091] 131. Extract vertex data of the texture from the implicitly stored texture set;

[0092] 132. Based on the vertex data, the vertex shader transforms the vertex coordinates from model space to clip space to obtain the transformed vertex coordinates.

[0093] In this embodiment of the invention, volume rendering can be performed using a single volume texture. The volume texture is not spatial model data; volume rendering requires the combination of a spatial volume model (usually a regular cube or cylinder) and the volume texture. For example, to see a texture mapping effect on a computer screen, at least a two-dimensional texture and a facet are needed for texture mapping operations. This facet is essentially the carrier of the texture. Similarly, volume rendering also requires a three-dimensional model (usually a cube or cylinder) as the carrier of the volume texture. The volume texture corresponds to the model through texture coordinates (three-dimensional), and then a ray is drawn from the viewpoint to a point on the model. This ray traversing the model space is equivalent to the ray traversing the volume texture. Typically, this is used... A standard cube or cylinder is used as the spatial model for volume rendering; this application uses a cube as the carrier of volume textures; in GPU programming, the vertex shader is mainly responsible for managing vertex data, ensuring the final position of the vertices on the screen. Based on the ray casting algorithm, a cube data object is needed as the volume texture object. The cube information, as shown in the figure, includes the cube's coordinates (aPos), normals (aNormal), and texture coordinates. By transforming the coordinates, the vertex coordinates of the cube are converted from model space to clip space, ensuring that the vertex coordinates are correctly mapped to the 3D view. The coordinates (EntryPoint) and normals (Normal) are passed to the fragment shader. This data will be used for ray casting and lighting calculations; as shown... Figure 10 As shown.

[0094] like Figure 1 As shown in Figure 14, the transformed vertex coordinates are transmitted to the fragment shader, and combined with the implicit storage texture set, the implicit storage information corresponding to the current fragment is obtained through texture sampling techniques, including:

[0095] 141. Use the fragment shader to calculate the 3D texture coordinates for texture sampling from the transformed vertex coordinates to obtain the 3D texture coordinates;

[0096] 142. Based on the three-dimensional texture coordinates, use the fragment shader to obtain the implicit storage information corresponding to the current fragment in the implicit storage texture set, so as to obtain the sampling result;

[0097] 143. Based on the sampling results, extract the implicit storage information required for the current segment.

[0098] In this embodiment of the invention, the fragment shader receives coordinates (usually the three-dimensional spatial coordinates of the vertex) and normal information from the vertex shader. Using the coordinates and normal information, the fragment shader calculates three-dimensional texture coordinates for texture sampling. These coordinates define the position in texture space and are used to retrieve data from the implicit storage texture set. Accurate three-dimensional texture coordinates are the foundation of texture sampling, ensuring that implicit storage information can be extracted from the correct position. Based on the calculated three-dimensional texture coordinates, the fragment shader performs texture sampling operations on the implicit storage texture set. The implicit storage texture set contains implicit representation data of the InterfaceGrid model. This data is organized using structures such as one-dimensional arrays for efficient transmission and processing in the GPU. The texture sampling technique extracts data at the corresponding position from the implicit storage texture set based on the three-dimensional texture coordinates. Through texture sampling, the fragment shader can quickly access the implicit storage information required by the current fragment, such as the elevation and attributes of geological interfaces. This method leverages the parallel processing capabilities of GPUs, significantly improving the efficiency of data access and processing. The fragment shader extracts the implicit storage information required for the current fragment from the texture sampling results. This information may include the elevation values ​​of geological interfaces, attribute information (such as lithology, density, etc.), and other visualization-related data. The extracted implicit storage information provides crucial data support for subsequent volume rendering and visualization processing, ensuring that each fragment can correctly display the internal structure and attribute characteristics of the geological model according to its location. The entire process, by combining the parallel computing capabilities of GPUs and texture sampling technology, achieves efficient volume visualization of the InterfaceGrid model. This not only improves the efficiency of data access and processing but also ensures the accuracy and realism of the visualization results. By extracting implicit storage information from the implicit storage texture set, the fragment shader can accurately render the internal structure and attribute characteristics of the geological model, providing strong support for research in fields such as geological exploration and reservoir simulation.

[0099] like Figure 1 As shown in Figure 15, based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model body is drawn, and the attributes of the InterfaceGrid mesh model at the current sampling point are retrieved, including:

[0100] 151. Based on the implicit storage information corresponding to the current segment, use the inverse matrix to transform the camera viewpoint to the model coordinate system, and calculate the ray direction from the viewpoint to the texture vertex;

[0101] 152. Based on the ray direction, gradually move the sampling point in the loop and sample along the ray path to obtain the sampling results;

[0102] 153. Based on the sampling results, calculate the spatial coordinates of the current sampling point;

[0103] 154. Based on the spatial coordinates of the sampling points, use the tree-based binary sampling function to obtain the attribute values.

[0104] In this embodiment of the invention, ray casting is a direct volume rendering process in which the viewpoint emits rays to the 3D data volume to calculate and accumulate the color and transparency of the ray path, thereby generating the final image. The algorithm flow of ray casting is as follows: First, calculate the ray direction: calculate the inverse matrix of the model to transform the viewpoint from the world coordinate system to the model coordinate system, use the calculated position of the camera viewpoint in the model coordinate system, and calculate the ray direction from the viewpoint to the volume data entry point using the coordinate information of the cube passed in from the vertex shader; Second, initialize sampling parameters: initialize the starting sampling point, take the cube vertex coordinates as the ray entry point, initialize the color accumulator, and use a large step size for the first pre-sampling to quickly approximate the boundary of the data of interest; Third, fine sampling: adjust the step size to a finer step size and reset the sampling point, and perform fine sampling along the ray path through loop iteration; Fourth, color and lighting implementation: in the sampling loop, calculate the spatial coordinates of the current sampling point, which needs to be mapped from the cube coordinates to the InterfaceGrid model space, and call the tree-like binary sampling function to obtain the attribute value of the current position to determine whether there is valid volume data. If it passes through a new attribute region, update the color and transparency.

[0105] like Figure 1 As shown in Figure 154, based on the spatial coordinates of the sampling points, the attribute values ​​are obtained using a tree-based binary sampling function, including:

[0106] 1541. Based on the spatial coordinates of the sampling points, locate the cylindrical grid and determine the grid index;

[0107] 1542. Based on the first texture, obtain the facet information and inorder sequence index of the cylinder;

[0108] 1543. Based on the face information and inorder sequence index of the cylinder, calculate the intermediate index, obtain the face index from the third texture, calculate the face value, determine the vertical relationship between the point and the face, and obtain the result of the first binary search.

[0109] 1544. Based on the result of the first binary search, reset the calculation of the patch index and state, and perform the binary search again to obtain the result of the second binary search;

[0110] 1545. Based on the results of the second binary search, determine the top and bottom information of the found point on the face and obtain the corresponding attribute value from the fifth array.

[0111] In this embodiment of the invention, based on the spatial coordinates P(x,y,z) of the sampling point, the "pillar" containing that point is located (which can be understood as a spatial partitioning structure, such as a voxel pillar or similar geometry). The index of this pillar in the overall mesh structure is determined, providing basic positioning information for subsequent steps. Quickly locating the pillar where the sampling point is located narrows the search range and improves sampling efficiency. The mesh index provides an accurate starting point for subsequent texture sampling and binary search. By accessing the first texture, the face information and inorder sequence index of the current pillar are obtained. The face information describes the internal geometry of the pillar, and the inorder sequence index is used to guide the binary search process. Detailed information about the internal structure of the pillar is provided, providing the necessary geometric and topological foundation for the binary search. The inorder sequence index ensures the orderliness and efficiency of the binary search. Based on the face information and inorder sequence index of the pillar, an intermediate index is calculated to obtain the face index from the third texture. The face value is calculated using the face index, and the vertical relationship between the sampling point and the face is determined, resulting in the first binary search. The results provide a foundation for subsequent searches; binary search quickly narrows the search range, improving search efficiency, and determining the vertical relationship between points and patches provides crucial information for subsequent precise searches; based on the results of the first binary search, the patch index and state are reset, and the binary search is executed again to obtain a more precise second binary search result. The second binary search further narrows the search range, improving search accuracy, and resetting the calculation ensures the independence and accuracy of the search process; based on the results of the second binary search, the vertical information of the found points on the patches is determined; the corresponding attribute values ​​are obtained from the fifth array (which may store attribute values ​​or related data), accurately acquiring the attribute values ​​of the sampling points, providing crucial data for subsequent volume rendering, data analysis, or visualization, improving the efficiency and accuracy of attribute sampling, and providing strong support for the simulation and analysis of complex geological models; the entire process, through a tree-like binary sampling function combined with texture sampling and array access techniques, achieves rapid and accurate acquisition of the attribute values ​​of the sampling points. This method not only improves sampling efficiency but also ensures the accuracy of sampling results. By combining binary search and texture sampling techniques, it can effectively handle the attribute sampling problem of complex geological models, providing strong technical support for research in fields such as geological exploration and reservoir simulation.

[0112] like Figure 1 As shown in Figure 16, based on the attributes of the current sampling point, the color and transparency of the sampling point are updated, and the cumulative volume rendering color is obtained by compositing using a lighting model, including:

[0113] 161. Obtain ambient lighting;

[0114] 162. Based on the model's properties at the current sampling point, calculate the dot product of the light source direction and the surface normal to obtain diffuse illumination;

[0115] 163. Based on diffuse lighting, calculate the half-angle vector between the line of sight and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain specular lighting.

[0116] 164. Based on the specular reflection of light, simulate the phenomenon that the light intensity decreases with increasing distance to obtain the light source attenuation;

[0117] 165. Multiply diffuse and specular lighting by light attenuation, and then add the effect of ambient lighting to obtain the cumulative volume rendering color.

[0118] In this embodiment of the invention, based on the properties of the model at the current sampling point, the diffuse light intensity and specular intensity are calculated using a lighting model. The lighting model considers factors such as the position, direction, and intensity of the light source, as well as the normal direction of the sampling point surface, to simulate lighting effects in the real world. This obtains the color and brightness information of the current sampling point under illumination, providing a basis for subsequent color updates and enhancing the realism and three-dimensionality of the visualization, making the lighting effects on the model surface more lifelike. Based on the lighting calculation results, the color and transparency of the current sampling point are updated. Color updates may involve superimposing or mixing the lighting intensity with the original color of the sampling point to reflect the influence of lighting on color. Transparency updates may consider the material properties of the sampling point and the lighting conditions. The potential impact on transparency; the color and transparency of the sampling points are updated, reflecting the effect of lighting on the model surface; providing more realistic and accurate color values ​​for subsequent color synthesis; based on the updated color and transparency of the sampling points, the color of the current sampling point is synthesized with the previously accumulated color. The synthesis process may involve algorithms such as alpha blending formulas to ensure the accuracy and realism of the color synthesis. The accumulated volume rendering colors are continuously updated as each sampling point is processed, ultimately forming a complete visualization image; through color synthesis and accumulation, the overall visualization effect of the model is gradually constructed. The color and transparency of each sampling point are fully considered and processed, making the final visualization image more realistic and delicate; in volume rendering In the process, the first step is to acquire ambient lighting information. Ambient lighting refers to light rays that shine uniformly on the object's surface from all directions, providing the object's basic color and brightness. This provides the foundational lighting values ​​for subsequent lighting calculations, ensuring that the object can exhibit a certain color and brightness even without a direct light source. Based on the ambient lighting, the dot product of the light source direction and the surface normal is calculated. The result of the dot product reflects the angle between the light source direction and the surface normal, thus determining the intensity of diffuse lighting. Diffuse lighting is light rays that are uniformly reflected in all directions after hitting the object's surface, giving the object's surface a uniform color and brightness. The diffuse lighting intensity at each point on the object's surface is obtained, providing crucial information for subsequent lighting effect synthesis. The system is composed of several components; it enhances the three-dimensionality and realism of the object's surface, making the object exhibit more natural color changes under lighting; based on diffuse lighting, it calculates the half-angle vector between the viewing direction and the light source direction. The half-angle vector is the intermediate direction between the viewing direction and the light source direction, which determines the direction of specular reflection lighting; it calculates the dot product of the half-angle vector and the normal to obtain the intensity of specular reflection lighting. Specular reflection lighting is the light reflected in a specific direction after it hits the object's surface, giving the object's surface a highlight effect; it obtains the specular reflection lighting intensity at each point on the object's surface, providing accurate data for simulating the highlight effect; it enhances the gloss and texture of the object's surface, making the object exhibit a more realistic highlight effect under lighting;Based on specular reflection lighting, the phenomenon of light intensity decreasing with increasing distance is simulated. Light source attenuation refers to the gradual decrease in light intensity during propagation due to factors such as air absorption and scattering. The resulting light intensity values ​​varying with distance provide crucial data for realistically simulating the illumination effect of light sources on object surfaces, enhancing the realism and depth of the scene and making distant objects exhibit more natural color and brightness variations under illumination. Multiplying diffuse and specular reflection lighting by light attenuation yields the lighting effect considering light source attenuation. Adding the influence of ambient light, the final lighting color is obtained. The final lighting color is a combination of ambient light and diffuse reflection. This method comprehensively represents reflected and specular lighting; it obtains the final lighting color at each point on the object's surface, providing accurate data for color synthesis during the volume rendering process, enhancing the realism and three-dimensionality of the object's surface, and making the object exhibit more natural and realistic color and brightness effects under lighting. It uses a lighting model to simulate the interaction between natural light and the object's surface, and calculates the lighting effects to add to the cumulative volume rendering color, ultimately obtaining the final color. This process greatly enhances the realism and three-dimensionality of the object's surface. By accurately calculating ambient lighting, diffuse lighting, specular lighting, and light source attenuation, it can simulate the color and brightness changes of objects under natural lighting.

[0119] like Figure 1 As shown in Figure 18, colors are drawn based on the accumulated volume, and the results are output to the screen to complete the volume visualization of the InterfaceGrid model, including:

[0120] 181. Draw colors based on the accumulated volume and assign the colors to the output color variable of the fragment shader;

[0121] 182. Draw colors based on the accumulated volume, and process the transparency of the colors to obtain the final result;

[0122] 183. Based on the processing results and color variables, the rendering pipeline will use the color value for blending, depth testing, and write it to the frame buffer to obtain the fragment shader at the end of the process.

[0123] 184. Output the fragment shader that has finished executing to the screen to complete the volume visualization of the InterfaceGrid model.

[0124] In this embodiment of the invention, the calculated final color is assigned to the output color variable of the fragment shader. This output color variable serves as a bridge between the fragment shader and the rendering pipeline, ensuring that the calculated final color is correctly transmitted to the rendering pipeline, providing a foundation for subsequent color processing and output. Based on the calculated final color, its transparency (Alpha value) is processed. This transparency processing may include adjusting the transparency range, applying transparency blending modes, etc., to ensure that the color can be correctly blended with the background or other objects during rendering. The resulting processed color has a transparency more suitable for the processing requirements of the rendering pipeline, enhancing the realism and layering of the visualization effect, and allowing transparent objects to be correctly blended with the background or other objects. The rendering pipeline performs color blending and depth measurement based on the processing results and the color variable. The process involves several steps: color blending, depth testing, and finally, color visualization. Color blending involves mixing the current segment's color with existing colors in the frame buffer to obtain the final color value. Depth testing compares the current segment's depth value with existing segments in the frame buffer to determine whether to write the current segment to the frame buffer. After processing, the final color value is written to the frame buffer. This ensures the correctness and accuracy of the visualization, allowing objects to be correctly displayed on the screen. Finally, based on the finished segment shader, the color value in the frame buffer is output to the screen, completing the volume visualization of the InterfaceGrid model. Users can see realistic 3D model effects on the screen, enhancing their understanding and perception of the model. This provides an intuitive and visual tool for research in fields such as geological exploration and reservoir simulation.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / featureid> < / infoindex> < / featureid> < / infoindex>

Claims

1. A method for drawing ray projection volumes for an InterfaceGrid mesh model, characterized in that, include: The InterfaceGrid model is converted from explicit storage to implicit storage structure of InterfaceGridBlock to obtain implicit storage data. The implicit storage structure of InterfaceGridBlock includes five arrays. Implicit memory data is transferred to the GPU and stored in parts to obtain an implicit memory texture set; Based on the implicitly stored texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain the transformed vertex coordinates, which include the texture coordinates, normals, and texture coordinates. The transformed vertex coordinates are transmitted to the fragment shader and combined with the implicit storage texture set. The implicit storage information corresponding to the current fragment is obtained through texture sampling techniques. Based on the implicit storage information corresponding to the current segment, the InterfaceGrid mesh model body is drawn, and the attributes of the InterfaceGrid mesh model at the current sampling point are retrieved; Based on the attributes of the current sampling point, update the color and transparency of the sampling point, and use the lighting model to synthesize the cumulative volume rendering color; The colors are drawn based on the accumulated volume, and the results are output to the screen to complete the volume visualization of the InterfaceGrid model.

2. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 1, characterized in that, Implicit memory data is transferred to the GPU and stored in parts to obtain an implicit memory texture set, including: Extract the first array of implicitly stored data, and store the cylinder cell data of the first array into the RG channel of the first texture of the GPU in row-major order to obtain the filled first texture; Based on the implicit storage data, extract the vertex height values ​​of the second array and store them in the RGBA channels of the GPU's second texture to obtain the filled second texture; Based on the implicit storage data, the inorder sequence information of the third array is extracted and stored in the RG channel of the GPU's third texture to obtain the filled third texture. Based on the implicit storage data, extract the upper and lower attributes of the fifth array and store them in the RG channel of the fourth texture of the GPU to obtain the filled fourth texture. The four filled textures are bound to the GPU rendering pipeline to form an implicitly stored texture set.

3. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 2, characterized in that, Based on the implicitly stored texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain the transformed vertex coordinates. These vertex coordinates include the texture coordinates, normals, and texture coordinates, including: Extract vertex data of the texture from the implicitly stored texture set; Based on the vertex data, the vertex shader transforms the vertex coordinates from model space to clip space to obtain the transformed vertex coordinates.

4. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 3, characterized in that, The transformed vertex coordinates are transmitted to the fragment shader, and combined with the implicit storage texture set, the implicit storage information corresponding to the current fragment is obtained through texture sampling techniques, including: The transformed vertex coordinates are used to calculate the 3D texture coordinates for texture sampling using the fragment shader, thus obtaining the 3D texture coordinates; Based on the 3D texture coordinates, the fragment shader is used to obtain the implicit storage information corresponding to the current fragment in the implicit storage texture set, so as to obtain the sampling result; Based on the sampling results, the implicit storage information required for the current segment is extracted.

5. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 4, characterized in that, Based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model is drawn, and the attributes of the InterfaceGrid mesh model at the current sampling point are retrieved, including: Based on the implicit storage information corresponding to the current fragment, the camera viewpoint is transformed to the model coordinate system using the inverse matrix, and the ray direction from the viewpoint to the texture vertex is calculated; Based on the direction of the ray, the sampling point is moved step by step in the loop to sample along the ray path in order to obtain the sampling results; Calculate the spatial coordinates of the current sampling point based on the sampling results; Based on the spatial coordinates of the sampling points, the attribute values ​​are obtained using a tree-based binary sampling function.

6. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 5, characterized in that, Based on the spatial coordinates of the sampling points, the attribute values ​​are obtained using a tree-based binary sampling function, including: Based on the spatial coordinates of the sampling points, locate the cylindrical grid and determine the grid index; Based on the first texture, obtain the surface information and inorder sequence index of the cylinder; Based on the face information and inorder sequence index of the cylinder, calculate the intermediate index, obtain the face index from the third texture, calculate the face value, determine the vertical relationship between the point and the face, and obtain the result of the first binary search. Based on the result of the first binary search, reset the calculation of the patch index and state, and perform the binary search again to obtain the result of the second binary search; Based on the results of the second binary search, the upper and lower information of the found point on the face is determined, and the corresponding attribute value is obtained from the fifth array.

7. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 6, characterized in that, Based on the attributes of the current sampling point, update the color and transparency of the sampling point, and use the lighting model to synthesize the colors to obtain the accumulated volume rendering colors, including: Obtain ambient light; Based on the model's properties at the current sampling point, calculate the dot product of the light source direction and the surface normal to obtain diffuse illumination; Based on diffuse lighting, calculate the half-angle vector between the line of sight and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain specular lighting. Based on the specular reflection of light, the phenomenon of light intensity decreasing with increasing distance is simulated to obtain the light source attenuation. The cumulative volume rendering color is obtained by multiplying diffuse and specular lighting by light attenuation and then adding the effect of ambient lighting.

8. The method for drawing ray projectors for an InterfaceGrid mesh model according to claim 7, characterized in that, Based on the accumulated volume, colors are drawn and output to the screen to complete the volume visualization of the InterfaceGrid model, including: Draw colors based on the accumulated volume and assign the colors to the output color variable of the fragment shader; The color is drawn based on the accumulated volume, and the transparency of the color is processed to obtain the result. Based on the processing results and color variables, the rendering pipeline will use the color value for blending, depth testing, and writing to the frame buffer to obtain the fragment shader at the end of the process. The fragment shader that has finished executing is output to the screen, completing the volume visualization of the InterfaceGrid model.

Citation Information

Patent Citations

  • Three-dimensional geological model implicit storage method oriented to variable-scale grid visualization

    CN117274521A

  • Non-uniform cuboid grid adaptive sampling volume drawing method based on GPU acceleration

    CN119047261A