Hardware-Assisted CSG Rendering Fabiano Romeiro, Harvard University Luiz Velho, IMPA Luiz Henrique de Figueiredo IMPA Theme • CSG (Constructive Solid Geometry): Hierarchical modeling of complex objects > Generated by combinations of simple primitives - - Motivation • Interactivity is important: – Makes design easier – Handle complex objects • However, it is difficult: – Scalability Previous Work • Initial Approaches (CPU) – Boundary representations – Depth-layering [Goldfeather et al.] • Recent Approaches (GPU) – Stencil Buffer [Wiegand], [Rappoport], [Stewart] – Depth-peeling Blister, [Hable and Rossignac] Our Approach • Current Algorithms are bandwidth limited (i.e., depth layering, depth peeling, etc) • GOAL: – Make better use of GPU processing power – Shift bottleneck: Bandwidth GPU Instruction throughput Overview • Perform spatial subdivision on the CPU until CSG expression is locally simple enough to render on the GPU. • Locally Simple Surface within a cell is: – Single primitive – Boolean operation of two primitives Algorithm 1. Subdivision Step • Create Hierarchical Spatial Decomposition based on the CSG expression 2. Ray Tracing Step • Traverse Subdivision Structure and Render each Cell Subdivision Step • Subdivision Structure – Modified octree (sequenced kd-tree) Illustrative Subdivision Example in 2D PINK CELLS: boolean operation of 2 primitives GREEN CELLS: single primitive GREY CELLS: Do not intersect CSG surface YELLOW CELLS: project to less than a threshold of pixels and are ignored Real Subdivision Example Visual Trade-Off • Quality x Speed: Increasing threshold gives better performance but introduces visible artifacts 1 pixel * OBS: No make-up! 20 pixels Ray-Tracing on the GPU • Draw faces of Object’s Proxy Bounding Volume • Use Vertex and Pixel shaders to trace rays on the GPU Ray-Tracing Step • Octree Traversal – Recursive front-to-back order • At leaf cells – Take action according to cell classification: 1. Bind Apropriate Pixel Shader 2. 3. Pass Parameters to Shader Render Faces of Cell CSG Ray-Tracing • Two Types of Cells: a) Single primitive shader b) Boolean operation of 2 primitives o o o o Results • Measurements performed in 2 configurations: – C1: Pentium-M 1.4GHz, Geforce FX Go5200 – C2: Athlon 64 3800+, Geforce 6800 GT • To evaluate performance we measured: – S: Subdivision time (CPU) – TR: Traversal and rendering time (GPU) – Ts: Setup time (Bandwidth) Results WIDGET CK200 CK500 ~ 1.4x 0% of rendering time Model S CK1000 8% of rendering time TS TR C1 C2 C1 C2 C1 C2 WIDGET 17 12 9 5 2262 59 40x CK200 223 163 84 42 6331 346 18x CK500 1232 888 432 213 16046 1514 11x CK1000 3705 2658 1265 626 34975 4324 8x 1% of rendering time 3% 4% of rendering time 14% of rendering time 12% Demo Conclusions • Performance comparable to best current methods • For models with ~ 500 primitives – GPU instruction throughput limited • Next generation GPUs – Expect to surpass other methods on complex models
© Copyright 2024 Paperzz