A method and apparatus for accelerating volume rendering of sparse scalar field data
Patent Information
- Application Number
- CN202311332538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-10-16
AI Technical Summary
然而,对于非空数据块中的空白体素处理的体绘制加速,该方案并未提出任何有效的解决手段
[0028](1)本发明通过引入非空数据块中的深度体素和深度信息,将所述深度信息存储于深度体素中,采用二维数字差分分析法对非空数据块中的深度信息进行采样。根据采样得到的深度信息和视线深度的大小关系跳过非空数据块中的空白体素,相较于传统的体绘制方法只能跳过空白数据块,本发明提出的方法和装置能够实现非空数据块中空白体素的块内跳过,明显提升稀疏标量场数据的体绘制性能,节约计算资源,极大程度上加快了计算速度;
Smart Images

Figure CN117496024B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image data processing and visualization, and specifically relates to a method and apparatus for accelerating volume rendering of sparse scalar field data. Background Technology
[0002] In fields such as biomedical imaging, scientific simulation, and meteorological satellite monitoring, three-dimensional scalar field data is commonly used to store domain data. Examples include image data generated from CT and MRI imaging, velocity / pressure data generated from fluid simulations, and temperature / pressure data collected by meteorological satellites. This data needs to be visualized through volume rendering to reveal its implicit three-dimensional structural features and spatial relationships, such as the spatial relationship between tumors and blood vessels. This allows domain experts to intuitively examine the data, quickly extracting valuable information and providing a reliable basis for scientific decision-making.
[0003] Three-dimensional scalar field data is generally composed of voxels; for example, a scalar field of size 1024×1024×1024 contains 1073741824 voxels. With the improvement of imaging equipment precision and the development of high-performance computers, the amount of scalar field data obtained through imaging or simulation is constantly increasing, placing higher demands on real-time, interactive volume rendering of scalar field data. There is an urgent need to accelerate traditional volume rendering methods to enhance their visualization responsiveness and usability. Skipping blank regions in sparse scalar field data is a popular method for accelerating volume rendering; however, existing methods can only skip blank data blocks after volume data is divided into blocks (i.e., skipping the entire block), but cannot skip blank voxels within non-empty data blocks (i.e., skipping within blocks). Therefore, the efficiency of volume rendering remains limited.
[0004] Chinese patent document CN109829970A discloses a method for parallel volume rendering of massive data based on unequal-sized blocks, including the following steps: 1) establishing adjacency relationships between unequal-sized blocks; 2) drawing a global occlusion relationship graph of non-empty blocks in a 3D scalar field; 3) performing topological sorting on the drawn global occlusion relationship graph to obtain a parallel grouping queue of non-empty blocks in the 3D scalar field; 4) sequentially performing parallel volume rendering on the non-empty blocks of each parallel group in the parallel grouping queue to obtain the parallel volume rendering result of the 3D scalar field data; 5) determining whether the volume rendering process has ended. If it has ended, the parallel volume rendering result of the current 3D scalar field data is output; if it has not ended, step 2) is resumed, and the global occlusion relationship graph of the non-empty blocks is redrawn until a new parallel volume rendering result of the 3D scalar field data is obtained. Although the above scheme improves the rendering efficiency of volume rendering to some extent by parallel processing of non-empty blocks in a 3D scalar field, it does not reveal any effective solutions for accelerating volume rendering of blank voxels in non-empty data blocks.
[0005] Chinese patent document CN103413345A discloses a GPU-based method for accelerating the determination of 3D spatial interaction points. This method first saves the original data to a texture cache. If the original data is a continuously changing scalar field, the first opaque point during direct volume rendering ray tracing is collected as a 3D interaction candidate point and stored in the texture cache. If the original data is a discontinuously changing scalar field, the point with the highest opacity during direct volume rendering ray tracing is collected as a 3D interaction candidate point and stored in the texture cache. The 3D interaction candidate point is retrieved based on screen coordinates to obtain the data value of the corresponding 3D spatial interaction point in the texture cache. This invention solves the problem of real-time mapping from 2D input to 3D visualization space, improving the effectiveness and efficiency of 3D spatial interaction point determination in visualization results. The purpose of the above solution is to solve the problem of real-time mapping from 2D input to 3D visualization space and eliminate mapping errors between 2D input and 3D scene. However, this solution does not propose any effective solutions for accelerating volume rendering by processing blank voxels in non-empty data blocks. Summary of the Invention
[0006] In view of the above, the purpose of the present invention is to provide a method and apparatus for accelerating volume rendering of sparse scalar field data, which can not only effectively skip blank data blocks after volume data is divided, but also identify and skip blank voxels in non-empty data blocks, thereby enabling fast volume rendering of sparse scalar field data.
[0007] To achieve the above-mentioned objectives, the present invention provides the following technical solution:
[0008] In a first aspect, the present invention provides a method for accelerating volume rendering of sparse scalar field data, comprising the following steps:
[0009] Step 1: Divide the scalar field into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. Based on the partitioning results, construct a tree structure to index the non-empty data blocks.
[0010] Step 2: Aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory. Add a first voxel layer around the non-empty data blocks to record the scalar values of the adjacent voxels of the corresponding non-empty data blocks in the scalar field. Add a depth voxel layer around the first voxel to record the depth information of the corresponding non-empty data blocks.
[0011] Step 3: At a specific viewpoint, a line of sight is generated for each pixel on the screen. The hierarchical three-dimensional digital difference analysis method is used to skip blank data blocks along the direction of the line of sight. The depth information is sampled along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, the blank voxels in the non-empty data block are skipped, and the non-empty voxels are volume drawn.
[0012] The technical concept of this invention is as follows: A scalar field is divided into blocks and labeled to obtain blank data blocks and non-empty data blocks. A tree structure is established for the non-empty data blocks, and the non-empty data blocks in the leaf nodes of the tree structure are aggregated into video memory. To ensure data continuity when sampling using trilinear interpolation, this invention adds a first voxel layer around the aggregated non-empty data blocks to store the scalar values of adjacent voxels.
[0013] Furthermore, to skip blank voxels in non-empty data blocks, this invention introduces the concepts of depth voxels and depth information. A depth voxel is a voxel unit attached to the periphery of the first voxel to record depth information. The depth information refers to the distance traveled within a non-empty data block, starting from the first voxel on the boundary surface, defining the direction from the boundary surface to the center of the data block as the depth direction, and continuing along this depth direction until the current voxel is a non-empty voxel; the distance traveled is then recorded as the depth information.
[0014] When skipping blank voxels within a non-empty data block, this invention proposes a two-dimensional digital difference analysis method to sample the depth information from nearest neighbors along the projection direction of the viewpoint onto the boundary surface of the depth voxels. The number of voxels corresponding to the projection of the viewpoint onto the depth direction is defined as the viewpoint depth. By comparing the sampled depth information with the viewpoint depth, blank voxels in the non-empty data block are skipped, thus achieving intra-block skipping and significantly reducing the computational load of volume rendering.
[0015] Preferably, in step 1, the method for dividing the scalar field into blank data blocks and non-empty data blocks is as follows: the scalar field is divided into multiple data blocks, the scalar values of the data blocks are reduced using a reduction function to obtain reduced values, and compared with a human-given threshold. If the reduced value is less than the threshold, the data block is marked as a blank data block; otherwise, it is marked as a non-empty data block.
[0016] Preferably, in step 1, the tree structure is a spatially sparse tree structure, using a three-dimensional axially aligned bounding box tree that is most suitable for the application scenario of this invention.
[0017] Preferably, in step 2, the video memory includes a three-dimensional texture memory, with two fixed directions and another direction designated as the growth direction. When the non-empty data blocks to be stored exceed the existing capacity of the three-dimensional texture memory, expansion is only performed in the growth direction.
[0018] Preferably, in step 2, the depth voxels correspond one-to-one with the voxels on the boundary surface of the non-empty data block in three-dimensional space, and the direction perpendicular to the boundary surface and pointing into the non-empty data block is defined as the depth direction.
[0019] Preferably, in step 2, the calculation process of the depth information is as follows: starting from the first voxel on the boundary surface of the non-empty data block, proceed along the depth direction until the voxel is a non-empty voxel; store the distance of the proceeding voxel as depth information in the depth voxel.
[0020] Preferably, in step 3, the sampling method is as follows: along the projection direction of the line of sight on the boundary surface of the depth voxel, the depth information is sampled from nearest neighbors using the two-dimensional digital difference analysis method to obtain the depth information.
[0021] Preferably, in step 3, the viewing depth is the number of voxels corresponding to the projection of the viewing line in the depth direction.
[0022] Preferably, in step 3, skipping blank voxels in non-empty data blocks means: if the depth information is greater than the viewing depth, skip blank voxels and continue sampling; otherwise, stop sampling and use the position of the voxel that has retreated one step as the starting point for volume drawing to ensure the accuracy of volume drawing.
[0023] Secondly, to achieve the above-mentioned objectives, the present invention also provides a volume rendering acceleration device for sparse scalar field data, comprising a tree structure construction unit, a depth information recording unit, and a volume rendering unit:
[0024] The tree structure building unit is used to divide the scalar field into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. Based on the division result, a tree structure is constructed to index the non-empty data blocks.
[0025] The depth information recording unit is used to aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory. A first voxel is added around the non-empty data block to record the scalar values of the adjacent voxels of the corresponding non-empty data block in the scalar field. A depth voxel is added around the first voxel to record the depth information of the corresponding non-empty data block.
[0026] The volume rendering unit is used to generate a line of sight for each pixel on the screen at a specific viewpoint. Along the direction of the line of sight, a hierarchical three-dimensional digital difference analysis method is used to skip blank data blocks. The depth information is sampled along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, the blank voxels in the non-empty data block are skipped, and then the volume rendering is performed on the non-empty voxels.
[0027] The beneficial effects of this invention are as follows:
[0028] (1) This invention introduces depth voxels and depth information from non-empty data blocks, stores the depth information in the depth voxels, and uses a two-dimensional digital difference analysis method to sample the depth information in the non-empty data blocks. Based on the relationship between the sampled depth information and the line-of-sight depth, blank voxels in the non-empty data blocks are skipped. Compared with traditional volume rendering methods that can only skip blank data blocks, the method and apparatus proposed in this invention can achieve intra-block skipping of blank voxels in non-empty data blocks, significantly improving the volume rendering performance of sparse scalar field data, saving computational resources, and greatly accelerating the calculation speed.
[0029] (2) Since the method and apparatus proposed in this invention can significantly improve volume rendering performance, in application scenarios that are sensitive to rendering performance, such as large screens and virtual reality, the sparse scalar field data volume rendering acceleration method proposed in this invention can enhance the real-time performance and usability of data visualization. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a flowchart of a volume rendering acceleration method for sparse scalar field data provided in an embodiment of the present invention.
[0032] Figure 2 This is a schematic diagram of the non-empty data block data processing process provided in an embodiment of the present invention, wherein (a) represents the tree structure of the non-empty data block, (b) represents the distribution of the non-empty data block in the video memory, and (c) represents a schematic diagram of the data distribution of the non-empty data block corresponding to a single leaf node in the video memory.
[0033] Figure 3 This is a schematic diagram of the depth information recording results provided in an embodiment of the present invention.
[0034] Figure 4 This is a flowchart provided by an embodiment of the present invention, in which blank data blocks are skipped entirely and all non-empty data blocks are traversed. In this flowchart, (a), (b), and (c) represent the flowcharts of the line of sight entering the first, second, and third layers of the tree structure; and (d), (e), and (f) represent the flowcharts of the line of sight and blank data blocks being popped from the third, second, and first layers.
[0035] Figure 5This is a flowchart of skipping blank voxels in a non-empty data block provided in an embodiment of the present invention, wherein (a) represents an overall schematic diagram of the non-empty data block, (b) represents a voxel distribution diagram in the non-empty data block, and (c) represents a flowchart of skipping blank voxels in the non-empty data block.
[0036] Figure 6 This is a volume rendering effect diagram provided in an embodiment of the present invention.
[0037] Figure 7 This is a schematic diagram of the structure of the volume rendering acceleration device for sparse scalar field data provided in an embodiment of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of this invention.
[0039] like Figure 1 As shown in the embodiment, a method for accelerating volume rendering of sparse scalar field data is provided, including the following steps:
[0040] S110, the scalar field is divided into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. A tree structure for indexing the non-empty data blocks is constructed based on the division results.
[0041] In this embodiment, for a three-dimensional scalar field f:R of size w×h×d 3 →R, divide the data into blocks of size B×B×B, where B is the size of the data block, and the length, width, and height of the data block are the same. The resulting partition... One data block.
[0042] Through a reduction function f reduce :M B×B×B →R takes data M in each data block as an example. B×B×B The reduction is performed. In this embodiment, a maximum value reduction function is used, and the reduced value is represented as max(M). B×B×B The data block's reduction value is compared with a user-given threshold. If the reduction value is less than the threshold, the data block is marked as a blank data block; otherwise, it is marked as a non-empty data block.
[0043] Furthermore, according to the given configuration<N1,N2,N3> Generate a three-dimensional axis-aligned bounding-box (AABB) tree for all non-empty data blocks. Here, N1 specifies the number of branches in the first level, i.e., the number of branches in the first level (from root to leaves). N2 specifies the number of branches in the second level, i.e., the number of branches in the second level. N3 specifies the number of branches in the third level, i.e., the number of branches in the third level. There are 1 branch; in each layer, the number of child nodes in each dimension is the same; the third layer is the last layer, and its child nodes are non-empty data blocks.
[0044] like Figure 2 As shown in (a), an AABB tree configured as <1,1,3> is constructed for 9 non-empty data blocks (represented using solid cubes), where the non-empty nodes of the first, second, and third levels are represented by cubes with orange, green, and blue borders, respectively.
[0045] S120, aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory, add a first voxel around the non-empty data blocks to record the scalar values of the adjacent voxels of the corresponding non-empty data blocks in the scalar field, and add a depth voxel around the first voxel to record the depth information of the corresponding non-empty data blocks.
[0046] Volume rendering using a GPU requires transferring the data of a 3D scalar field to video memory. To conserve video memory, only non-empty data blocks are stored during rendering. This embodiment creates a 3D texture memory block in the GPU, fixing two directions and designating the third direction as the growth direction. When the amount of data to be stored exceeds the existing texture memory capacity, this method fixes the two directions and expands the memory in the growth direction. Figure 2 As shown in (b), nine non-empty data blocks are packed into the three-dimensional texture memory, and the positive directions of the X and Y axes are specified as fixed directions, while the positive direction of the Z axis is the growth direction.
[0047] When sampling 3D textures using trilinear interpolation, since the sampling point is not necessarily located at the exact center of the voxel, the trilinear interpolation method will sample the contents of adjacent voxels in the video memory. Therefore, when packing non-empty data blocks, a first voxel layer needs to be added around the original non-empty data block to record the scalar values of adjacent voxels in the scalar field for the corresponding non-empty data block. Figure 2 As shown in (c), the original non-empty data block (yellow square) is surrounded by a first voxel (gray square).
[0048] Furthermore, skipping blank voxels within non-empty data blocks requires recording the depth information of each boundary surface. In video memory, the depth information is stored in the depth voxels surrounding the first voxel. For example... Figure 2 As shown in (c), the first voxel (gray square) is surrounded by a layer of depth voxels (black squares) that record depth information, and the white squares are unused voxels.
[0049] A depth voxel is defined as follows: In a non-empty data block of GPU memory, there exists a voxel with the smallest memory address, denoted as Vox0. Taking Vox0 as the origin, the position of each voxel in the non-empty data block of GPU memory can be represented by (x, y, z), where x, y, and z all range from [0, B+4), and B is the width of the data block. A voxel in a non-empty data block is defined as having exactly one component of (x, y, z) that is 0 or B+3, and all other components within the range [2, B+1].
[0050] The calculation process for depth information is as follows:
[0051] (1) For each depth voxel, identify its boundary surface. A data block has 6 boundary surfaces, and the boundary surface can be determined by the position of the depth voxel relative to the center of the data block.
[0052] (2) The direction perpendicular to the boundary surface and pointing into the data block is taken as the depth direction.
[0053] (3) Starting from the first voxel in the depth direction, move forward along the depth direction until the voxel is a non-empty voxel. The distance of the voxel moved forward is used as depth information and stored in the corresponding depth voxel.
[0054] The above steps are executed in parallel for each depth voxel and can be completed in real time. Figure 3 This diagram illustrates the depth information recording results provided in this embodiment.
[0055] S130: At a specific viewpoint, a line of sight is generated for each pixel on the screen. The hierarchical three-dimensional digital difference analysis method is used to skip blank data blocks along the direction of the line of sight. The depth information is sampled along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, the blank voxels in the non-empty data block are skipped, and the non-empty voxels are volume drawn.
[0056] In this embodiment, when performing direct volume rendering, obtaining the color value of a pixel px requires generating a line of sight R based on the current viewing position o, orientation d, and screen resolution res. px,o,d,res Through R px,o,d,res The path represented by f:R 3 →R is sampled and integrated to obtain the color value C displayed by px. Since f:R 3 → Blank data blocks in R do not contribute to c. Avoiding sampling blank data blocks can speed up volume rendering.
[0057] Hierarchical 3D Digital Differential Analyzer (H-3D-DDA) can be used to quickly traverse R... px,o,d,res The algorithm traverses all data blocks and skips blank data blocks. The main flow of the H-3D-DDA algorithm is as follows:
[0058] (1) Solve for line of sight R px,o,d,res Intersection relation with data blocks (t) enter,n-1 , t exit,n-1 ), where t enter,n-1 For line of sight R px,o,d,res The time step (t) to enter the data block exit,n-1 For R px,o,d,res The time step away from the data block, where n represents the height of the AABB tree. If they intersect, i.e., t... enter,n-1 <t exit,n-1 Let i := n-1, where := means "assign a value", i represents the height of the current level (counting from 0), and t := t enter,i , will t exit,i and containing position p i = o+td's child nodes are pushed onto the stack, p i This indicates the current position of the line of sight. Otherwise, stop the algorithm.
[0059] (2) If the acceleration in the non-empty data block of the current node index is a blank voxel, find the distance p in the d direction at level i. i The most recent next node, changing t makes the new p i Located in this node. Repeat the above operation until the voxels in the non-empty data block of the node index are not empty, or t ≥ t. exit,i If the voxels in the non-empty data block of the node index are not empty, then t exit,i Push the node onto the stack, let i := i-1, and proceed to process (3). If the corresponding voxel is a blank voxel but t≥t exit,i Proceed to process (4).
[0060] (3) If i > 0, execute process (2). If i = 0, then perform intra-block skipping and volume drawing of blank voxels in the non-empty data block. After performing intra-block skipping and volume drawing for nodes with i = 0, let i := i + 1, and find the distance p in the d direction. i The most recent next node, changing t makes the new p i At this node, continue executing process (2).
[0061] (4) Pop the stack and set i:=i+1. If i=n, stop the algorithm; otherwise, continue executing process (2).
[0062] Specific examples are as follows:
[0063] like Figure 4 As shown in (a), H-3D-DDA first obtains (t) enter,2 , t exit,2 Because t enter,2 <t exit,2 Therefore, let t = t enter,2 , will t exit,2 Push the child node containing position p2 = o + td onto the stack, and let i := n - 1.
[0064] like Figure 4 As shown in (b), since the non-empty data block indexed by the current node is a blank voxel, the next node closest to p1 in the d direction at level i=1 is found, and t is changed. exit,1 This allows the new p1 to reside in this node. Since the second node is not empty, t... exit,1 Push the node onto the stack, and let i := i-1=0.
[0065] like Figure 4 As shown in (c), since i = 0, the intra-block skipping and volume drawing of blank voxels in the non-empty data block of the current node index is performed.
[0066] like Figure 4 As shown in (d), to be Figure 4 (c) After the operation is complete, pop the stack and let i := i+1 = 1. Find the next node that is closest to p1 in the d direction and change t. exit,1 This allows the new p1 to reside in this node.
[0067] like Figure 4 As shown in (e), because t≥t exit,1 Therefore, pop the stack and let i := i+1=2.
[0068] like Figure 4 As shown in (f), because t≥t exit,2 Therefore, pop the stack and let i := i+1 = 3. Since i > n = 2, stop the algorithm.
[0069] Before rendering the volume of non-empty data blocks, the depth information of the non-empty data blocks in video memory is sampled using 2D Digital Differential Analyzer (2D-DDA). By comparing the depth information with the view depth, blank voxels in the non-empty data blocks are skipped. The main process of the 2D-DDA algorithm is as follows:
[0070] (1) Solve for line of sight R px,o,d,res The time step t of the intersection with the leaf node enterThat is, the two intersect at position p. intersect =o+t enter d. Compare with p intersect The three components are defined as follows: the direction perpendicular to the boundary surface is defined as the depth direction; the projection of the viewpoint onto the depth direction is defined as the viewpoint depth, with a length of d. Let p... intersect The two components on the boundary surface are (u, v). Projecting the line of sight into the (u, v) plane yields the projection direction. Let t = t enter .
[0071] (2) Depth information d along the projection direction sample Perform sampling. If d sample >(tt enter )*d, in the plane containing (u, v), find the nearest next voxel along the projection direction, change t so that the new (u, v) is located in this voxel, and return to the beginning of process (2) to continue execution. If d sample ≤(tt enter )*d, proceed to process (3). If t≥t exit,0 Proceed to process (4).
[0072] (3) Return the previous t as the actual starting point for volume drawing.
[0073] (4) Determine R px,o,d,res If there is no intersection with this data block, skip the volume drawing of this block.
[0074] Specific examples are as follows:
[0075] like Figure 5 As shown in (a), it is necessary to process the non-empty data blocks (yellow squares) at t enter,0 and t exit,0 Perform volume drawing between the elements. For example... Figure 5 As shown in (b), although the data block contains only some non-empty voxels (yellow squares), the traditional method will still find them in t. enter,0 and t exit,0 Sampling is performed between them.
[0076] like Figure 5 As shown in (c), t is obtained by 2D-DDA. enter,0 The depth of the line of sight is defined as the component perpendicular to the boundary surface, and its direction is defined as the depth direction. The line of sight is projected onto the boundary surface containing the depth voxel to obtain the projection direction. Let t = t enter,0。
[0077] The first depth information d is obtained by sampling along the projection direction using two-dimensional digital difference analysis. sample =6. Because d sample >(tt enterIf d = 0, find the next voxel that is closest to (u, v) in the projection direction within the plane containing (u, v), and change t so that the new (u, v) is located in this voxel.
[0078] Continue sampling at the second depth d sample =6. Because d sample >(tt enter )*d=3, find the next voxel that is closest to (u,v) in the projection direction within the plane containing (u,v), and change t so that the new (u,v) is located in this voxel.
[0079] Continue sampling at the third depth d sample =4. Because d sample ≤(tt enter )*d=6, take the previous time t=t new The corresponding voxel position serves as the actual starting point for volume rendering. Compared to traditional methods, 2D-DDA reduces the amount of data rendered in this example. new -t enter,0 The sampling step size (red dashed line), such as Figure 5 As shown in (c), the efficiency of volume rendering has been improved.
[0080] Non-empty voxels within non-empty data blocks are drawn using direct volume rendering and other volume rendering algorithms. (Processing R...) px,o,d,res After processing all non-empty data blocks, the color value of the pixel (px) is obtained. The drawing result of the direct volume rendering method is as follows: Figure 6 As shown.
[0081] In actual rendering, to highlight specific parts of the scalar field, the contribution of some non-empty voxels to the rendering result is set to 0. For example, in direct volume rendering, by adjusting the zero opacity range of the transfer function, the contribution of voxels with scalar values within a certain range to the rendering result can be eliminated. For voxels with scalar values within this range, they are set as blank voxels within the block, allowing 2D-DDA to skip them, which can further accelerate volume rendering. The above requirement can be achieved by dynamically updating the depth information of the data block; the specific process is described in the section on constructing depth information in S120. Since this process can be performed in real time, dynamic depth updates can also be performed in real time.
[0082] Based on the same inventive concept, embodiments of the present invention also provide a volume rendering acceleration device 500 for sparse scalar field data, such as... Figure 7 As shown, it includes a tree structure construction unit 510, a depth information recording unit 520, and a volume rendering unit 530;
[0083] The tree structure construction unit 510 is used to divide the scalar field into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. Based on the division result, a tree structure is constructed to index the non-empty data blocks.
[0084] The depth information recording unit 520 is used to aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory. A first voxel is added around the non-empty data block to record the scalar values of the adjacent voxels of the corresponding non-empty data block in the scalar field. A depth voxel is added around the first voxel to record the depth information of the corresponding non-empty data block.
[0085] The volume rendering unit 530 is used to generate a line of sight per pixel on the screen at a specific viewpoint. Along the direction of the line of sight, it skips blank data blocks using a hierarchical three-dimensional digital difference analysis method. It samples the depth information along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, it skips blank voxels in the non-empty data block and then performs volume rendering on the non-empty voxels.
[0086] It should be noted that the volume rendering acceleration device for sparse scalar field data and the volume rendering acceleration method for sparse scalar field data provided in the above embodiments belong to the same concept. For details of its specific implementation process, please refer to the volume rendering acceleration method for sparse scalar field data, which will not be repeated here.
[0087] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Although the implementation process of the present invention has been described in detail above, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for accelerating volume rendering of sparse scalar field data, characterized in that, Includes the following steps: Step 1: Divide the scalar field into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. Based on the partitioning results, construct a tree structure to index the non-empty data blocks. Step 2: Aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory. Add a first voxel layer around the non-empty data blocks to record the scalar values of the adjacent voxels of the corresponding non-empty data blocks in the scalar field. Add a depth voxel layer around the first voxel to record the depth information of the corresponding non-empty data blocks. The calculation process of the depth information is as follows: starting from the first voxel on the boundary surface of the non-empty data block, move forward along the depth direction until the voxel is a non-empty voxel; store the distance of the forward voxel as depth information in the depth voxel; Step 3: At a specific viewpoint, a line of sight is generated for each pixel on the screen. The hierarchical three-dimensional digital difference analysis method is used to skip blank data blocks along the direction of the line of sight. The depth information is sampled along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, the blank voxels in the non-empty data block are skipped, and the non-empty voxels are drawn in volume. The method of skipping blank voxels in non-empty data blocks is as follows: if the depth information is greater than the viewing depth, skip the blank voxel and continue sampling; otherwise, stop sampling and use the position of the voxel that has been back one step as the starting point for volume drawing.
2. The method for accelerating volume rendering of sparse scalar field data according to claim 1, characterized in that, In step 1, the method for dividing the scalar field into blank data blocks and non-empty data blocks is as follows: the scalar field is divided into multiple data blocks, the scalar values of the data blocks are reduced using a reduction function to obtain reduced values, and compared with a human-given threshold. If the reduced value is less than the threshold, the data block is marked as a blank data block; otherwise, it is marked as a non-empty data block.
3. The method for accelerating volume rendering of sparse scalar field data according to claim 1, characterized in that, In step 1, the tree structure is a spatially sparse tree structure, using a three-dimensional axially aligned bounding box tree.
4. The method for accelerating volume rendering of sparse scalar field data according to claim 1, characterized in that, In step 2, the video memory adopts a three-dimensional texture memory, with two fixed directions and another direction designated as the growth direction. When the non-empty data blocks to be stored exceed the existing capacity of the three-dimensional texture memory, expansion is only performed in the growth direction.
5. The method for accelerating volume rendering of sparse scalar field data according to claim 1, characterized in that, In step 2, the depth voxels correspond one-to-one with the voxels on the boundary surface of the non-empty data block in three-dimensional space, and the direction perpendicular to the boundary surface and pointing into the non-empty data block is defined as the depth direction.
6. The method for accelerating volume rendering of sparse scalar field data according to claim 1, characterized in that, In step 3, the sampling method is as follows: along the projection direction of the line of sight on the boundary surface of the depth voxel, the depth information is sampled from nearest neighbors using the two-dimensional digital difference analysis method to obtain the depth information.
7. The method for accelerating volume rendering of sparse scalar field data according to claim 5, characterized in that, In step 3, the line-of-sight depth is the number of voxels corresponding to the projection of the line of sight in the depth direction.
8. A volume rendering acceleration device for sparse scalar field data, characterized in that, The method for accelerating volume rendering of sparse scalar field data according to any one of claims 1-7 includes a tree structure construction unit, a depth information recording unit, and a volume rendering unit. The tree structure building unit is used to divide the scalar field into blank data blocks and non-empty data blocks. The voxels in the non-empty data blocks include blank voxels and non-empty voxels. Based on the division result, a tree structure is constructed to index the non-empty data blocks. The depth information recording unit is used to aggregate the non-empty data blocks corresponding to the leaf nodes in the tree structure into the video memory. A first voxel is added around the non-empty data block to record the scalar values of the adjacent voxels of the corresponding non-empty data block in the scalar field. A depth voxel is added around the first voxel to record the depth information of the corresponding non-empty data block. The volume rendering unit is used to generate a line of sight for each pixel on the screen at a specific viewpoint. Along the direction of the line of sight, a hierarchical three-dimensional digital difference analysis method is used to skip blank data blocks. The depth information is sampled along the projection direction of the line of sight on the boundary surface of the depth voxel. By comparing the sampled depth information with the depth of the line of sight, the blank voxels in the non-empty data block are skipped, and then the volume rendering is performed on the non-empty voxels.
Citation Information
Patent Citations
Three-dimensional space interaction point determination acceleration method based on GPU
CN103413345A
Mass data parallel volume rendering method based on unequal-size partitioning
CN109829970A