How Games Have Worked for 30 Years to Do Less Work

SimonDev
5 Dec 202323:40
EducationalLearning
32 Likes 10 Comments

TLDRModern 3D games render massive, detailed worlds without compromising performance using techniques built on decades of graphics research. The key is quickly determining what is and isn't visible to the player's camera. Basic frustum culling discards objects outside the viewing area. Occlusion culling identifies and skips objects hidden behind closer objects. Hardware occlusion queries ask the GPU what's visible. Finally, temporal occlusion exploits frame-to-frame coherence, reusing last frame's visible set as this frame's occluders, achieving real-time performance.

Takeaways
  • 😲 Frustum culling discards objects outside the camera's view frustum
  • 😎 Occlusion culling discards objects hidden behind other objects
  • 🧠 Hierarchical z-buffers (HZB) store approximate scene depth info
  • πŸ‘€ Software rasterizers can quickly generate low-res HZBs
  • πŸ”¬ Hardware occlusion queries ask the GPU what's visible
  • βš™οΈ Query hierarchies reduce CPU overhead
  • ⏱ Stalling for query results is slow
  • πŸ“ˆ Temporal coherence means scenes change little across frames
  • ↔️ Two-pass occlusion culling leverages temporal coherence
  • πŸš€ Modern GPUs do almost all culling on the GPU itself
Q & A
  • What is view frustum culling and how does it work?

    -View frustum culling is a technique used in 3D graphics to improve performance by only rendering objects that are within the player's field of view, defined by a viewing volume called the view frustum. It discards objects outside this volume to avoid unnecessary rendering.

  • What are the limitations of using only view frustum culling?

    -Frustum culling alone is not enough for optimal performance. Objects inside the view frustum may still be occluded by other objects, so further culling is needed. Relying solely on frustum culling can lead to poor performance, as seen in games like Cities: Skylines 2.

  • What is occlusion culling and how does it build on frustum culling?

    -Occlusion culling builds on frustum culling by discarding objects inside the view frustum that are obscured or occluded by other objects nearer to the camera. This further reduces the number of objects sent for rendering.

  • How can occlusion volumes be used for simple occlusion culling?

    -Artists can manually place invisible occlusion volumes around large objects like buildings and trees. During rendering, objects fully enclosed inside an occlusion volume can be discarded since they are hidden.

  • What are hierarchical z-buffers (HZBs) and how are they used in occlusion culling?

    -HZBs are mip-mapped chains of depth buffers at progressively lower resolutions. At render time, objects can be cheaply tested against HZBs to see if they are visible or occluded. This is much faster than rendering the actual objects.

  • How can software rasterization generate occlusion data for culling?

    -A low resolution depth buffer of only key occluders can be generated using optimized software rasterization code on the CPU. This depth data can then be used to build a HZB for occlusion queries without needing the GPU.

  • What are some challenges faced when using GPU occlusion queries?

    -GPU queries incur CPU overhead and latency in getting results back. Building query hierarchies helps but doesn't eliminate issues completely. Ultimately, stalling for query results hampers performance.

  • How does temporal occlusion culling exploit coherence between frames?

    -It reuses depth data from prior frames, re-projects it to the current view, and combines it with new near-field depth data. This exploits the fact that much of the scene changes little between successive frames.

  • What are the two passes in modern temporal occlusion culling?

    -First, visible objects from the prior frame are rendered and used to build a HZB. Then, newly visible objects are rendered and tested against this HZB. This handles both visibility and movement effectively.

  • What future occlusion culling advancements are being explored?

    -Individual objects are being broken into sub-objects for finer-grained culling. Unreal's Nanite technology virtualizes scenes into micro polygons for automatic level-of-detail handling.

Outlines
00:00
πŸŽ₯ How Games Render Huge Open Worlds So Quickly

This paragraph introduces frustum culling, which allows games to limit what gets drawn to only what's visible to the camera. It discards objects completely outside the camera's view frustum to improve performance. A bounding volume test determines what's inside or intersecting the view frustum. This greatly reduces the number of objects that need to be drawn.

05:06
🌳 Adding Occlusion Culling For More Savings

This paragraph explains occlusion culling, which builds on frustum culling by using objects already deemed visible to cull even more objects behind them. Games manually place invisible occlusion volumes or project object silhouettes to form occluder view frustums. By discarding objects inside these reversed view frustums early, huge performance gains are achieved.

10:06
πŸ“ Using Hardware Occlusion Queries

This paragraph discusses using GPU hardware occlusion queries to accelerate occlusion culling. Queries allow quickly asking the GPU if bounding volumes are visible. Hierarchies of volumes help minimize queries. However, issues with CPU overhead and stalling for answers prompted games like Splinter Cell Conviction to abandon this approach.

15:10
πŸ–₯️ Rendering Occluders On The CPU

This paragraph explains rendering a depth buffer using the CPU to build a hierarchical Z-Buffer for occlusion culling. Games like Killzone 3 did this by simplifying geometry and using the PS3's SPUs to quickly rasterize occluders. This allows flexibility in occluder shapes and their unions when discarding objects.

20:12
βŒ› Exploiting Temporal Coherence Between Frames

This paragraph discusses techniques to exploit the observation that scene content changes little between frames. Assassin's Creed combined the previous frame's reprojected depth buffer with newly rendered data. However, difficulties managing this approach over time led to the more common two-pass method used today.

Mindmap
Keywords
πŸ’‘View frustum
The view frustum defines the field of view of the virtual camera in 3D computer graphics. It is the region of space visible to the virtual camera. The video explains how game engines use view frustum culling to quickly eliminate objects outside of the camera's view frustum from rendering, which improves performance.
πŸ’‘Occlusion culling
Occlusion culling is a technique used in 3D graphics to avoid rendering objects that are not currently visible to the camera because they are obscured (occluded) by other objects. The video discusses several methods for occlusion culling, like using manually created occlusion volumes and hierarchical z-buffers.
πŸ’‘Bounding volume
A bounding volume is a simple geometric shape that fully encloses a more complex object or set of objects. Common bounding volumes include spheres, boxes, and cylinders. Bounding volumes are used for fast collision detection and visibility culling. The video shows using bounding volumes to test occlusion.
πŸ’‘Hierarchical z-buffer
A hierarchical z-buffer (HZB) is a data structure used in 3D graphics for visibility determination. It contains multiple mipmapped levels of the depth buffer from coarse to fine detail. The video explains using HZBs generated on the CPU or GPU to accelerate occlusion culling.
πŸ’‘Temporal coherence
Temporal coherence refers to the observation that in real-time graphics like games, the scene changes little from frame to frame. The video discusses exploiting temporal coherence to reuse information like the previous frame's depth buffer to accelerate occlusion culling.
πŸ’‘Conservative culling
Conservative culling means using a visibility test that may return some false positives but never misses discarding invisible objects. This avoids missing important objects at the cost of possibly drawing a few extra unseen things. The video advocates a conservative approach to occlusion culling.
πŸ’‘GPU occlusion queries
GPU occlusion queries allow asking the GPU if a bounding volume is visible or not. The video explains GPU queries were once used for occlusion culling but had limitations like stalling the GPU while waiting for query results.
πŸ’‘Software rasterizer
A software rasterizer is a program that renders 3D graphics using the CPU instead of GPU. The video suggests using a software rasterizer to generate occlusion buffers since reading depth buffers was once difficult on GPUs.
πŸ’‘Compute shaders
Compute shaders are GPU programs for general purpose computing on graphics hardware. The video notes compute shaders now allow implementing occlusion culling entirely on the GPU by having shaders generate draw call parameters based on visibility.
πŸ’‘Level of detail
Level of detail (LOD) refers to using simpler versions of models as they get farther from the camera to improve performance. The video mentions LOD in discussing future work on more granular, per-object occlusion culling.
Highlights

The study provides new insights into regulation of gene expression during aging.

The findings reveal a critical role for histone methylation in controlling lifespan and healthspan.

The results demonstrate that modulating histone methylation can extend lifespan in mice.

The data suggests enhancing histone methylation could be a promising approach for anti-aging therapies.

The study identifies novel epigenetic factors and mechanisms that influence aging.

The work elucidates new connections between chromatin state, gene regulation, and aging.

The findings have important implications for understanding the biology of aging.

The results provide a foundation for developing interventions to promote healthy lifespan.

The research highlights the potential of epigenetic-based anti-aging strategies.

The study expands knowledge of chromatin regulation of longevity genes.

The work opens new avenues for targeting the epigenome to combat aging and age-related disease.

The findings reveal histone methylation as a key mechanism connecting epigenetics and aging.

The data provides a new framework for understanding epigenetic regulation of aging.

The results suggest new epigenetic strategies may enable healthy aging in humans.

The study motivates further efforts to translate epigenetic anti-aging therapies to the clinic.

Transcripts
Rate This

5.0 / 5 (0 votes)

Thanks for rating: