Ray casting volume rendering method for InterfaceGrid grid model
By converting the InterfaceGrid mesh model into an implicit storage structure and using GPU for ray projector drawing, the efficiency and accuracy problems of the three-dimensional geological model when expressing complex geological structures are solved, and efficient and accurate visualization of the three-dimensional geological model is achieved.
Patent Information
- Application Number
- CN202510553967.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The existing three-dimensional geological models have problems such as insufficient spatial computing capabilities, difficulty in maintaining topological consistency, unstable triangle cutting, and large data volume, which lead to high management complexity, especially when dealing with irregular geological bodies and complex faults.
The ray projector drawing method of the InterfaceGrid mesh model is adopted to convert the model from display storage to implicit storage structure, and the GPU is used for segment storage and texture set management, coordinate transformation and information sampling is performed through vertex and fragment shaders, and volume drawing is combined with the lighting model to achieve efficient three-dimensional geological model visualization.
The visualization efficiency and accuracy of the three-dimensional geological model are improved, the spatial location can be quickly positioned, the calculation complexity is reduced, the volume visualization speed of large-scale models is significantly improved, and the high-precision geological feature presentation is maintained.
Smart Images

Figure CN120495497A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ray casting volume rendering, and in particular to a ray casting volume rendering method for an InterfaceGrid mesh model. Background Art
[0002] The construction of three-dimensional geological data models is mainly based on the geometric form of geological objects and the topological relationship between these objects. The irregular triangulated network model has the following defects: insufficient spatial calculation and analysis capabilities, difficulty in maintaining topological consistency, instability of triangle cutting, difficulty in local data update and maintenance, and complexity in organization and management due to large data volume.
[0003] However, the regular grids in the grid model are limited in their ability to represent complex geological structures. The SBRT model suffers from accuracy issues. This model uses a regular grid to represent the hierarchical structure of geological bodies, but its accuracy is limited. In particular, it cannot effectively represent irregularly shaped geological interfaces in complex geological structures, and its expressive power is limited for complex faults (such as Y-shaped faults). The triangular prism model divides the horizontal space using a triangular mesh and constructs the triangular prism vertically by connecting triangle vertices to form edges. This approach performs poorly with complex geological structures, especially when dealing with variable or irregular geological bodies. Although the VPTN model uses a triangular mesh for horizontal division and can record vertical stratification points, it may not effectively capture subtle geological changes in complex geological structures. The model also lacks flexibility, especially when dealing with irregular geological structures, where it may not be able to adapt to complex spatial relationships, resulting in insufficient expressive power. The corner point grid, due to the large amount of data recorded at the eight corner points, is not conducive to online visualization, especially when rapidly visualizing large-scale models of different regions and scales. Summary of the Invention
[0004] The present invention provides a ray casting volume rendering method for InterfaceGrid mesh model, which is used to solve the problems of insufficient expression ability and low efficiency of traditional three-dimensional geological models.
[0005] In one aspect, the present invention provides a ray casting volume rendering method for an InterfaceGrid mesh model, comprising:
[0006] Convert the InterfaceGrid grid model from explicit storage to the implicit storage structure of InterfaceGridBlock to obtain implicit storage data, wherein the implicit storage structure of InterfaceGridBlock includes five arrays;
[0007] The implicit storage data is transferred to the GPU and stored partially to obtain an implicit storage texture set;
[0008] According to the implicit storage texture set, using a vertex shader to transform the vertex coordinates of the texture to obtain transformed vertex coordinates, the vertex coordinates including the texture coordinates, normal, and texture coordinates;
[0009] The transformed vertex coordinates are transferred 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 technology;
[0010] Based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model is rendered and the attributes of the InterfaceGrid mesh model at the current sampling point are found.
[0011] According to the properties of the current sampling point, the color and transparency of the sampling point are updated, and the lighting model is used for synthesis to obtain the accumulated volume rendering color;
[0012] According to the accumulated volume rendering color, it is output to the screen to complete the volume visualization of the InterfaceGrid model.
[0013] Furthermore, the implicit storage data is transferred to the GPU and partially stored to obtain an implicit storage texture set, including:
[0014] Extract the first array of implicitly stored data, and store the cylinder unit data of the first array into the RG channel of the first texture of the GPU in a row-first manner to obtain a filled first texture;
[0015] Extract the vertex height values of the second array according to the implicit storage data and store them in the RGBA channel of the second texture of the GPU to obtain the filled second texture;
[0016] According to the implicit storage data, the in-order sequence information of the third array is extracted and stored in the RG channel of the third texture of the GPU to obtain the filled third texture
[0017] According to the implicit storage data, the upper and lower attributes of the fifth array are extracted and stored in the RG channel of the fourth texture of the GPU to obtain the filled fourth texture;
[0018] Bind the four filled textures to the GPU rendering pipeline to form an implicit storage texture set.
[0019] Furthermore, according to the implicit storage texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain transformed vertex coordinates, where the vertex coordinates include the texture coordinates, normals, and texture coordinates, including:
[0020] Extract the vertex data of the texture from the implicit storage texture set;
[0021] According to the vertex data, the vertex shader converts 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 technology, including:
[0023] The transformed vertex coordinates are used to calculate the three-dimensional texture coordinates for texture sampling using a fragment shader to obtain the three-dimensional texture coordinates;
[0024] According to 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 to obtain the sampling result;
[0025] According to the sampling results, the implicit storage information required for the current fragment is extracted.
[0026] Furthermore, the InterfaceGrid mesh model volume is rendered based on the implicit storage information corresponding to the current fragment, and the properties of the InterfaceGrid mesh model at the current sampling point are found, including:
[0027] According to the implicit storage information corresponding to the current fragment, the camera observation point is transformed into the model coordinate system using the inverse matrix, and the ray direction from the observation point to the texture vertex is calculated;
[0028] According to the direction of the ray, the sampling point is gradually moved in the loop, and sampling is performed along the ray path to obtain the sampling result;
[0029] According to the sampling results, calculate the spatial coordinates of the current sampling point;
[0030] According to the spatial coordinates of the sampling points, the attribute values are obtained using a tree-like binary sampling function.
[0031] Furthermore, according to the spatial coordinates of the sampling points, a tree-like binary sampling function is used to obtain the attribute value, including:
[0032] According to the spatial coordinates of the sampling points, the cylindrical grid is located and the grid index is determined;
[0033] According to the first texture, obtain the face information and in-order sequence index of the cylinder;
[0034] Based on the face information and in-order sequence index of the cylinder, the intermediate index is calculated, the face index is obtained from the third texture, and the face value is calculated to determine the upper and lower relationship between the point and the face to obtain the first binary search result;
[0035] Based on the result of the first binary search, reset the calculated patch index and state, and perform the binary search again to obtain the result of the second binary search;
[0036] Based on the result of the second binary search, determine whether the found point is located above or below the patch, and obtain the corresponding attribute value from the fifth array.
[0037] Furthermore, based on the properties of the current sampling point, the color and transparency of the sampling point are updated and synthesized using the lighting model to obtain the accumulated volume rendering color, including:
[0038] Get ambient lighting;
[0039] Based on the properties of the model at the current sampling point, the dot product of the light source direction and the surface normal is calculated to obtain diffuse lighting;
[0040] Based on the diffuse lighting, calculate the half-angle vector between the view direction and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain the specular lighting;
[0041] Based on the specular reflection illumination, the phenomenon that the light intensity decreases with increasing distance is simulated to obtain the light source attenuation;
[0042] Multiply the diffuse and specular lighting by the lighting attenuation, and then add the effect of the ambient lighting to get the accumulated volume rendering color.
[0043] Furthermore, the accumulated volume rendering colors are output to the screen to complete the volume visualization of the InterfaceGrid model, including:
[0044] According to the accumulated volume rendering color, the color is assigned to the output color variable of the fragment shader;
[0045] According to the accumulated volume rendering color, the transparency of the color is processed to obtain a processing result;
[0046] Based on the processing result and the color variable, the rendering pipeline will use the color value for blending, depth testing, and writing to the frame buffer to get the fragment shader that ends execution;
[0047] According to the fragment shader that has been executed, it is output to the screen to complete the volume visualization of the InterfaceGrid model.
[0048] The present invention provides a ray casting volume rendering method for an InterfaceGrid grid model. The present invention improves the efficiency and accuracy of visualization by mapping geological interface information to the InterfaceGrid grid system and utilizing texture objects to efficiently record the elevation, spatial structure, and attribute information of the geological model. A ray casting algorithm is used to rapidly locate spatial locations intersecting with the model, and rapid location of unit pillars at any position is achieved. A binary search algorithm is used to complete attribute queries within an O(logn) time complexity, significantly improving query efficiency. Furthermore, by utilizing a multi-resolution gridding algorithm and GPU-accelerated volume rendering technology, the present invention can significantly improve the volume visualization speed of large-scale three-dimensional geological models and maintain low computational complexity when processing massive amounts of data. Test verification results indicate that the InterfaceGrid visualization algorithm of the present invention is several times more computationally efficient than traditional methods in large-scale geological model visualization tasks, and ensures high-precision geological feature presentation during the visualization process. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 1 is a flow chart of a ray casting volume rendering method for an InterfaceGrid mesh model provided by an embodiment of the present invention;
[0051] Figure 2 This is a simple diagram of the InterfaceGrid model;
[0052] Figure 3 It is a schematic diagram of the spatial relationship of the facets in the unit column;
[0053] Figure 4 This is a diagram of the InterfaceGrid model data structure;
[0054] Figure 5 It is a schematic diagram of the calculation of the relationship between space points and space surfaces;
[0055] Figure 6 It is a schematic diagram of attribute query;
[0056] Figure 7 This is the principle diagram of the ray casting algorithm;
[0057] Figure 8This is a schematic diagram of the overall process of the GPU volume rendering algorithm based on ray casting;
[0058] Figure 9 This is a diagram of InterfaceGrid model texture management;
[0059] Figure 10 It is a schematic diagram of a volume texture cube;
[0060] Figure 11 This is a raycast diagram of the InterfaceGrid mesh model;
[0061] Figure 12 This is another diagram of ray casting for the InterfaceGrid mesh model. DETAILED DESCRIPTION
[0062] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0063] Figure 1 This is one of the flow charts of the ray casting volume rendering method for the InterfaceGrid mesh model provided by an embodiment of the present invention.
[0064] like Figures 1 to 12 As shown, the embodiment of the present invention provides a ray casting volume rendering method for an InterfaceGrid mesh model, which mainly includes the following steps:
[0065] 11. Convert the InterfaceGrid grid model from explicit storage to the implicit storage structure of InterfaceGridBlock to obtain implicit storage data, where the implicit storage structure of InterfaceGridBlock includes five arrays.
[0066] 12. Transfer the implicit storage data to the GPU and perform partial storage to obtain an implicit storage texture set;
[0067] 13. According to the implicit storage texture set, use the vertex shader to transform the vertex coordinates of the texture to obtain transformed vertex coordinates, wherein the vertex coordinates include the coordinates of the texture, the normal, and the texture coordinates;
[0068] 14. The transformed vertex coordinates are transferred 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 technology;
[0069] 15. Based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model is rendered and the attributes of the InterfaceGrid mesh model at the current sampling point are found.
[0070] 16. Update the color and transparency of the sampling point according to the properties of the current sampling point, and use the lighting model for synthesis to obtain the accumulated volume rendering color;
[0071] 17. Output the accumulated volume rendering colors to the screen to complete the volume visualization of the InterfaceGrid model.
[0072] In an embodiment of the present 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. Attribute sampling is performed at any position in each unit column, and the parallel computing capabilities of general-purpose graphics processing units are utilized for acceleration. A ray casting algorithm is used to complete the volume visualization of the InterfaceGrid model, thereby significantly improving the efficiency of the volume visualization of the geological model. Given the highly parallel nature of the ray attribute sampling task in each column, the present invention adopts an efficient strategy: the attribute query task in each column is decomposed into multiple subtasks that can be independently processed in parallel, and the parallel computing capabilities of general-purpose computing on graphics processing units (GPGPUs) are utilized for acceleration. As an advanced computing platform, GPGPU's powerful parallel processing unit (stream processor) can process large amounts of data simultaneously, thus showing significant computing advantages when processing large-scale two-dimensional survey line data sets. Compared with traditional CPU (central processing unit) computing, GPGPU stands out for its powerful parallel computing capabilities and high portability, especially when processing large-scale data sets. In addition, although CUDA (Compute Unified Device Architecture) is also a powerful GPU programming model, GPGPU is more suitable for the application scenario of the present invention due to its higher programming ease and wide hardware compatibility. Therefore, the present invention realizes an efficient volume visualization algorithm for the InterfaceGrid three-dimensional geological model by combining grid model information, attribute query technology and GPGPU parallel capabilities, greatly improving the visualization efficiency of the model and providing strong technical support for research in related fields.
[0073] In an embodiment of the present invention, the InterfaceGrid model is an advanced technology for 3D geological modeling, specifically designed to enhance the representation of complex geological structures. The core of the model is to use quadrilaterals to approximate layered geological structures. Each longitudinal column is composed of stacked quadrilaterals, which share a common column and are either connected or independent. In this model, each column represents a vertically stacked set of quadrilaterals, which are arranged in a uniform grid on the XY plane and extend in the Z direction to the top of the 3D geological model. This is visually represented by the top and bottom quadrilaterals, which mark the upper and lower boundaries of the modeled geological features. Figure 2 The black vertices in the figure highlight the corners of the grid structure and emphasize the arrangement of the system;
[0074] Assume 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 jth quadrilateral in the i-th unit column, and mi is the number of quadrilaterals in the unit column. Therefore, we can also say that the InterfaceGrid model is composed of unit columns, and unit columns are composed of multiple quadrilaterals;
[0075] The InterfaceGrid geological model consists of multiple pillars (Pillar), each of which is uniformly defined as InterfaceColumn. Assuming the base grid size of the model is 3×3, the InterfaceGrid example model consists of 9 pillars (InterfaceColumn). Each pillar stores a binary tree (BinaryTree) with a spatial structure. In this binary tree, the spatial relationship between parent nodes and child nodes is determined by their positions: the left child node is located above the parent node, while the right child node is located below the parent node. In the process of constructing the binary tree structure, the first node inserted is the root node of the binary tree, and the subsequently inserted nodes become the child nodes of the root node in turn according to their spatial relationship. Assuming that there are five geological interface fragments A, B, C, D, and E in one of the pillars of the model, as shown in the following figure: Figure 3 As shown in the figure, the binary tree reflects the spatial position relationship of these fragments.
[0076] In the embodiment of the present invention, the specific structure of InterfaceGridBlock is designed as follows:
[0077] First array: XYGrid array<InterfaceNum,StartPos> : Store the number of geological interface fragments (InterfaceNum) in the column unit and the index in the geological interface fragment array (StartPos: the index of the face in the Interfaces array) in row priority order;
[0078] Second array: Interfaces array<z1,z2,z3,z4> : Store the elevation information of the geological interface fragment in each cylinder (four z values of the surface) in binary tree order in the cylinder;
[0079] The third array: InterfacesTreeInfo <infoindex>: Store the geological interface fragment index information according to the binary tree in-order sequence in the column;
[0080] Fourth array: InterfacesFeatureID <featureid>: Store the FeatureID of the global geological interface (fault or stratum) to which each geological interface fragment belongs in the binary tree order in the column;
[0081] Fifth array: InterfaceUpAndDownProps<up,down> :Store the upper and lower attribute values of each geological interface segment in the binary tree order in the column;
[0082] Among them, XYGrid<InterfaceNum,StartPos> The array stores the number of geological interface segments (InterfaceNum) in the column unit and the index in the geological interface segment array (StartPos: the index of the face in the Interfaces array) in row priority order; Interfaces<z1,z2,z3,z4> The array stores the elevation information (z1, z2, z3, z4) of the geological interface fragment in each column in the binary tree order; InterfacesTreeInfo <infoindex>The array stores the geological interface fragment index information according to the binary tree in-order sequence in the cylinder; InterfacesFeatureID <featureid>The array stores the FeatureID of the global geological interface (fault or stratum) to which each geological interface fragment belongs in the order of the binary tree in the column; InterfaceUpAndDownProps<up,down> The array stores the upper and lower attribute values of each geological interface segment in the binary tree order in the cylinder.
[0083] like Figure 1 As shown in FIG12 , the implicit storage data is transferred to the GPU and partially stored to obtain an implicit storage texture set, including:
[0084] 121. Extract the first array of implicitly stored data, and store the cylinder unit data of the first array into the RG channel of the first texture of the GPU in a row-first manner to obtain a filled first texture;
[0085] 122. Extract the vertex height values of the second array according to the implicit storage data and store them in the RGBA channel of the second texture of the GPU to obtain the filled second texture;
[0086] 123. According to the implicit storage data, extract the in-order sequence information of the third array and store it in the RG channel of the third texture of the GPU to obtain the filled third texture.
[0087] 124. Extract the upper and lower attributes of the fifth array according to the implicitly stored data and store them into 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 implicit storage texture set.
[0089] In the embodiment of the present invention, the vertex and fragment shaders in GPU programming use GLSL (OpenGL Shading Language), which does not support traditional complex data structures such as binary trees and vectors. Therefore, to enable the InterfaceGrid model data to be transmitted to the GPU for efficient processing, it is necessary to convert the explicit storage method that originally relied on the binary tree structure to 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 and fragment shaders. As can be seen above, InterfaceGridBlock is expressed using 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, and transfer InterfaceGridBlock data, which is the implicit storage method of InterfaceGrid, to the GPU through textures for volume rendering. In the texture management strategy, we use four two-dimensional textures: xyGridTexture as the first texture, interfacesZDataTexture as the second texture, interfacesInfoTexture as the third texture, and interfacesUpDownTexture as the fourth texture, which correspond to the data arrays 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 resolution of the model grid is 128×128, the width and height of xyGridTexture are both 128. In this way, the texture units correspond one-to-one to the unit columns of the model, and the unit columns are stored in row-priority order, using the R and G components of RGBA to represent them.<interfaceNum,dataPos> In the interfacesZDataTexture data texture, the four RGBA components store the height values z1, z2, z3, and z4 of the four vertices of the interface respectively; for the interfacesInfoTexture texture, it saves the in-order sequence information of the binary tree and uses the R and G channels to fill it respectively; the test shows that using only the R channel is not enough to meet the needs; finally, in the interfacesUpDownTexture texture, the R component represents the "up" attribute of the patch, and the G component represents the "down" attribute. Figure 9 As shown; then pass in the resolution, starting point coordinates and other information of the InterfaceGrid model, and combine it with the four texture information mentioned above to complete the volume visualization of the model in the GPU through the ray casting algorithm.
[0090] like Figure 1 As shown in 13, according to the implicit storage texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain transformed vertex coordinates, wherein the vertex coordinates include the texture coordinates, normals, and texture coordinates, including:
[0091] 131. Extract the vertex data of the texture from the implicit storage texture set;
[0092] 132. According to the vertex data, the vertex shader converts the vertex coordinates from the model space to the clip space to obtain the transformed vertex coordinates.
[0093] In an embodiment of the present invention, volume rendering can be performed through a volume texture; the volume texture is not the model data of the space, and the space volume model (usually a regular cube or cylinder) and the volume texture are combined with each other to perform volume rendering; for example, if we want to see a texture mapping effect on the computer, then at least a two-dimensional texture and a patch are required to perform the texture mapping operation; this patch is actually the carrier of the texture; similarly, in volume rendering, a three-dimensional model (usually a cube or cylinder) is also required as the carrier of the volume texture. The volume texture is corresponded to the model through texture coordinates (three-dimensional), and then a ray is drawn from the viewpoint to the point on the model. The ray passing through the model space is equivalent to the ray passing through the volume texture; usually used An ordinary cube or cylinder is used as a spatial model for volume rendering; this application uses a cube as a carrier for volume texture; in GPU programming, the vertex shader is mainly responsible for managing vertex data to ensure the final position of the vertex on the screen, and based on the ray casting algorithm, a cube data is required as a volume texture object. The cube information is shown in the figure, which includes the cube's coordinates (aPos), normals (aNormal), and texture coordinates. The vertex coordinates of the cube are converted from model space to clip space by transforming the coordinates to ensure that the vertex coordinates are correctly mapped to the 3D view, and the coordinates (EntryPoint) and normals (Normal) are passed to the fragment shader. These data will be used for ray casting and lighting calculations; such as Figure 10 shown.
[0094] like Figure 1 As shown in 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 technology, including:
[0095] 141. Using the fragment shader to calculate the three-dimensional texture coordinates for texture sampling, the transformed vertex coordinates are obtained;
[0096] 142. According to 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 to obtain the sampling result;
[0097] 143. According to the sampling result, the implicit storage information required for the current segment is extracted.
[0098] In an embodiment of the present invention, a fragment shader receives coordinates (usually the three-dimensional space coordinates of the vertex) and normal information passed from a 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 the texture space and are used to obtain data from the implicitly stored texture set. Accurate three-dimensional texture coordinates are the basis of texture sampling, ensuring that the implicitly stored information can be extracted from the correct position. According to the calculated three-dimensional texture coordinates, the fragment shader performs texture sampling operations on the implicitly stored texture set. The implicitly stored texture set contains implicit representation data of the InterfaceGrid model. These data are organized through structures such as one-dimensional arrays for efficient transmission and processing in the GPU. Texture sampling technology extracts data at corresponding positions from the implicitly stored texture set based on the three-dimensional texture coordinates. Through texture sampling, the fragment shader can quickly access the implicitly stored information required for the current fragment, such as the elevation and attributes of the geological interface. This method The method utilizes the parallel processing capability of the GPU, 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 result, which may include the elevation value of the geological interface, attribute information (such as lithology, density, etc.) and other visualization-related data. The extracted implicit storage information provides key 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 position; the entire process combines the parallel computing capability of the GPU and texture sampling technology to achieve efficient volume visualization of the InterfaceGrid model, which 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 draw the internal structure and attribute characteristics of the geological model, providing strong support for research in the fields of geological exploration, reservoir simulation, etc.
[0099] like Figure 1 As shown in FIG15 , according to the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model body is rendered, and the attributes of the InterfaceGrid mesh model at the current sampling point are found, including:
[0100] 151. According to the implicit storage information corresponding to the current fragment, use the inverse matrix to transform the camera observation point to the model coordinate system and calculate the ray direction from the observation point to the texture vertex;
[0101] 152. According to the direction of the ray, the sampling point is gradually moved in the loop, and sampling is performed along the ray path to obtain the sampling result;
[0102] 153. Calculate the spatial coordinates of the current sampling point based on the sampling results;
[0103] 154. According to the spatial coordinates of the sampling points, the attribute values are obtained using the tree-like binary sampling function.
[0104] In an embodiment of the present invention, ray casting is a direct volume rendering process, in which a viewpoint emits rays toward a three-dimensional data volume to calculate and accumulate the color and transparency of the ray path, thereby generating a final image. The ray casting algorithm flow is as follows: First, calculate the ray direction: calculate the inverse matrix of the model to transform the observation point from the world coordinate system to the model coordinate system, use the position of the camera observation point in the model coordinate system to calculate the ray direction from the observation point to the volume data entry point, which is the coordinate information of the cube passed into the vertex shader; Second, initialize the sampling parameters: initialize the starting sampling point, use 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 approach the data boundary of interest; Third, fine sampling: adjust the step size to a finer step size and reset the sampling points, 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. The coordinates need 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 area, the color and transparency are updated.
[0105] like Figure 1 As shown,154, according to the spatial coordinates of the sampling points, a tree-like binary sampling function is used to obtain the attribute value, including:
[0106] 1541. Locate the cylindrical grid and determine the grid index based on the spatial coordinates of the sampling points;
[0107] 1542. Obtain the face information and in-order sequence index of the cylinder according to the first texture;
[0108] 1543. Based on the face information and in-order sequence index of the cylinder, calculate the intermediate index, obtain the face index from the third texture, calculate the face value, and determine the up-down relationship between the point and the face to obtain the first binary search result;
[0109] 1544. Based on the result of the first binary search, reset the calculated patch index and state, and perform the binary search again to obtain the result of the second binary search.
[0110] 1545. Based on the result of the second binary search, determine whether the found point is located above or below the face, and obtain the corresponding attribute value from the fifth array.
[0111] In an embodiment of the present invention, according to the spatial coordinates P (x, y, z) of the sampling point, the "pillar" containing the point is located, which can be understood as a spatial division structure, such as a voxel column or a similar geometric body), and the index of the pillar in the overall grid structure is determined, providing basic positioning information for subsequent steps; the pillar where the sampling point is located is quickly located, the search range is narrowed, and the sampling efficiency is improved. The grid index provides an accurate starting point for subsequent texture sampling and binary search; by accessing the first texture, the patch information and the in-order sequence index of the current pillar are obtained, the patch information describes the geometric structure inside the pillar, and the in-order sequence index is used to guide the binary search process; detailed information on the internal structure of the pillar is provided, providing the necessary geometric and topological basis for the binary search, and the in-order sequence index ensures the orderliness and efficiency of the binary search; according to the patch information and in-order sequence index of the pillar, the intermediate index is calculated, which is used to obtain the patch index from the third texture, the patch value is calculated through the patch index, and the upper and lower relationship between the sampling point and the patch is judged to obtain the first binary search. The results provide a basis for subsequent searches; binary search quickly narrows the search range and improves search efficiency, and determining the up-and-down relationship between points and patches provides key information for subsequent precise searches; based on the results of the first binary search, the patch index and state are reset, and a binary search is performed again to obtain a more accurate second binary search result. The second binary search further narrows the search range and improves 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 up-and-down information of the found point in the patch is determined; the corresponding attribute values are obtained from the fifth array (an array that may store attribute values or related data), accurately obtaining the attribute values of the sampling points, providing key 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 uses a tree-like binary sampling function combined with texture sampling and array access technology to achieve 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 technology, it can effectively handle the attribute sampling problem of complex geological models, providing strong technical support for research in geological exploration, reservoir simulation and other fields.
[0112] like Figure 1 As shown in 16, according to the attributes of the current sampling point, the color and transparency of the sampling point are updated, and the lighting model is used for synthesis to obtain the accumulated volume rendering color, including:
[0113] 161. Get ambient light;
[0114] 162. Based on the attributes of the model at the current sampling point, calculate the dot product of the light source direction and the surface normal to obtain diffuse lighting;
[0115] 163. Based on the diffuse illumination, calculate the half-angle vector between the sight direction and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain the specular illumination;
[0116] 164. Based on the specular reflection illumination, the phenomenon that the illumination intensity decreases with increasing distance is simulated to obtain the light source attenuation;
[0117] 165. Multiply the diffuse and specular lighting by the light attenuation, and then add the influence of the ambient light to get the accumulated volume rendering color.
[0118] In an embodiment of the present invention, the diffuse light intensity and the highlight intensity are calculated using an illumination model according to the attributes of the model at the current sampling point. The illumination model takes into account factors such as the position, direction, intensity of the light source and the normal direction of the sampling point surface to simulate the lighting effect in the real world. The color and brightness information of the current sampling point under illumination are obtained, which provides a basis for subsequent color updates, enhances the realism and three-dimensionality of the visualization effect, and makes the lighting effect of the model surface more realistic. According to the illumination calculation results, the color and transparency of the current sampling point are updated. The color update may involve superimposing or mixing the illumination intensity with the original color of the sampling point to reflect the influence of the illumination on the color. The transparency update may take into account the material properties of the sampling point and the illumination. The potential impact on transparency; the color and transparency of the sampling point are updated to reflect the impact of light on the model surface; providing more realistic and accurate color values for subsequent color synthesis; based on the updated sampling point color and transparency, the color of the current sampling point is synthesized with the previous accumulated color. The synthesis process may involve algorithms such as the Alpha blending formula to ensure the accuracy and authenticity of the color synthesis. The accumulated volume rendering color is continuously updated as the sampling points are processed one by one, and finally a complete visual image is formed; through color synthesis and accumulation, the overall visualization effect of the model is gradually constructed, and the color and transparency of each sampling point are fully considered and processed, making the final visual image more realistic and delicate; in volume rendering, During the production process, the ambient lighting information is first obtained. Ambient lighting refers to light from all directions that shines evenly on the surface of an object, providing the basic color and brightness of the object, providing the basic lighting value for subsequent lighting calculations, and ensuring that the object can present a certain color and brightness even in the absence of a direct light source; according to 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, thereby determining the intensity of the diffuse lighting. Diffuse lighting is light that is evenly reflected in all directions after it hits the surface of an object. It makes the surface of the object present a uniform color and brightness; the diffuse lighting intensity of each point on the surface of the object is obtained, which provides important information for the subsequent synthesis of lighting effects. The mirror image processing technology is a kind of process of the mirror reflection method, which is a kind of process of the mirror reflection method used in the production of image processing technology. The mirror image processing technology ...Based on the mirror reflection illumination, the phenomenon that the light intensity decreases with the increase of distance is simulated. Light source attenuation refers to the phenomenon that the light intensity gradually decreases due to factors such as air absorption and scattering during the propagation of light. The light intensity value that changes with distance is obtained, which provides important data for the real simulation of the illumination effect of the light source on the surface of the object, enhances the realism and depth of the scene, and makes the distant objects show more natural color and brightness changes under the light. The diffuse light and the mirror reflection light are multiplied by the light attenuation to obtain the lighting effect after considering the light source attenuation, and the influence of the ambient light is added to obtain the final light color. The final light color is the product of the ambient light, diffuse light, and mirror reflection light. The combined reflection of reflected and specular lighting yields the final illumination color of each point on the object's surface, providing accurate data for color synthesis during volume rendering, enhancing the realism and three-dimensionality of the object's surface and making the object appear more natural and realistic in color and brightness. The illumination model simulates the interaction between natural light and the object's surface, and calculates the lighting effect and adds it to the accumulated volume rendering color to obtain 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 FIG18 , according to the accumulated volume rendering colors, the volume visualization of the InterfaceGrid model is output to the screen, including:
[0120] 181. According to the accumulated volume rendering color, assign the color to the output color variable of the fragment shader;
[0121] 182. Processing the transparency of the color according to the accumulated volume rendering color to obtain a processing result;
[0122] 183. Based on the processing result and the color variable, the rendering pipeline will use the color value for blending, depth testing, and writing to the frame buffer to obtain the fragment shader that ends execution;
[0123] 184. According to the fragment shader that has been executed, it is output to the screen to complete the volume visualization of the InterfaceGrid model.
[0124] In an embodiment of the present invention, the calculated final color is assigned to the output color variable of the fragment shader. This output color variable is a bridge for transmitting color information between the fragment shader and the rendering pipeline; it ensures that the calculated final color can be correctly passed to the rendering pipeline, providing a basis for subsequent color processing and output; according to the calculated final color, its transparency (Alpha value) is processed, and the transparency processing may include adjusting the transparency range, applying a transparency blending mode, etc., to ensure that the color can be correctly mixed with the background or other objects during rendering, and the processed color has a transparency that is more suitable for the processing requirements of the rendering pipeline, thereby enhancing the realism and layering of the visualization effect, so that transparent objects can be correctly mixed with the background or other objects; the rendering pipeline performs color mixing and depth measurement according to the processing results and color variables. The color mixing refers to mixing the color of the current fragment with the existing color in the frame buffer to obtain the final color value. The depth test refers to comparing the depth value of the current fragment with the depth value of the existing fragment in the frame buffer to decide whether to write the current fragment into the frame buffer. After the processing is completed, the final color value is written into the frame buffer. The final color value after processing by the rendering pipeline is obtained and correctly written into the frame buffer, ensuring the correctness and accuracy of the visualization effect, so that the object can be correctly presented on the screen. According to the fragment shader that has been executed, the color value in the frame buffer is output to the screen, completing the volume visualization of the InterfaceGrid model. The user can see the realistic three-dimensional model effect on the screen, which enhances the user's understanding and perception of the model and provides an intuitive and visual tool for research in the fields of 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, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.< / featureid> < / infoindex> < / featureid> < / infoindex>
Claims
1. A ray casting volume rendering method for an InterfaceGrid mesh model, characterized in that: include: Convert the InterfaceGrid grid model from explicit storage to the implicit storage structure of InterfaceGridBlock to obtain implicit storage data, wherein the implicit storage structure of InterfaceGridBlock includes five arrays; The implicit storage data is transferred to the GPU and stored partially to obtain an implicit storage texture set; According to the implicit storage texture set, using a vertex shader to transform the vertex coordinates of the texture to obtain transformed vertex coordinates, the vertex coordinates including the texture coordinates, normal, and texture coordinates; The transformed vertex coordinates are transferred 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 technology; Based on the implicit storage information corresponding to the current fragment, the InterfaceGrid mesh model is rendered and the attributes of the InterfaceGrid mesh model at the current sampling point are found. According to the properties of the current sampling point, the color and transparency of the sampling point are updated, and the lighting model is used for synthesis to obtain the accumulated volume rendering color; According to the accumulated volume rendering color, it is output to the screen to complete the volume visualization of the InterfaceGrid model.
2. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 1, characterized in that: The implicit storage data is transferred to the GPU and partially stored to obtain an implicit storage texture set, including: Extract the first array of implicitly stored data, and store the cylinder unit data of the first array into the RG channel of the first texture of the GPU in a row-first manner to obtain a filled first texture; Extract the vertex height values of the second array according to the implicit storage data and store them in the RGBA channel of the second texture of the GPU to obtain the filled second texture; According to the implicit storage data, the in-order sequence information of the third array is extracted and stored in the RG channel of the third texture of the GPU to obtain the filled third texture According to the implicit storage data, the upper and lower attributes of the fifth array are extracted and stored in the RG channel of the fourth texture of the GPU to obtain the filled fourth texture; Bind the four filled textures to the GPU rendering pipeline to form an implicit storage texture set.
3. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 2, characterized in that: According to the implicit storage texture set, the vertex coordinates of the texture are transformed using a vertex shader to obtain transformed vertex coordinates, where the vertex coordinates include the texture coordinates, normals, and texture coordinates, including: Extract the vertex data of the texture from the implicit storage texture set; According to the vertex data, the vertex shader converts the vertex coordinates from model space to clip space to obtain the transformed vertex coordinates.
4. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 3, characterized in that: The transformed vertex coordinates are transferred 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 technology, including: The transformed vertex coordinates are used to calculate the three-dimensional texture coordinates for texture sampling using a fragment shader to obtain the three-dimensional texture coordinates; According to 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 to obtain the sampling result; According to the sampling results, the implicit storage information required for the current fragment is extracted.
5. The ray casting volume rendering method for 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 rendered and the properties of the InterfaceGrid mesh model at the current sampling point are found, including: According to the implicit storage information corresponding to the current fragment, the camera observation point is transformed into the model coordinate system using the inverse matrix, and the ray direction from the observation point to the texture vertex is calculated; According to the direction of the ray, the sampling point is gradually moved in the loop, and sampling is performed along the ray path to obtain the sampling result; According to the sampling results, calculate the spatial coordinates of the current sampling point; According to the spatial coordinates of the sampling points, the attribute values are obtained using a tree-like binary sampling function.
6. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 5, characterized in that: According to the spatial coordinates of the sampling points, the attribute values are obtained using a tree-like binary sampling function, including: According to the spatial coordinates of the sampling points, the cylindrical grid is located and the grid index is determined; According to the first texture, obtain the face information and in-order sequence index of the cylinder; Based on the face information and in-order sequence index of the cylinder, the intermediate index is calculated, the face index is obtained from the third texture, and the face value is calculated to determine the upper and lower relationship between the point and the face to obtain the first binary search result; Based on the result of the first binary search, reset the calculated patch index and state, and perform the binary search again to obtain the result of the second binary search; Based on the result of the second binary search, determine whether the found point is located above or below the patch, and obtain the corresponding attribute value from the fifth array.
7. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 6, characterized in that: According to the properties of the current sampling point, the color and transparency of the sampling point are updated, and the lighting model is used for synthesis to obtain the accumulated volume rendering color, including: Get ambient lighting; Based on the properties of the model at the current sampling point, the dot product of the light source direction and the surface normal is calculated to obtain diffuse lighting; Based on the diffuse lighting, calculate the half-angle vector between the view direction and the light source direction, and calculate the dot product of the half-angle vector and the normal to obtain the specular lighting; Based on the specular reflection illumination, the phenomenon that the light intensity decreases with increasing distance is simulated to obtain the light source attenuation; Multiply the diffuse and specular lighting by the lighting attenuation, and then add the effect of the ambient lighting to get the accumulated volume rendering color.
8. The ray casting volume rendering method for InterfaceGrid mesh model according to claim 7, characterized in that: Based on the accumulated volume rendering colors, the colors are output to the screen to complete the volume visualization of the InterfaceGrid model, including: According to the accumulated volume rendering color, the color is assigned to the output color variable of the fragment shader; According to the accumulated volume rendering color, the transparency of the color is processed to obtain a processing result; Based on the processing result and the color variable, the rendering pipeline will use the color value for blending, depth testing, and writing to the frame buffer to get the fragment shader that ends execution; According to the fragment shader that has been executed, it is output to the screen to complete 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
Gridding representation method and system for three-dimensional geologic structure model
CN118097055A
Non-uniform cuboid grid adaptive sampling volume drawing method based on GPU acceleration
CN119047261A
Systems and methods for a visual interface for grid-based programs
US20200184149A1
Real-time rendering of image content generated using implicit rendering
WO2023228211A1