SlideShare a Scribd company logo
Realtime 3D graphics 1
Realtime 3D graphics
- Overview
- The goal
- The problem
- Primitives
- Solution
- Algorithms
- Complexity
- Cons and pros
- Conclusion
Realtime 3D graphics 2
Overview
• The whole idea of 3D graphics arose in
90’s when the hardware began to become
strong enough to render realistic 3D
images on a 2d screen retaining
acceptable FPS to create smooth
animation. First application that comes to
mind is Wolfenstein 3D, which became a
real masterpiece and starting point in 3D
game industry.
Realtime 3D graphics 3
The goal
• The goal
The goal of any graphics engine (3D
graphics engine in this context) is to
simulate real world on a 2D screen, creating
feeling of reality and presence in a given
world.
Two affecting factors are speed(FPS) and
image quality.
Realtime 3D graphics 4
The problem
• So, to the bottom of line, the main goal is
to render a realistic image in as high
quality as possible in as less time as
possible. When speaking of “realtime” we
assume not less than 10 FPS with
acceptable image quality (for comparison
movie is 24 FPS)
Realtime 3D graphics 5
The problem
• 3d world can be defined as a huge number of
polygons (n), but we can never really see all
these polygons,
since :
- Closer polygons may cover farther ones,
making them invisible
- About half of them are not facing towards the
point of view (POV) and thus don’t need to be
rendered.
Realtime 3D graphics 6
The problem
- About ¾ of the polygons can’t be seen
because they are not in our Field Of View (FOV,
90 degrees)
• - The polygons are too far from the POV and
may be omitted
• - Other minor factors that won’t be discussed
Realtime 3D graphics 7
The problem
• These factors reduce to the main problem
in 3D graphics : How do we know what’s
visible and what’s not ???
In our language:
Visible Surface Determination (VSD)
Realtime 3D graphics 8
Primitives
Before sliding to the solution of the VSD problem
let’s define some primitives used in a 3D scene
Any 3D world is rendered on a 2D screen as a final
set of primitives like polygons, pixels and such,
no matter how complex it is.
In this presentation we’ll discuss a 3D scene
rendered as a final set of convex flat polygons, or
triangles, to simplify the implementation
Realtime 3D graphics 9
Primitives
- Pixel – Picture element
Single point on a screen. Usually defined as a
combination of Red Green and Blue components to
define any color
Realtime 3D graphics 10
Primitives
- Plane
Imaginary flat surface, defined as ‘Normal’
and translation along this normal from
(0,0,0) of the 3D axis system.
Realtime 3D graphics 11
Primitives
- Polygon (triangle)
Convex closed polygon lying on a single
plane. Defined as a set of vertices in
clockwise direction, which makes the
rendering simpler and faster.
Realtime 3D graphics 12
Primitives
• Clipping frustum
Clipping pyramid defined by set of planes
used to eliminate invisible surfaces that
are not in our field of view (FOV)
Visible
Invisible
Invisible
Realtime 3D graphics 13
Solution
• To solve the VSD problem and render only
what we want retaining acceptable,
realtime FPS we’ll discuss 4 algorithms:
- Painter’s algorithm
- BSP (Binary Space Partitioning)
- Portal rendering
- All the above together
Realtime 3D graphics 14
Painter’s algorithm
• Brute force approach
Since some polygons may cover the other
ones we want to render them from farthest
to closest.
To achieve the order we’ll have to sort
them by distance from the observer (POV)
to each polygon
Realtime 3D graphics 15
Painter’s algorithm
• Complexity
The complexity of this algorithm is defined
by sorting algorithm and is O(nlogn)
Realtime 3D graphics 16
Painter’s algorithm
• Pros
- Very simple
- Takes little memory
- Retains the world dynamic, polygons can
be moved, modified at runtime
Realtime 3D graphics 17
Painter’s algorithm
• Cons
- Becomes too slow for large (n)
- Very big overdraw for large (n)
- Doesn’t solve the problem of overlapping
and intersecting surfaces
Realtime 3D graphics 18
Binary Space Partitioning
• Algorithm based on Divide & Conquer
technique which divides the world into 2
halves, then each of these halves into
their 2 halves and so on until no polygons
are left to divide in a given half
(subspace), thus creating a binary tree in
which left subspace lies on one side of the
splitting plane and the right subspace
space on the opposite side.
Realtime 3D graphics 19
Binary Space Partitioning
A
B
C
D
C
A
BD
E E
Realtime 3D graphics 20
Binary Space Partitioning
CalculateBSP(SubSpace)
{
DivPolygon = Polygons[0]
for each Polygon p in SubSpace except DivPolygon
{
if p is on one side of DivPolygon’s plane
add p to the Left Subspace
if p is on the other side of DivPolygon’s plane
add p to the Right Subspace
if p intersects DivPolygon’s plane
{
split p by DevPolygon’s plane into 2 new polygons p1,p2
add p1 and p2 to Left and Right Subspaces respectively
}
}
If Left Subspace is not empty
CalculateBSP (Left Subspace)
If Right Subspace is not empty
CalculateBSP (Right Subspace)
}
Realtime 3D graphics 21
Binary Space Partitioning
• Complexity of BSP tree calculation
Assuming none of the dividing polygons
intersects any other polygons the
complexity is a regular D&C : O(nlogn)
Realtime 3D graphics 22
Binary Space Partitioning
• Walking the tree
Once we have the BSP tree calculated,
traversing it (rendering) takes linear time.
Depending which side of a given node(polygon)
our POV is we know which subspace to
draw first. If the POV is on one side of the polygon
then draw the other side’s subspace first, then the
polygon itself, and then the opposite side’s
subspace
Realtime 3D graphics 23
Binary Space Partitioning
RenderBSP(Node, FOV)
{
if FOV is on the left side of Node
{
if Node has RightNode
RenderBSP(Node.RightNode, FOV)
}
Render Node
if FOV is on the right side of Node
{
if Node has LeftNode
RenderBSP(Node.LeftNode, FOV)
}
}
Realtime 3D graphics 24
Binary Space Partitioning
A
B
C
D
E
C
A
BD
E
FOV
Realtime 3D graphics 25
Binary Space Partitioning
• Complexity
Traversing BSP takes linear time,
retaining perfect order (front-to-back or
back-to-front) with complexity of O(n)
Realtime 3D graphics 26
Binary Space Partitioning
• Pros
- Simple
- Perfect order with linear complexity
- Solves the problem of overlapping and intersecting
polygons by definition
Realtime 3D graphics 27
Binary Space Partitioning
• Cons
- Requires precalculation time which may take long depending on (n)
- Required more memory since many polygons are usually split (n grows)
- World becomes static, since every modification destroys the
consistency of the tree
- Although the sorting problem has been solved, every single polygon
must be visited during the rendering, so the overdraw is still there (next
algorithm)
Realtime 3D graphics 28
Portal rendering
• This algorithm is best suitable and most
efficient in indoor environments in which the
world consists of 3D convex hulls (sectors,
rooms for instance) connected with each
other by portals (doors). The most intuitive
way to think about it is as Graph, in which
nodes are sectors(rooms) and links are
portals(doors)
Realtime 3D graphics 29
Portal rendering
Sector 1
Sector 2
Sector 3
Sector 4
Portal from
1 to 2
Portal from
2 to 4
Portal from
2 to 3
Sector 5 Portal from
2 to 5
Realtime 3D graphics 30
Portal rendering
• The algorithm doesn’t require
precalculation like BSP but requires the
world to be build in certain way (sectors
and portals).
Once this is done rendering becomes
trivial.
Realtime 3D graphics 31
Portal rendering
RenderPortals(Sector, FOV)
{
for each polygon p in Sector
{
if p is inside FOV)
render p
}
for each portal P in Sector
{
if P is inside FOV
{
create new clipping frustum F from P
RenderPortals(the sector P is connected to, F)
}
}
}
Realtime 3D graphics 32
Portal rendering
Realtime 3D graphics 33
Portal rendering
• Complexity
The polygons don’t have to be sorted in
any way and/or visited more than once.
In worst case we’ll have to render
maximum (n) polygons, so the complexity
of this algorithm is linear, O(n)
Realtime 3D graphics 34
Portal rendering
• Pros
- Simple
- Zero overdraw. Only draw polygons that we can see
- Order isn’t an issue
- The world doesn’t have to be static, as long as the sectors
remain convex
Realtime 3D graphics 35
Portal rendering
• Cons
- Requires the world to be defined in certain way
- Although achieves zero overdraw it becomes too slow
in highly details environment due to too many clipping
operations
Realtime 3D graphics 36
What now ?
• Ok, we learnt 3 nice algorithms so far.
Each one of them has its’ pros & cons, but
how can we use them to build a real
realtime 3D engine ?
Realtime 3D graphics 37
Putting it all together
• Real world can be looked at as a set of
static objects (buildings) and dynamic
objects (people, animals, cars, whatever).
• So, looking back at the 3 algorithms we
can see that BSP and Portals are suitable
for static, and Painter’s algorithm for
dynamic objects.
Realtime 3D graphics 38
Putting it all together
• We can use:
- Portal rendering for objects like rooms, since
they’re relatively simple.
- BSP for complex but yet static objects in every
room. We’ll create one BSP tree for each sector.
- Painter’s algorithm for drawing dynamic objects
like humans.
Realtime 3D graphics 39
Putting it all together
RenderPortals(Sector, FOV)
{
for each polygon p in Sector
{
if p is inside FOV)
render p
}
for each portal P in Sector
{
if P is inside FOV
{
create new clipping frustum F from P
RenderPortals(the sector P is connected to, F)
}
}
RenderBSP(Sector’s BSP, FOV)
RenderDynamic(Sector’s Dynamic objects)
}
Realtime 3D graphics 40
Putting it all together
BSP
BSP
BSP
Portals
Painter’s
Realtime 3D graphics 41
Putting it all together
• Complexity
The complexity of this algorithm is combined of the 3
former algorithms’ complexities :
O(nlogn) for Painters algorithm +
O(n) for BSP +
O(n) for Portals = O(nlogn)
Realtime 3D graphics 42
Conclusion
• Although the complexity remains the same
O(nlogn), large portions of the world with their
BSP trees and dynamic objects (Painter’s) are
discarded by Portal rendering. What’s left is to
render BSP trees and dynamic objects in the
visible sectors.
Although we lose zero overdraw but we win in
not drawing certainly invisible objects.
Realtime 3D graphics 43
Conclusion
No matter how big the world is, we’ll still only
draw what’s potentially visible.
In average, this actually makes the
potentially visible set of polygons constant
(c)
So our real average complexity becomes
O(c). Best complexity you can dream of 
Realtime 3D graphics 44
Afterword
• (c) is generally defined by today’s
hardware. The faster the hardware, the
more polygons we can draw in one frame
remaining Realtime
• (n) is defined by memory limitations. The
more memory we have, the larger and
more complex world we can load into it

More Related Content

PPT
KEY
OpenGL ES for iOS (3D Graphics)
PPTX
GRPHICS01 - Introduction to 3D Graphics
PPTX
GRPHICS02 - Creating 3D Graphics
PPTX
3D Graphics & Rendering in Computer Graphics
PDF
Computer Graphics
PPT
Object representations
PPTX
Computer Graphics
OpenGL ES for iOS (3D Graphics)
GRPHICS01 - Introduction to 3D Graphics
GRPHICS02 - Creating 3D Graphics
3D Graphics & Rendering in Computer Graphics
Computer Graphics
Object representations
Computer Graphics

What's hot (19)

PPTX
COMPUTER GRAPHICS
PPT
1422798749.2779lecture 5
PPT
Image Texture Analysis
PPT
CS 354 Transformation, Clipping, and Culling
PPTX
COM2304: Morphological Image Processing
PPTX
Clipping 22
PDF
Computer graphics
PPT
07object3d
PPTX
Visual realism
PDF
Computer Graphics - Lecture 00 - Introduction
PDF
Computer graphics notes
PPTX
visual realism in geometric modeling
PPTX
Class[5][9th jul] [three js-meshes_geometries_and_primitives]
PPT
Boundary Extraction
PPTX
Animations
PPTX
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
DOCX
Computer graphics
PPT
object 3d(1)
PPT
morphological image processing
COMPUTER GRAPHICS
1422798749.2779lecture 5
Image Texture Analysis
CS 354 Transformation, Clipping, and Culling
COM2304: Morphological Image Processing
Clipping 22
Computer graphics
07object3d
Visual realism
Computer Graphics - Lecture 00 - Introduction
Computer graphics notes
visual realism in geometric modeling
Class[5][9th jul] [three js-meshes_geometries_and_primitives]
Boundary Extraction
Animations
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Computer graphics
object 3d(1)
morphological image processing
Ad

Viewers also liked (14)

PDF
B.how to face_technological_tsunami_clustering_.pmi
PDF
Lecture 1.1 - Terms & Concepts
PPTX
Launch of 3D project
PPTX
Intro to 3D modeling a human
PDF
3D Graphics 101
PPTX
Visible surface determination
PPT
3 D Graphics
PPT
Introduction to 2D/3D Graphics
PPTX
3D Graphics : Computer Graphics Fundamentals
PPT
3 d viewing
PPTX
3D Geometric Transformations
PPTX
Computer Graphics: Visible surface detection methods
PPT
3D Modelig presentation (.ppt) 371 SE
PPTX
3D transformation in computer graphics
B.how to face_technological_tsunami_clustering_.pmi
Lecture 1.1 - Terms & Concepts
Launch of 3D project
Intro to 3D modeling a human
3D Graphics 101
Visible surface determination
3 D Graphics
Introduction to 2D/3D Graphics
3D Graphics : Computer Graphics Fundamentals
3 d viewing
3D Geometric Transformations
Computer Graphics: Visible surface detection methods
3D Modelig presentation (.ppt) 371 SE
3D transformation in computer graphics
Ad

Similar to 3D Graphics (20)

PPT
Implementation
DOCX
Constraints
PDF
Hill Stephen Rendering Tools Splinter Cell Conviction
PPT
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
PDF
Game Engine Overview
PDF
reviewpaper
PPT
visible surface detection
PPT
Visibility Optimization for Games
PPT
Visibility Optimization for Games
PPTX
Penn graphics
PDF
Introducao ao Curso Anselmo Cardoso de Paiva Ufma
PDF
Hidden_surfaces.pdf
PPTX
The Rendering Pipeline - Challenges & Next Steps
PDF
Computer Animation + Game Design Presentation
PPTX
2D graphics
PDF
Rendering Large Models in the Browser in Real-Time
PPT
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
PDF
Graphics
PPSX
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
PPT
Computer graphics iv unit
Implementation
Constraints
Hill Stephen Rendering Tools Splinter Cell Conviction
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Game Engine Overview
reviewpaper
visible surface detection
Visibility Optimization for Games
Visibility Optimization for Games
Penn graphics
Introducao ao Curso Anselmo Cardoso de Paiva Ufma
Hidden_surfaces.pdf
The Rendering Pipeline - Challenges & Next Steps
Computer Animation + Game Design Presentation
2D graphics
Rendering Large Models in the Browser in Real-Time
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
Graphics
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Computer graphics iv unit

3D Graphics

  • 1. Realtime 3D graphics 1 Realtime 3D graphics - Overview - The goal - The problem - Primitives - Solution - Algorithms - Complexity - Cons and pros - Conclusion
  • 2. Realtime 3D graphics 2 Overview • The whole idea of 3D graphics arose in 90’s when the hardware began to become strong enough to render realistic 3D images on a 2d screen retaining acceptable FPS to create smooth animation. First application that comes to mind is Wolfenstein 3D, which became a real masterpiece and starting point in 3D game industry.
  • 3. Realtime 3D graphics 3 The goal • The goal The goal of any graphics engine (3D graphics engine in this context) is to simulate real world on a 2D screen, creating feeling of reality and presence in a given world. Two affecting factors are speed(FPS) and image quality.
  • 4. Realtime 3D graphics 4 The problem • So, to the bottom of line, the main goal is to render a realistic image in as high quality as possible in as less time as possible. When speaking of “realtime” we assume not less than 10 FPS with acceptable image quality (for comparison movie is 24 FPS)
  • 5. Realtime 3D graphics 5 The problem • 3d world can be defined as a huge number of polygons (n), but we can never really see all these polygons, since : - Closer polygons may cover farther ones, making them invisible - About half of them are not facing towards the point of view (POV) and thus don’t need to be rendered.
  • 6. Realtime 3D graphics 6 The problem - About ¾ of the polygons can’t be seen because they are not in our Field Of View (FOV, 90 degrees) • - The polygons are too far from the POV and may be omitted • - Other minor factors that won’t be discussed
  • 7. Realtime 3D graphics 7 The problem • These factors reduce to the main problem in 3D graphics : How do we know what’s visible and what’s not ??? In our language: Visible Surface Determination (VSD)
  • 8. Realtime 3D graphics 8 Primitives Before sliding to the solution of the VSD problem let’s define some primitives used in a 3D scene Any 3D world is rendered on a 2D screen as a final set of primitives like polygons, pixels and such, no matter how complex it is. In this presentation we’ll discuss a 3D scene rendered as a final set of convex flat polygons, or triangles, to simplify the implementation
  • 9. Realtime 3D graphics 9 Primitives - Pixel – Picture element Single point on a screen. Usually defined as a combination of Red Green and Blue components to define any color
  • 10. Realtime 3D graphics 10 Primitives - Plane Imaginary flat surface, defined as ‘Normal’ and translation along this normal from (0,0,0) of the 3D axis system.
  • 11. Realtime 3D graphics 11 Primitives - Polygon (triangle) Convex closed polygon lying on a single plane. Defined as a set of vertices in clockwise direction, which makes the rendering simpler and faster.
  • 12. Realtime 3D graphics 12 Primitives • Clipping frustum Clipping pyramid defined by set of planes used to eliminate invisible surfaces that are not in our field of view (FOV) Visible Invisible Invisible
  • 13. Realtime 3D graphics 13 Solution • To solve the VSD problem and render only what we want retaining acceptable, realtime FPS we’ll discuss 4 algorithms: - Painter’s algorithm - BSP (Binary Space Partitioning) - Portal rendering - All the above together
  • 14. Realtime 3D graphics 14 Painter’s algorithm • Brute force approach Since some polygons may cover the other ones we want to render them from farthest to closest. To achieve the order we’ll have to sort them by distance from the observer (POV) to each polygon
  • 15. Realtime 3D graphics 15 Painter’s algorithm • Complexity The complexity of this algorithm is defined by sorting algorithm and is O(nlogn)
  • 16. Realtime 3D graphics 16 Painter’s algorithm • Pros - Very simple - Takes little memory - Retains the world dynamic, polygons can be moved, modified at runtime
  • 17. Realtime 3D graphics 17 Painter’s algorithm • Cons - Becomes too slow for large (n) - Very big overdraw for large (n) - Doesn’t solve the problem of overlapping and intersecting surfaces
  • 18. Realtime 3D graphics 18 Binary Space Partitioning • Algorithm based on Divide & Conquer technique which divides the world into 2 halves, then each of these halves into their 2 halves and so on until no polygons are left to divide in a given half (subspace), thus creating a binary tree in which left subspace lies on one side of the splitting plane and the right subspace space on the opposite side.
  • 19. Realtime 3D graphics 19 Binary Space Partitioning A B C D C A BD E E
  • 20. Realtime 3D graphics 20 Binary Space Partitioning CalculateBSP(SubSpace) { DivPolygon = Polygons[0] for each Polygon p in SubSpace except DivPolygon { if p is on one side of DivPolygon’s plane add p to the Left Subspace if p is on the other side of DivPolygon’s plane add p to the Right Subspace if p intersects DivPolygon’s plane { split p by DevPolygon’s plane into 2 new polygons p1,p2 add p1 and p2 to Left and Right Subspaces respectively } } If Left Subspace is not empty CalculateBSP (Left Subspace) If Right Subspace is not empty CalculateBSP (Right Subspace) }
  • 21. Realtime 3D graphics 21 Binary Space Partitioning • Complexity of BSP tree calculation Assuming none of the dividing polygons intersects any other polygons the complexity is a regular D&C : O(nlogn)
  • 22. Realtime 3D graphics 22 Binary Space Partitioning • Walking the tree Once we have the BSP tree calculated, traversing it (rendering) takes linear time. Depending which side of a given node(polygon) our POV is we know which subspace to draw first. If the POV is on one side of the polygon then draw the other side’s subspace first, then the polygon itself, and then the opposite side’s subspace
  • 23. Realtime 3D graphics 23 Binary Space Partitioning RenderBSP(Node, FOV) { if FOV is on the left side of Node { if Node has RightNode RenderBSP(Node.RightNode, FOV) } Render Node if FOV is on the right side of Node { if Node has LeftNode RenderBSP(Node.LeftNode, FOV) } }
  • 24. Realtime 3D graphics 24 Binary Space Partitioning A B C D E C A BD E FOV
  • 25. Realtime 3D graphics 25 Binary Space Partitioning • Complexity Traversing BSP takes linear time, retaining perfect order (front-to-back or back-to-front) with complexity of O(n)
  • 26. Realtime 3D graphics 26 Binary Space Partitioning • Pros - Simple - Perfect order with linear complexity - Solves the problem of overlapping and intersecting polygons by definition
  • 27. Realtime 3D graphics 27 Binary Space Partitioning • Cons - Requires precalculation time which may take long depending on (n) - Required more memory since many polygons are usually split (n grows) - World becomes static, since every modification destroys the consistency of the tree - Although the sorting problem has been solved, every single polygon must be visited during the rendering, so the overdraw is still there (next algorithm)
  • 28. Realtime 3D graphics 28 Portal rendering • This algorithm is best suitable and most efficient in indoor environments in which the world consists of 3D convex hulls (sectors, rooms for instance) connected with each other by portals (doors). The most intuitive way to think about it is as Graph, in which nodes are sectors(rooms) and links are portals(doors)
  • 29. Realtime 3D graphics 29 Portal rendering Sector 1 Sector 2 Sector 3 Sector 4 Portal from 1 to 2 Portal from 2 to 4 Portal from 2 to 3 Sector 5 Portal from 2 to 5
  • 30. Realtime 3D graphics 30 Portal rendering • The algorithm doesn’t require precalculation like BSP but requires the world to be build in certain way (sectors and portals). Once this is done rendering becomes trivial.
  • 31. Realtime 3D graphics 31 Portal rendering RenderPortals(Sector, FOV) { for each polygon p in Sector { if p is inside FOV) render p } for each portal P in Sector { if P is inside FOV { create new clipping frustum F from P RenderPortals(the sector P is connected to, F) } } }
  • 32. Realtime 3D graphics 32 Portal rendering
  • 33. Realtime 3D graphics 33 Portal rendering • Complexity The polygons don’t have to be sorted in any way and/or visited more than once. In worst case we’ll have to render maximum (n) polygons, so the complexity of this algorithm is linear, O(n)
  • 34. Realtime 3D graphics 34 Portal rendering • Pros - Simple - Zero overdraw. Only draw polygons that we can see - Order isn’t an issue - The world doesn’t have to be static, as long as the sectors remain convex
  • 35. Realtime 3D graphics 35 Portal rendering • Cons - Requires the world to be defined in certain way - Although achieves zero overdraw it becomes too slow in highly details environment due to too many clipping operations
  • 36. Realtime 3D graphics 36 What now ? • Ok, we learnt 3 nice algorithms so far. Each one of them has its’ pros & cons, but how can we use them to build a real realtime 3D engine ?
  • 37. Realtime 3D graphics 37 Putting it all together • Real world can be looked at as a set of static objects (buildings) and dynamic objects (people, animals, cars, whatever). • So, looking back at the 3 algorithms we can see that BSP and Portals are suitable for static, and Painter’s algorithm for dynamic objects.
  • 38. Realtime 3D graphics 38 Putting it all together • We can use: - Portal rendering for objects like rooms, since they’re relatively simple. - BSP for complex but yet static objects in every room. We’ll create one BSP tree for each sector. - Painter’s algorithm for drawing dynamic objects like humans.
  • 39. Realtime 3D graphics 39 Putting it all together RenderPortals(Sector, FOV) { for each polygon p in Sector { if p is inside FOV) render p } for each portal P in Sector { if P is inside FOV { create new clipping frustum F from P RenderPortals(the sector P is connected to, F) } } RenderBSP(Sector’s BSP, FOV) RenderDynamic(Sector’s Dynamic objects) }
  • 40. Realtime 3D graphics 40 Putting it all together BSP BSP BSP Portals Painter’s
  • 41. Realtime 3D graphics 41 Putting it all together • Complexity The complexity of this algorithm is combined of the 3 former algorithms’ complexities : O(nlogn) for Painters algorithm + O(n) for BSP + O(n) for Portals = O(nlogn)
  • 42. Realtime 3D graphics 42 Conclusion • Although the complexity remains the same O(nlogn), large portions of the world with their BSP trees and dynamic objects (Painter’s) are discarded by Portal rendering. What’s left is to render BSP trees and dynamic objects in the visible sectors. Although we lose zero overdraw but we win in not drawing certainly invisible objects.
  • 43. Realtime 3D graphics 43 Conclusion No matter how big the world is, we’ll still only draw what’s potentially visible. In average, this actually makes the potentially visible set of polygons constant (c) So our real average complexity becomes O(c). Best complexity you can dream of 
  • 44. Realtime 3D graphics 44 Afterword • (c) is generally defined by today’s hardware. The faster the hardware, the more polygons we can draw in one frame remaining Realtime • (n) is defined by memory limitations. The more memory we have, the larger and more complex world we can load into it