SlideShare a Scribd company logo
Introduction Culling.
In 3D rendering, the term culling describes the early rejection of objects of any kind (objects, draw
calls, triangles, and pixels) that do not contribute to the final image or 3D configurator. There are
many techniques that reject objects at different stages of the rendering pipeline. Some of these
techniques are performed entirely in software on the GPU, others are hardware-based (GPU), and
still others are integrated into the graphics card. It is helpful to understand all these techniques in
order to achieve good performance. To keep the processing effort as low as possible, it is better to
select early and select more. On the other hand, the culling itself should not cost too much power
and memory. To ensure good performance, we automatically balance the system. This leads to
better performance, but also makes the system properties more difficult to understand.
As a rule, the engine culling takes place on the Draw Call level or with several Draw Calls. We
don’t go to the triangle level or even further, as this is often not efficient. This means that it can be
useful to divide large objects into several parts so that not all parts have to be rendered together.
No static culling techniques.
We deliberately avoid static techniques such as prepared PVS (Potential Visibility Tests), which
were common in early 3D engines. The big advantage of PVS is the very low cost of runtime
performance, but with modern computers this is less problematic. The PVS is usually created in a
time-consuming pre-processing step, which is bad for production in modern game worlds. The
gameplay often requires dynamic geometry updates (e.g. opening/closing doors, destroying
buildings) and the static nature of a PVS is not very suitable for this. By avoiding PVS and similar
precalculated techniques we can even save some space, which is very valuable on consoles.
Portals.
Another popular approach besides PVS are portals. Portals are usually hand placed, flat, convex 2D
objects. The idea is that when a portal is visible, the world section behind the portal must be
rendered. If the world section is considered visible, the geometry can be further tested as the portal
shape or the intersection of several portals allows higher culling. By separating world sections with
portals, designers can create efficient layers. Good portal positions are located in narrow areas such
as doors and for performance it is beneficial to create environments where portals remove a lot of
content. There are algorithms for automatically placing portals, but it is likely that the resulting
level of performance will be less optimal if designers are not involved in the optimization process.
Hand-placed portals avoid time-consuming pre-processing steps, consume little additional memory,
and allow some dynamic updates. Portals can be turned on and off, and some engines even
implement special effects with portals (e.g. mirrors, transporters). In CryEngine only portals are
used to improve rendering performance. We decided not to extend the use of portals to make the
code and portal workflow simple and efficient. Portals have their advantages, but it requires
additional effort from designers and often it is difficult to find good portal positions. Open
environments such as cities or pure nature often do not allow efficient portal usage. Portals are
supported by CryEngine, but should only be used where they work better than the coverage buffer.
Anti-portals.
The portal technology can be extended by the opposite of portals, which are generally referred to as
anti-portals. The objects that are often convex in 2D or 3D can close other portals. Imagine a large
column in a room with several doors leading to other rooms. This is a difficult case for classic
portals, but the typical use case for anti-portals. Anti portals can be implemented with geometric
intersections of objects, but this method has problems with merging multiple anti portals and
efficiency suffers. Instead of geometric anti-portals, we have the cover buffer, which serves the
same purpose but has better properties.
GPU Z Test.
In modern graphics cards, the Z buffer is used to solve the hidden interface problem. Here is a
simple explanation: For each pixel on the screen, the so-called Z or depth value is stored, which
represents the distance of the camera to the next geometry at this pixel position. All renderable
objects must consist of triangles. All pixels covered by the triangles perform a Z comparison (Z
buffer vs. Z value of the triangle) and depending on the result, the triangle pixel is discarded or not.
This elegantly solves the problem of removing hidden surfaces even from overlapping objects. The
already mentioned problem of occluder fusion is solved without further effort. The Z-test is quite
late in the rendering pipeline, which means that many engine setup costs (e.g. skinning, shader
constants) are already done.
In some cases it allows to avoid pixel shader execution or frame buffer blending, but its main
purpose is to solve the problem of hidden surfaces, culling is a side effect. By roughly sorting
objects from front to back, culling performance can be improved. The early Z-pass technique
(sometimes referred to as Z-pre-pass) makes this less indispensable, as the first pass is explicitly
quickly aligned to per-pixel performance. Some hardware even runs at double speed when color
writing is disabled. Unfortunately, we have to output data there to set up the G-buffer data for
delayed lighting.
The Z buffer precision is influenced by the pixel format (24bit), the Z buffer area and in a very
extreme (non-linear) way by the Z near value. The Z Near value defines how close an object can be
to the viewer before it is cut away. By halving the Z Near (e.g. from 10cm above 5cm) you
effectively halve the accuracy of the Z buffer. This has no effect on most object renderings, but
decals are often rendered correctly because their Z value is slightly smaller than the surface beneath
them. It’s a good idea not to change the Z near at runtime.
GPU Z Cull / HiZ.
Efficient Z buffer implementations in the GPU cull fragments (pixels or multiple-sampled
subsamples) in coarser blocks at an earlier time. This helps to reduce the execution of pixel shaders.
There are many conditions required to enable this optimization, and seemingly harmless renderer
changes can easily break this optimization. The rules are complicated and depend on the graphics
card.
GPU occlusion queries.
The occlusion query function of modern graphics cards allows the CPU to retrieve information
about previously performed Z buffer tests. This function can be used to implement more advanced
culling techniques. After rendering some occluders (preferably from front to back, first large
objects), objects (occludees) can be tested for visibility. The graphics hardware makes it possible to
test multiple objects efficiently, but there is a big problem. Since the entire rendering is heavily
buffered, the information whether an object is visible is delayed by a long time (up to several
frames). This is unacceptable because it means either very bad states (frame rate couplings), bad
frame rate in general, or for a while invisible objects where they shouldn’t be.
For some hardware/drivers, this latency problem is less severe than for others, but a delay of about
one frame is about the best there is. This also means that we can’t perform efficient hierarchical
tests efficiently, e.g. when a closed box is visible and then perform fine-grained tests with
subdivisions. The Occlusion test functionality is implemented in the engine and is currently used for
ocean rendering. We even use the number of visible pixels to scale the update frequency of the
reflection. Unfortunately, we can also have the situation that the ocean is not visible for one or two
images due to fast position changes of the view. This happened in Crysis, for example, when the
player left the submarine.
Software Coverage Buffer (cbuffer).
The Z buffer performance depends on the number of triangles, the number of vertices and the
number of covered pixels. This is all very fast on graphics hardware and would be very slow on the
CPU. However, the CPU wouldn’t have the latency problem of occlusion queries and modern CPUs
get faster. So we did a software implementation on the CPU called “Coverage Buffer”. To achieve
good performance, we use simplified Occluder and Occludees. Artists can add a few occluder
triangles to well occluding objects and we test for the occlusion of the object boundary box.
Animated objects are not considered. We also use a lower resolution and hand-optimized code for
the triangle grid. The result is a rather aggressively optimized set of objects that need to be
rendered. It’s possible that an object is occuled even though it should still be visible, but this is very
rare and often due to a bad asset (e.g. the occluder polygon is slightly larger than the object). We
decided to prefer performance, efficiency and simplicity of code over correctness.
Cover buffer with Z buffer readback.
On some hardware (PlayStation 3, Xbox360) we can efficiently copy the Z buffer into main
memory and perform coverage buffer tests. This still leads to the same latency problems, but
integrates well into the software implementation of the cover buffer and is efficient when used for
many objects. This method introduces a frame delay, so for example fast rotations can be a problem.
Backface Culling.
Normally Backface Culling is a piece of cake for graphic programmers. Depending on the triangle
orientation (clockwise or counterclockwise with respect to the viewer) the hardware does not have
to represent the rear triangles and we get some acceleration. Only for some alpha blended objects or
special effects we need to disable backface culling. With the PS3, this issue needs to be
reconsidered. The GPU performance in processing nodes or retrieving nodes can be a bottleneck
and the good connection between the SPUs and the CPU makes it possible to create data on
demand. The effort for SPU transformation and triangle testing can be worthwhile. An efficient
CPU implementation could perform frustum culling by combining small triangles, backface culling,
mesh skinning, and even lighting. However, this is not an easy task. In addition to maintaining this
PS3-specific code path, the mesh data must be available in CPU memory. At the time of writing this
article, we haven’t done this optimization yet because memory is scarce. We might reconsider this
once we have efficient streaming from CPU to memory (code that uses this data may have to do
with frame latency).
Conditional rendering.
The occlusion query function could be used for another culling technique. Many draw calls must be
made in multiple passes and subsequent passes could be avoided if the previous pass had been
fetched. This requires a lot of occlusion queries and accounting effort. On most hardware, this
would not pay off, but our PS3 renderer implementation can access data structures at a very low
level, so the overhead is lower.
Heightmap raycasting.
Heightmaps enable efficient ray cast tests. With these objects in the vicinity, the ground hidden
behind a terrain can be cleared. This culling technique has been available since CryEngine 1, but
now that we have many other methods and store the heightmap data in compressed form, the
technique has become less efficient. This is all the more true when you consider the changes that
have taken place in the hardware since then. Over time, the computing power increased faster than
the memory power. This culling technique can be replaced by others over time.
Thank you for your visit.

More Related Content

Similar to Introduction occlusion

Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine Overview
Sharad Mitra
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
Prabindh Sundareson
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
Umbra
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
Mark Kilgard
 
Point cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihangPoint cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihang
Lihang Li
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imagination
Droidcon Berlin
 
Ha4 constraints
Ha4   constraintsHa4   constraints
Ha4 constraints
JordanSmith96
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracow
MateuszSzczyrzyca
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
💻 Anton Gerdelan
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
Johan Andersson
 
Hardware software co simulation of edge detection for image processing system...
Hardware software co simulation of edge detection for image processing system...Hardware software co simulation of edge detection for image processing system...
Hardware software co simulation of edge detection for image processing system...
eSAT Publishing House
 
Introduction To Massive Model Visualization
Introduction To Massive Model VisualizationIntroduction To Massive Model Visualization
Introduction To Massive Model Visualization
pjcozzi
 
IMAGE PROCESSING
IMAGE PROCESSINGIMAGE PROCESSING
IMAGE PROCESSING
ABHISHEK MAURYA
 
IRJET- Front View Identification of Vehicles by using Machine Learning Te...
IRJET-  	  Front View Identification of Vehicles by using Machine Learning Te...IRJET-  	  Front View Identification of Vehicles by using Machine Learning Te...
IRJET- Front View Identification of Vehicles by using Machine Learning Te...
IRJET Journal
 
Compression of Compound Images Using Wavelet Transform
Compression of Compound Images Using Wavelet TransformCompression of Compound Images Using Wavelet Transform
Compression of Compound Images Using Wavelet Transform
DR.P.S.JAGADEESH KUMAR
 
Webapp Rendering and Optimization.
Webapp Rendering and Optimization.Webapp Rendering and Optimization.
Webapp Rendering and Optimization.
arthurjamain
 
2 D3 D Concersion Swaggmedia
2 D3 D Concersion   Swaggmedia2 D3 D Concersion   Swaggmedia
2 D3 D Concersion Swaggmedia
Craig Nobles
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Luis Cataldi
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Unreal Engine
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentation
spartasoft
 

Similar to Introduction occlusion (20)

Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine Overview
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
Point cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihangPoint cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihang
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imagination
 
Ha4 constraints
Ha4   constraintsHa4   constraints
Ha4 constraints
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracow
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
 
Hardware software co simulation of edge detection for image processing system...
Hardware software co simulation of edge detection for image processing system...Hardware software co simulation of edge detection for image processing system...
Hardware software co simulation of edge detection for image processing system...
 
Introduction To Massive Model Visualization
Introduction To Massive Model VisualizationIntroduction To Massive Model Visualization
Introduction To Massive Model Visualization
 
IMAGE PROCESSING
IMAGE PROCESSINGIMAGE PROCESSING
IMAGE PROCESSING
 
IRJET- Front View Identification of Vehicles by using Machine Learning Te...
IRJET-  	  Front View Identification of Vehicles by using Machine Learning Te...IRJET-  	  Front View Identification of Vehicles by using Machine Learning Te...
IRJET- Front View Identification of Vehicles by using Machine Learning Te...
 
Compression of Compound Images Using Wavelet Transform
Compression of Compound Images Using Wavelet TransformCompression of Compound Images Using Wavelet Transform
Compression of Compound Images Using Wavelet Transform
 
Webapp Rendering and Optimization.
Webapp Rendering and Optimization.Webapp Rendering and Optimization.
Webapp Rendering and Optimization.
 
2 D3 D Concersion Swaggmedia
2 D3 D Concersion   Swaggmedia2 D3 D Concersion   Swaggmedia
2 D3 D Concersion Swaggmedia
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentation
 

More from VisCircle

My living-bloom
My living-bloomMy living-bloom
My living-bloom
VisCircle
 
Maruti omni
Maruti omniMaruti omni
Maruti omni
VisCircle
 
La botte-gardian
La botte-gardianLa botte-gardian
La botte-gardian
VisCircle
 
Echtzeit 3d-ocean
Echtzeit 3d-oceanEchtzeit 3d-ocean
Echtzeit 3d-ocean
VisCircle
 
Caib 3d-tischlerei-konfigurator
Caib 3d-tischlerei-konfiguratorCaib 3d-tischlerei-konfigurator
Caib 3d-tischlerei-konfigurator
VisCircle
 
Hyundai renderings
Hyundai renderingsHyundai renderings
Hyundai renderings
VisCircle
 
3d brille-skalpell
3d brille-skalpell3d brille-skalpell
3d brille-skalpell
VisCircle
 
Schmuck konfigurator-3d
Schmuck konfigurator-3dSchmuck konfigurator-3d
Schmuck konfigurator-3d
VisCircle
 
Hdst 3d-konfigurator
Hdst 3d-konfiguratorHdst 3d-konfigurator
Hdst 3d-konfigurator
VisCircle
 
Honda konfigurator-3dmodellierung
Honda konfigurator-3dmodellierungHonda konfigurator-3dmodellierung
Honda konfigurator-3dmodellierung
VisCircle
 
3d virtueller-showroom
3d virtueller-showroom3d virtueller-showroom
3d virtueller-showroom
VisCircle
 
Ar media-plugin
Ar media-pluginAr media-plugin
Ar media-plugin
VisCircle
 
Oculus quest-app2
Oculus quest-app2Oculus quest-app2
Oculus quest-app2
VisCircle
 
Google vr-creation-app
Google vr-creation-appGoogle vr-creation-app
Google vr-creation-app
VisCircle
 
Varjo chroma-keying
Varjo chroma-keyingVarjo chroma-keying
Varjo chroma-keying
VisCircle
 
Virtual reality-architektur
Virtual reality-architekturVirtual reality-architektur
Virtual reality-architektur
VisCircle
 
Kinemac 2-3d-animationen
Kinemac 2-3d-animationenKinemac 2-3d-animationen
Kinemac 2-3d-animationen
VisCircle
 
Augmented reality-realistisch
Augmented reality-realistischAugmented reality-realistisch
Augmented reality-realistisch
VisCircle
 
Apple augmented-reality-brille
Apple augmented-reality-brilleApple augmented-reality-brille
Apple augmented-reality-brille
VisCircle
 
Herausforderungen produktkonfiguration
Herausforderungen produktkonfigurationHerausforderungen produktkonfiguration
Herausforderungen produktkonfiguration
VisCircle
 

More from VisCircle (20)

My living-bloom
My living-bloomMy living-bloom
My living-bloom
 
Maruti omni
Maruti omniMaruti omni
Maruti omni
 
La botte-gardian
La botte-gardianLa botte-gardian
La botte-gardian
 
Echtzeit 3d-ocean
Echtzeit 3d-oceanEchtzeit 3d-ocean
Echtzeit 3d-ocean
 
Caib 3d-tischlerei-konfigurator
Caib 3d-tischlerei-konfiguratorCaib 3d-tischlerei-konfigurator
Caib 3d-tischlerei-konfigurator
 
Hyundai renderings
Hyundai renderingsHyundai renderings
Hyundai renderings
 
3d brille-skalpell
3d brille-skalpell3d brille-skalpell
3d brille-skalpell
 
Schmuck konfigurator-3d
Schmuck konfigurator-3dSchmuck konfigurator-3d
Schmuck konfigurator-3d
 
Hdst 3d-konfigurator
Hdst 3d-konfiguratorHdst 3d-konfigurator
Hdst 3d-konfigurator
 
Honda konfigurator-3dmodellierung
Honda konfigurator-3dmodellierungHonda konfigurator-3dmodellierung
Honda konfigurator-3dmodellierung
 
3d virtueller-showroom
3d virtueller-showroom3d virtueller-showroom
3d virtueller-showroom
 
Ar media-plugin
Ar media-pluginAr media-plugin
Ar media-plugin
 
Oculus quest-app2
Oculus quest-app2Oculus quest-app2
Oculus quest-app2
 
Google vr-creation-app
Google vr-creation-appGoogle vr-creation-app
Google vr-creation-app
 
Varjo chroma-keying
Varjo chroma-keyingVarjo chroma-keying
Varjo chroma-keying
 
Virtual reality-architektur
Virtual reality-architekturVirtual reality-architektur
Virtual reality-architektur
 
Kinemac 2-3d-animationen
Kinemac 2-3d-animationenKinemac 2-3d-animationen
Kinemac 2-3d-animationen
 
Augmented reality-realistisch
Augmented reality-realistischAugmented reality-realistisch
Augmented reality-realistisch
 
Apple augmented-reality-brille
Apple augmented-reality-brilleApple augmented-reality-brille
Apple augmented-reality-brille
 
Herausforderungen produktkonfiguration
Herausforderungen produktkonfigurationHerausforderungen produktkonfiguration
Herausforderungen produktkonfiguration
 

Recently uploaded

Growth Marketing in 2024 - Randy Rayess, Outgrow
Growth Marketing in 2024 - Randy Rayess,  OutgrowGrowth Marketing in 2024 - Randy Rayess,  Outgrow
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdfHow to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
SimpleMoneyMaker
 
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed GuideMastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Kopa Global Technologies
 
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Learn more about affiliate marketing as a beginner
Learn more about affiliate marketing as a beginnerLearn more about affiliate marketing as a beginner
Learn more about affiliate marketing as a beginner
MichaelGiles34
 
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdfLuxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
KiranRai75
 
Mastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis YuMastering SEO for Google in the AI Era - Dennis Yu
What Software is Used in Marketing in 2024.
What Software is Used in Marketing in 2024.What Software is Used in Marketing in 2024.
What Software is Used in Marketing in 2024.
Ishaaq6
 
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy CrestodinaSEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Pillar-Based Marketing Master Class - Ryan Brock
Pillar-Based Marketing Master Class - Ryan BrockPillar-Based Marketing Master Class - Ryan Brock
Practical Progress from a Theory by Steven Kingpdf
Practical Progress from a Theory by Steven KingpdfPractical Progress from a Theory by Steven Kingpdf
Practical Progress from a Theory by Steven Kingpdf
william charnock
 
Assignment 2 Task 1: Digital Marketing Course
Assignment 2 Task 1: Digital Marketing CourseAssignment 2 Task 1: Digital Marketing Course
Assignment 2 Task 1: Digital Marketing Course
klaudiadgmkt
 
Get admission in various courses and boost your employment opportunities.
Get admission in various courses and boost your employment opportunities.Get admission in various courses and boost your employment opportunities.
Get admission in various courses and boost your employment opportunities.
complete knowledge
 
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptxFrom Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
Boston SEO Services
 
Story Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer MorillaStory Telling Master Class - Jennifer Morilla
Mastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis YuMastering SEO for Google in the AI Era - Dennis Yu
Influencer Marketing Master Class - Alexis Andreasik
Influencer Marketing Master Class - Alexis AndreasikInfluencer Marketing Master Class - Alexis Andreasik
Influencer Marketing Master Class - Alexis Andreasik
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Boost Your Instagram Views Instantly Proven Free Strategies.pptx
Boost Your Instagram Views Instantly Proven Free Strategies.pptxBoost Your Instagram Views Instantly Proven Free Strategies.pptx
Boost Your Instagram Views Instantly Proven Free Strategies.pptx
InstBlast Marketing
 
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdfTop Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
1Solutions Pvt. Ltd.
 

Recently uploaded (20)

Growth Marketing in 2024 - Randy Rayess, Outgrow
Growth Marketing in 2024 - Randy Rayess,  OutgrowGrowth Marketing in 2024 - Randy Rayess,  Outgrow
Growth Marketing in 2024 - Randy Rayess, Outgrow
 
Amazing and On Point - Ramon Ray, USA TODAY
Amazing and On Point - Ramon Ray, USA TODAYAmazing and On Point - Ramon Ray, USA TODAY
Amazing and On Point - Ramon Ray, USA TODAY
 
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdfHow to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
How to Start Affiliate Marketing with ChatGPT- A Step-by-Step Guide (1).pdf
 
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed GuideMastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
 
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
 
Learn more about affiliate marketing as a beginner
Learn more about affiliate marketing as a beginnerLearn more about affiliate marketing as a beginner
Learn more about affiliate marketing as a beginner
 
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdfLuxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
Luxury Hanloom Saree Brand ,Capstone Project_Kiran Bansal.pdf
 
Mastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis YuMastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis Yu
 
What Software is Used in Marketing in 2024.
What Software is Used in Marketing in 2024.What Software is Used in Marketing in 2024.
What Software is Used in Marketing in 2024.
 
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy CrestodinaSEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
 
Pillar-Based Marketing Master Class - Ryan Brock
Pillar-Based Marketing Master Class - Ryan BrockPillar-Based Marketing Master Class - Ryan Brock
Pillar-Based Marketing Master Class - Ryan Brock
 
Practical Progress from a Theory by Steven Kingpdf
Practical Progress from a Theory by Steven KingpdfPractical Progress from a Theory by Steven Kingpdf
Practical Progress from a Theory by Steven Kingpdf
 
Assignment 2 Task 1: Digital Marketing Course
Assignment 2 Task 1: Digital Marketing CourseAssignment 2 Task 1: Digital Marketing Course
Assignment 2 Task 1: Digital Marketing Course
 
Get admission in various courses and boost your employment opportunities.
Get admission in various courses and boost your employment opportunities.Get admission in various courses and boost your employment opportunities.
Get admission in various courses and boost your employment opportunities.
 
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptxFrom Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
From Hope to Despair The Top 10 Reasons Businesses Ditch SEO Tactics.pptx
 
Story Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer MorillaStory Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer Morilla
 
Mastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis YuMastering SEO for Google in the AI Era - Dennis Yu
Mastering SEO for Google in the AI Era - Dennis Yu
 
Influencer Marketing Master Class - Alexis Andreasik
Influencer Marketing Master Class - Alexis AndreasikInfluencer Marketing Master Class - Alexis Andreasik
Influencer Marketing Master Class - Alexis Andreasik
 
Boost Your Instagram Views Instantly Proven Free Strategies.pptx
Boost Your Instagram Views Instantly Proven Free Strategies.pptxBoost Your Instagram Views Instantly Proven Free Strategies.pptx
Boost Your Instagram Views Instantly Proven Free Strategies.pptx
 
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdfTop Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
Top Strategies for Building High-Quality Backlinks in 2024 PPT.pdf
 

Introduction occlusion

  • 1. Introduction Culling. In 3D rendering, the term culling describes the early rejection of objects of any kind (objects, draw calls, triangles, and pixels) that do not contribute to the final image or 3D configurator. There are many techniques that reject objects at different stages of the rendering pipeline. Some of these techniques are performed entirely in software on the GPU, others are hardware-based (GPU), and still others are integrated into the graphics card. It is helpful to understand all these techniques in order to achieve good performance. To keep the processing effort as low as possible, it is better to select early and select more. On the other hand, the culling itself should not cost too much power and memory. To ensure good performance, we automatically balance the system. This leads to better performance, but also makes the system properties more difficult to understand. As a rule, the engine culling takes place on the Draw Call level or with several Draw Calls. We don’t go to the triangle level or even further, as this is often not efficient. This means that it can be useful to divide large objects into several parts so that not all parts have to be rendered together. No static culling techniques. We deliberately avoid static techniques such as prepared PVS (Potential Visibility Tests), which were common in early 3D engines. The big advantage of PVS is the very low cost of runtime performance, but with modern computers this is less problematic. The PVS is usually created in a time-consuming pre-processing step, which is bad for production in modern game worlds. The gameplay often requires dynamic geometry updates (e.g. opening/closing doors, destroying buildings) and the static nature of a PVS is not very suitable for this. By avoiding PVS and similar precalculated techniques we can even save some space, which is very valuable on consoles. Portals. Another popular approach besides PVS are portals. Portals are usually hand placed, flat, convex 2D objects. The idea is that when a portal is visible, the world section behind the portal must be rendered. If the world section is considered visible, the geometry can be further tested as the portal
  • 2. shape or the intersection of several portals allows higher culling. By separating world sections with portals, designers can create efficient layers. Good portal positions are located in narrow areas such as doors and for performance it is beneficial to create environments where portals remove a lot of content. There are algorithms for automatically placing portals, but it is likely that the resulting level of performance will be less optimal if designers are not involved in the optimization process. Hand-placed portals avoid time-consuming pre-processing steps, consume little additional memory, and allow some dynamic updates. Portals can be turned on and off, and some engines even implement special effects with portals (e.g. mirrors, transporters). In CryEngine only portals are used to improve rendering performance. We decided not to extend the use of portals to make the code and portal workflow simple and efficient. Portals have their advantages, but it requires additional effort from designers and often it is difficult to find good portal positions. Open environments such as cities or pure nature often do not allow efficient portal usage. Portals are supported by CryEngine, but should only be used where they work better than the coverage buffer. Anti-portals. The portal technology can be extended by the opposite of portals, which are generally referred to as anti-portals. The objects that are often convex in 2D or 3D can close other portals. Imagine a large column in a room with several doors leading to other rooms. This is a difficult case for classic portals, but the typical use case for anti-portals. Anti portals can be implemented with geometric intersections of objects, but this method has problems with merging multiple anti portals and efficiency suffers. Instead of geometric anti-portals, we have the cover buffer, which serves the same purpose but has better properties. GPU Z Test. In modern graphics cards, the Z buffer is used to solve the hidden interface problem. Here is a simple explanation: For each pixel on the screen, the so-called Z or depth value is stored, which represents the distance of the camera to the next geometry at this pixel position. All renderable objects must consist of triangles. All pixels covered by the triangles perform a Z comparison (Z buffer vs. Z value of the triangle) and depending on the result, the triangle pixel is discarded or not. This elegantly solves the problem of removing hidden surfaces even from overlapping objects. The already mentioned problem of occluder fusion is solved without further effort. The Z-test is quite late in the rendering pipeline, which means that many engine setup costs (e.g. skinning, shader constants) are already done. In some cases it allows to avoid pixel shader execution or frame buffer blending, but its main purpose is to solve the problem of hidden surfaces, culling is a side effect. By roughly sorting objects from front to back, culling performance can be improved. The early Z-pass technique (sometimes referred to as Z-pre-pass) makes this less indispensable, as the first pass is explicitly quickly aligned to per-pixel performance. Some hardware even runs at double speed when color writing is disabled. Unfortunately, we have to output data there to set up the G-buffer data for delayed lighting. The Z buffer precision is influenced by the pixel format (24bit), the Z buffer area and in a very extreme (non-linear) way by the Z near value. The Z Near value defines how close an object can be to the viewer before it is cut away. By halving the Z Near (e.g. from 10cm above 5cm) you effectively halve the accuracy of the Z buffer. This has no effect on most object renderings, but decals are often rendered correctly because their Z value is slightly smaller than the surface beneath them. It’s a good idea not to change the Z near at runtime.
  • 3. GPU Z Cull / HiZ. Efficient Z buffer implementations in the GPU cull fragments (pixels or multiple-sampled subsamples) in coarser blocks at an earlier time. This helps to reduce the execution of pixel shaders. There are many conditions required to enable this optimization, and seemingly harmless renderer changes can easily break this optimization. The rules are complicated and depend on the graphics card. GPU occlusion queries. The occlusion query function of modern graphics cards allows the CPU to retrieve information about previously performed Z buffer tests. This function can be used to implement more advanced culling techniques. After rendering some occluders (preferably from front to back, first large objects), objects (occludees) can be tested for visibility. The graphics hardware makes it possible to test multiple objects efficiently, but there is a big problem. Since the entire rendering is heavily buffered, the information whether an object is visible is delayed by a long time (up to several frames). This is unacceptable because it means either very bad states (frame rate couplings), bad frame rate in general, or for a while invisible objects where they shouldn’t be. For some hardware/drivers, this latency problem is less severe than for others, but a delay of about one frame is about the best there is. This also means that we can’t perform efficient hierarchical tests efficiently, e.g. when a closed box is visible and then perform fine-grained tests with subdivisions. The Occlusion test functionality is implemented in the engine and is currently used for ocean rendering. We even use the number of visible pixels to scale the update frequency of the reflection. Unfortunately, we can also have the situation that the ocean is not visible for one or two images due to fast position changes of the view. This happened in Crysis, for example, when the player left the submarine. Software Coverage Buffer (cbuffer). The Z buffer performance depends on the number of triangles, the number of vertices and the number of covered pixels. This is all very fast on graphics hardware and would be very slow on the CPU. However, the CPU wouldn’t have the latency problem of occlusion queries and modern CPUs get faster. So we did a software implementation on the CPU called “Coverage Buffer”. To achieve good performance, we use simplified Occluder and Occludees. Artists can add a few occluder triangles to well occluding objects and we test for the occlusion of the object boundary box. Animated objects are not considered. We also use a lower resolution and hand-optimized code for the triangle grid. The result is a rather aggressively optimized set of objects that need to be rendered. It’s possible that an object is occuled even though it should still be visible, but this is very rare and often due to a bad asset (e.g. the occluder polygon is slightly larger than the object). We decided to prefer performance, efficiency and simplicity of code over correctness. Cover buffer with Z buffer readback. On some hardware (PlayStation 3, Xbox360) we can efficiently copy the Z buffer into main memory and perform coverage buffer tests. This still leads to the same latency problems, but integrates well into the software implementation of the cover buffer and is efficient when used for many objects. This method introduces a frame delay, so for example fast rotations can be a problem. Backface Culling.
  • 4. Normally Backface Culling is a piece of cake for graphic programmers. Depending on the triangle orientation (clockwise or counterclockwise with respect to the viewer) the hardware does not have to represent the rear triangles and we get some acceleration. Only for some alpha blended objects or special effects we need to disable backface culling. With the PS3, this issue needs to be reconsidered. The GPU performance in processing nodes or retrieving nodes can be a bottleneck and the good connection between the SPUs and the CPU makes it possible to create data on demand. The effort for SPU transformation and triangle testing can be worthwhile. An efficient CPU implementation could perform frustum culling by combining small triangles, backface culling, mesh skinning, and even lighting. However, this is not an easy task. In addition to maintaining this PS3-specific code path, the mesh data must be available in CPU memory. At the time of writing this article, we haven’t done this optimization yet because memory is scarce. We might reconsider this once we have efficient streaming from CPU to memory (code that uses this data may have to do with frame latency). Conditional rendering. The occlusion query function could be used for another culling technique. Many draw calls must be made in multiple passes and subsequent passes could be avoided if the previous pass had been fetched. This requires a lot of occlusion queries and accounting effort. On most hardware, this would not pay off, but our PS3 renderer implementation can access data structures at a very low level, so the overhead is lower. Heightmap raycasting. Heightmaps enable efficient ray cast tests. With these objects in the vicinity, the ground hidden behind a terrain can be cleared. This culling technique has been available since CryEngine 1, but now that we have many other methods and store the heightmap data in compressed form, the technique has become less efficient. This is all the more true when you consider the changes that have taken place in the hardware since then. Over time, the computing power increased faster than the memory power. This culling technique can be replaced by others over time. Thank you for your visit.