Documente Academic
Documente Profesional
Documente Cultură
Abstract
Three dimensional graphics processing need complex algebraic and In my work, I created an object memory which contains
matrix based calculations. Excess overhead will occur on the triangle model of objects. So this memory contains
microcontroller when executing three dimensional graphics operation. coordinates of lot of triangles. Each triangle consists of 3 vertices
So we need an extra hardware to avoid this overhead. Use of ASIC will and each vertex contains 3 points. Also each point has 8 bit width.
eliminate this overhead but it will increase the cost of design if we are For simplicity I created object memory in FPGA which is 72 bit
designing custom applications. So in this project I focused on a
width and depth of memory is related to number of triangles in
hardware design on FPGA, which is capable of processing 3D
graphical operations. The implemented real time 3D graphics the objects.
processor can render 3D object in a 2D display with added effect like The output of my work is a rendered object in a VGA
shading and hidden surface removal. FPGA used is spartan6 and host monitor, with shading and hidden surface removal which will
controller is LPC1769 arm processor. help to give 3D effects. I also interfaced an external keyboard to
FPGA to control transformation of objects like rotation, scaling
Keywords: and translation in real time.
3D graphics processing, transformation unit, shading, z buffer
algorithm, frame buffer
2. THE TASK
1. INTRODUCTION
Here I am describing a hardware design in Spartan6
FPGA, which can render the 3D object. Test objects are stored in
The graphics processing is an essential process of
an object memory which is accessed by the 3D GPU and output is
manipulating and accelerating the building of image to be
projected to a VGA monitor. My host controller is LPC1769
displayed. This process is needed in embedded systems, mobile
ARM controller and it can control GPU via SPI communication.
phones, computers and game consoles. In all these cases ASICs
A graphical LCD panel connect to the host controller will display
will help to render 3D graphics. But when we are trying to design
the current direction of rotation and angle of rotation. Also I
a custom application and we want to show output to a display, we
created a user interface in Visual Basic, which communicates to
can’t afford ASICs due to its cost of design flow. In this case we
host controller via UART protocol. This user interface helps the
can use Field Programmable Gate Arrays (FPGAs) to obtain our
user to choose the object, color of the object and direction in
need without giving overhead to our host controller.
which the object to be rotated. So corresponding to user choice,
The FPGA technology is improving and it can clearly act the host controller give instructions to the 3D GPU and it process
as an alternative to the ASIC design. The developments in FPGA the corresponding object in the object memory. The final result
technology is in such a way that the performance of ASIC and will be displayed in VGA monitor. An external keyboard
FPGA has become comparable. Reusability of FPGA is one of its interfaced to FPGA helps the user to rotate the object in real time.
major advantages. Unlike ASICs, FPGA's have special hardwares
such as Block-RAM, DCM modules, MACs, memories and high
speed I/O, embedded CPU etc inbuilt, which can be used to get
better performance. Modern FPGAs are packed with these
features [1].
In 3D graphics processing, the virtual “world” is made
up of 3 axis of coordinates (x, y, z), just like the world we are
living in. However, in order to display this 3D world onto a 2D
display of (x, y) coordinates, 3D transformation is needed to
transform 3D world into 2D image frame to be displayed on the
monitor. In 3D graphics processing, triangle primitive is one of
the basic building blocks of an object where a single object can be
made from few up to thousands of triangles, depending on the
details. Each triangle consists of three coordinates in the 3D Fig.1. Stages in 3D graphics processing
world. These 3 coordinates are connected to form a triangle.
Models can be created using few or many triangles; with fewer Fig.1 shows various stages in 3D graphics processing. In
triangles, the model will look bulky; with more triangles, the the modeling stage, a triangular model of the object is stored in
model will look smoother. the object memory. In the viewing stage, the triangular model for
a particular object is transformed to a new one with respect to the 4.1 TRANSFORMATION UNIT
transformation information provided. In the clipping stage, the
information outside the 3D viewing angle of the object is Geometric transformations can be used to move objects in
removed. In the projecting stage, data values needed for virtual environment. A basic transformation type involves scaling,
displaying 3D image on a 2D screen is obtained. It is in this stage rotation and translation [2]. A set of points which defines an
the 3D effects are added to the object. Last stage is the display object can be transformed into another set of points by geometric
stage where a 3D image of the object is displayed on the display. calculations. Here I am representing an object with lot of
triangles, so transformation of all triangles gives the feeling that
3. BLOCK DIAGRAM the entire object is moving in the virtual world.Fig.3 shows the
structure of transformation unit.
Fig.3.Transformation unit
4. IMPLEMENTATION
The graphics processing unit will handle all 3D-
rendering operations on a 3D-model.To update the image the
graphic processing unit accesses the frame buffer. By using x and
y coordinates it computes the corresponding address value of the
frame buffer. It also computes the value of each pixel with its
intensity. In this way it updates the image.
The important units in the three dimensional graphics
processor are, Fig.4.Keyboard interfacing unit
The debounce logic is implemented to avoid false location. If the new pixel has less “depth” than the existing pixel
triggering from the keyboard. Shift register is used to store the it will be output to the screen. This preserves the “depth” effect of
data received from the keyboard. Its output is given to the output 3D objects when rendered onto a 2D screen. This technique is
unit. The output unit will provide the ASCII value corresponding known as Z buffering [6]. Hidden surface removing unit stores the
to this received data. It will provide the output value only when it Z values of each pixel location, obtained after the Z buffering, on
is enabled by the error checking unit. The error checking unit will the frame buffer. The address location in which these z values to
take the parity bit of the received data as input and will enable or be stored is calculated by using the x any y values. This module
disable the output unit. Output unit also gives a flag bit which also read data from frame buffer for comparing the existing
indicates the time when a new valid ASCII value is available at values of the corresponding pixel.
the ASCII bus.
4.3 SHADING MODULE 4.5 FRAME BUFFFER
The purpose of the shader module is to rasterize each triangle A frame buffer is a large, contiguous piece of memory.
of the 3D object being rendered. The transformation units outputs At a minimum there is one memory bit for each pixel in the raster;
three vertices representing the points of a triangle to be projected this amount of memory is called a bit plane. Here I am using a
onto a 2D screen and it is given to the shader module. This unit large external SRAM as my frame buffer. So I can represent
processes each triangle and supply result to the next stage. entire screen effectively and also give enough depth for each
pixel. The SRAM used in my purpose is AS7C38098A.It is an
8M-bit high speed CMOS static random access memory
organized as 512K words by 16 bits [7].
REFFERENCES
[1] James Ryan Warner, Real Time 3-D Graphics Processing Hardware Design
Using Field-Programmable GateArrays, M.Sc. of Science in Electrical
Engineering , University of Pittsburgh , Pittsburgh, Pennsylvania,
UnitedStates, 2008.
[2] Fakhrulddin Hamid Ali , Transformation Matrix for 3D computer Graphics
Based on FPGA, Al-RafidainEngineeringJournal,Vol.20 , No.5 , October
2012.
[3] Dr. Basma Mohammed Kamal Younis1, Ne'am Salim Mohammed Sheet,” A
Real Time Dynamic 3D Graphics Processor Using FPGA”, Department of
Computer Technology Engineering/ Technical College, Mosul, Iraq.
Fig.6. Object rotation [4] Scott larson,”ps/2 key board interface”,Avilable at:www.eewiki.net.
[5] Earvin Caceres,Gautham Vunnam,Garvit Singh,Annjana Ramesh ,”3D
rendering in FPGA”,CSEE 4840, Embedded system design Spring 2014
6. CONCLUSION
[6] John Vince, Mathematics for Computer Graphics, 3rd edition, Springer, Inc.
2010.
The given design is implemented in custom Spartan6 [7] AS7C38098A,”512k*16 bit high speed cmos sram”,data sheet,Alliace
FPGA board. The implemented 3D GPU is capable of rendering memory
any object in the object memory. The host controller connected to [8] V.Kasik,A.kurecka,P. Pospech,”3D Graphics Processing Unit with
the FPGA can gave proper instruction for 3D processing. So the VGA”,12th IFAC conference on programmable device and embedded
implemented system could reduce the overhead in LPC1769 syystems,2013.
ARM controller when executes 3D rendering alone. The design