Computer Graphic Report
Computer Graphic Report
Researches
University of Technology
Computer Engineering Department
Computer Graphic
رسومات الحاسوب
عل
عل سليم صاحب ي ي:اسم الطالب
فرع تـكنولـوجـيـا المعلومات/ هندسة الحاسوب:االختصاص
الثالثة:المرحلة
الصباحية:الدراسة
2020 / 7 / 6 :تاريـ ــخ التسليم
2019-2020
Summary
Everything in the life is in 3D ( referred to the volume) scene and our display devices is
working with 2D images , Thus we need something to convert 3D scenes into 2D images to
be appropriate for our display devices. In this report, we will identify to Ray Casting
rendering techniques, which achieve that goal. also we will We will get to know another
rendering techniques called Ray Tracing and we will see the deference between them.
Introduction
Firstly, we well identify the Volume rendering is the process for displaying 3D volume data
on 2D display system. It is widely used for various area such as game, animation, and
medical imaging. Especially, in medical imaging, volume rendering is used for accurate
diagnosis using 3-D volume images such as Compute Tomography (CT), and Magnetic
Resonance Imaging (MRI).
1- Direct volume rendering: The direct volume rendering generates result images by
using whole 3D volume data whereas the indirect volume rendering uses some part of
volume data to make result images
2- Indirect volume rendering: The basic principle of indirect volume rendering is to
segment and extract certain areas of interest from the volume and transform them into
polygonal models.
The deference between this types: the direct volume rendering can generate high quality
rendering images whereas the rendered images by indirect volume rendering show distorted
result. However, the direct volume rendering works slowly, while indirect volume rendering
operates relatively fast.
Ray-casting algorithm is one of the direct volume-rendering algorithm.
What is Ray casting?
Ray-casting algorithm: is a rendering technique used in computer graphics and computational
geometry. It is capable of creating a three-dimensional perspective in a two-dimensional map.
Ray-casting algorithm is directly derived from rendering equation. Fig. 1 describes the
concept of the ray casing algorithm.
The total procedure of the ray-casting algorithm consists of five steps; opacity allocation,
projection plan generation, ray-casting, sampling, and composition.
1- Opacity allocation: 3-D volume data is given, opacity values are allocated to the all
voxels. Opacity is required to visualize the translucent volume data. To arrange the
opacity, opacity transfer function is widely used. Opacity transfer function uses voxel
values to decide opacity values. In addition, edge information and structure of object
in volume data are used in advanced opacity transfer functions. The given opacity is
still used even if the volume data is rotated, until new volume data is given.
2- Projection plan generation: projection plane generation using a position of view
point.
3- Ray casting: is performed. In the ray-casting step, rays are casted at all pixels on the
projection plane.
4- Sampling: The rays extract the voxel values and opacity values of sampling points from
3-D volume data using interpolation as the rays move forward.
5- Composition: This step calculates the pixel values of the projection plane by using
sampling data as follow.
This process ensures a high quality rendering result, but it requires high computational
complexity. The high computational complexity makes the system consume a large amount
of power and operate slowly. To relieve the adverse effect of high complexity, there are two
representative methods: hardware acceleration and parallel processing.
Hardware Acceleration: is the technique that replaces some functions in software with
hardwired logic to improve processing speed and decrease the power consumption. To
accelerate the system by hardware, it is required to analyze the application to find the
functions which are called frequently and have high complexity. Replacing the functions
with hardwired logic improves processing speed and saves power.
Parallel Processing: is the technique which performs an application concurrently with a
parallel processing unit, a parallel processing unit utilizes the cores which have simple
architecture to achieve low power operation. Because of its simple architecture, a parallel
processing unit can utilize a tremendous number of cores, which makes the systems operate
at high speed with low power. To apply parallel processing to the system effectively, data
parallelism should be satisfied. Ray-casting algorithm satisfies data parallelism because the
operations for casted rays are independent. Thus, the ray casting algorithm has a suitable
architecture for exploiting parallelism. However, to construct the system for exploiting
parallelism effectively, there are several considerations:
First consideration: is memory bandwidth. In a parallel processing unit, there are a lot of
cores and they access to memory at the same time. The exploiting memory bandwidth is
essential to make the best use of computing power of parallel processing unit. A cache is
commonly used to improve memory bandwidth. A cache is a smaller and faster memory than
a main memory. In the system with a cache, the cache stores the data in nearby the accessed
address when the system accesses to the memory.
Final consideration: for effective parallel processing is occupancy. Occupancy means how
the hardware keep busy. A parallel processing unit has so many cores, however, if they does
not work, they are no more useful. Thus, to keep hardware busy is important to exploit
parallelism effectively. To achieve high occupancy, it is important to allocate the tasks to the
cores equally.
EXPERIMENTAL RESTULS
The optimization results of the ray-casting algorithm were evaluated in term of processing
time. The ray-casting algorithm was implemented on intel i5-3470 and NVIDIA GeForce
GTX 660. Fig. below shows the ray-casting result. To evaluate improvement of exploting
parallel processing, the GPU was used.
Table below shows the processing time of the original ray casting algorithm and optimized
ray-casting algorithm. By exploiting parallelism using GPU, the processing time was
improved over ten times.
Ray Tracing
(also called raytracing, ray-tracing or ray casting) is another technique for presenting three-
dimensional (3D) images on a two-dimensional (2D) display by tracing a path of light
through pixels on an image plane. But there are some deference between the two
algorithms , we will show the deference in the table below:
Ray Casting Ray Tracing
Principle: rays are cast and traced in Principle: each ray is traced separately,
groups based on some geometric so that every point (usually a pixel) on
constraints. For instance: on a 320x200 the display is traced by one ray. For
display resolution, a ray-caster traces instance: on a 320x200 display
only 320 rays (the number 320 comes resolution, a ray-tracer needs to trace
from the fact that the display has 320 320x200 (64,000) rays. (That is roughly
horizontal pixel resolution, hence 320 200 times slower than ray-casting.)
vertical column).
Formula: in most cases, inexact. Formula: in most cases, exact.
Speed: very fast compared to ray-tracing; Speed: slow; unsuitable for real time
suitable for real time process. process (at least not until we got a
500Ghz machine).
Quality: resulting image is not very Quality: resulting image is very realistic
realistic. Often, they are blocky . - sometimes too realistic.
World: limited by one or more geometric World: almost any shape can be
constraints (simple geometric shapes). rendered.
Storage: small. Rendered images are not Storage: Rendered images are stored on
stored on disk. Normally, only the map is disk and loaded when needed. Presently,
stored, and corresponding images are no hardware is fast enough for "on the
generated "on the fly." fly" rendering.
Examples: Wolfenstein 3D (iD Examples: Examples: 7th Guest
Software), Shadow Caster (Raven), Arena (Trilobyte), Critical Path (Mechadeus),
(Bethesda), Doom (iD Software), Dark 11th Hour (Trilobyte), Myst (Cyan),
Forces (LucasArts). Cyberia (Xatrix).
Conclusion
Above results show Ray casting is used for almost all applications that use rendering that
does not have to be real-time. It can produce images of higher quality than rasterization, so
if time is not an issue, then ray casting is used. In addition, it shows the effectiveness and
rapidness of parallel computation of volume rendering methods and prove that volume ray
casting is well-suited for computing on GPUS in parallel. It should be remembered that
these huge time differences only occur when comparing our CPU and GPU ray casting
versions and we are conscious of the fact that the CPU as well as the GPU version are not
yet optimized.
References
[1] J. Luo, G. Ni, P. Cui, J. Jiang, Y. Duan, and G. Hu, “Quad-Tree Atlas Ray Casting: A
GPU Based Framework for Terrain Visualization and Its Applications,” Trans. Edutainment
VIII. Springer Berlin Heidelberg, vol. 7145, pp. 74-85, 2012.
[2] C. Lundstrom, P. Ljung, A. Persson, and Anders Ynnerman, “Uncertainty Visualization
in Medical Volume Rnedering Using Probabilistic Animation,” IEEE Trans. Visualization
and Computer Graphics, vol. 13, no. 6, pp. 1648-1655, Nov. 2007.
[3] M. Borzecki, A. Skurski, M. Kaminski, A. Napieralski, J. Kasprzak, and P. Lipiec,
“Applications of Ray-Casting in Medical Imaging,” Information Technologies in
Biomedicine, vol. 3, pp. 3-14, 2014.
[4] J. Heinrich, S. Bachthaler, and D. Weiskopf, “Progressive Splatting of Continuous
Scatterplots and Parallel Coordinates,” Computer Graphics Forum, vol. 30, no. 3, pp. 653-
662, Jun. 2011.
[5] J. Kronander, D. Jonsson, J. Low, P. Ljung, A. Ynnerman, J. Unger, “Efficient Visibility
Encoding for Dynamic Illumination in Direct Volume Rendering,” IEEE Trans.
Visualization and Computer Graphics, vol. 18, no. 3, pp. 447-462, Mar. 2012.
[6] T. Ling, Q, Zhi-Yu, “An Improved Fast Ray Casting Volume Rendering Algorithm of
Medical Image,” 4th International Conf. on Biomedical Engineering and Informatics
(BMEI), vol. 1, pp. 109-112, Oct. 2011.
[7] R. W. Underberg, F. J. Lagerwaard, B. J. Slotman, J. P. Cuijpers, and S. Senan, “Use of
maximum intensity projection (MIP) for target volume generation in 4DCT scans for lung
cancer,” International Journal of Radiation Oncology, Biology Physics, vol. 63, no. 1, pp.
253-260, Sep. 2005.
[8] Andrews, D., Niehaus, D., Jidin, R., Finley, M., Peck, W., Frisbie, M., ... & Ashenden,
P, “Programming Models for Hybrid FPGA-CPU Computational Components: A Missing
Link,” IEEE Micro, vol. 24, no. 4, pp. 42-53, July-Aug. 2004
[9] Wang, H., Sathish, V., Singh, R., Schulte, M. J., and Kim, N. S. “Workload and power
budget partitioning for single-chip heterogeneous processors,” Proceedings of the 21st
international conference on Parallel arch
External links:
https://ieeexplore.ieee.org/