790 likes | 944 Views
High-Quality Volume Graphics on Consumer PC Hardware. Klaus Engel. Joe Kniss. Markus Hadwiger. Christof Rezk-Salama. a ( f ). R G B ( f ). Shading, Compositing…. Human Tooth CT. Map data value f to color and opacity. R G B. a. f. ~. ~. Optical Properties. Color (RGB)
E N D
High-Quality Volume Graphics on Consumer PC Hardware Klaus Engel Joe Kniss Markus Hadwiger Christof Rezk-Salama
a(f) RGB(f) Shading, Compositing… Human Tooth CT Map data value f to color and opacity RGB a f
~ ~ Optical Properties • Color (RGB) • Emissive term =
~ ~ Optical Properties • Alpha (a.k.a. opacity or extinction) • Attenuates light based on density = =
~ ~ Optical Properties • Traditional Volume Rendering Equation • Emission & absorption
Optical Properties • Scale alpha values based on sample rate (sr) 1.3 .7
Transfer Function • Transform scalar data value into optical properties • Use optical properties to solve integral • Very easy to implement • Data is a texture • Transfer function is a lookup • Compute Riemann sum using “over operator”
Transfer Function Pre-classification Post-classification Transfer function evaluated before interpolation, i.e. interpolation of colors not data Transfer function evaluated after interpolation, i.e. data is interpolated first
Implementation • Two choices: • Texture Lookup Table • glColorTable* • Varies depending on hardware, may require a special texture data format • Fast • Dependent Texture Read • Very hardware dependent • Becoming more general, see OpenGl 2.0 • Slower but more flexible…
Transfer Function • Problem: • No shape or depth queues • No shading. color alpha f(x,y,z)
Transfer Function • Solution: Faux Shading • Ramp color to black with alpha • Silhouette edges color alpha f(x,y,z)
Transfer Function • Better: Surface Shading • Slower, requires normal • More flexible
Transfer Function • Better: Surface Shading • Slower, requires normal • More flexible • Faux shading enhances
Transfer Function • Problem: Can’t surface shade homogeneous regions • Need good gradients • Sensitive to noise
Transfer Function • Solution: Surface scalar (s) • Only shade high gradient magnitudes: • Or, add s to TF • Interpolate…
Transfer Function • Problem: How did the light get there? • No attenuation through volume • Not realistic!
Transfer Function • Solution: Shadows • Better depth queues • Dramatic effects
Shadows Image plane r1 r0 Eye Light
~ ~ Shadows Sample ri (s) Image plane r1 r0 l0 IL Eye
Shadows • Implementation: • 2 passes • Attenuate from the light source • Render from the eye • Store light attenuation in second volume • Multiply color by attenuation from shadow volume
Shadows • Disadvantages: • Difficult to build shadow volume on the card • Slow to build off the card • Additional volume required • Attenuation leakage • Blurry shadow boundaries • Low resolution shadows!
Shadows • Alternative: Incremental shadows • Generate shadows one slice at a time • Only use a 2D buffer • Image space shadow computation • All on card • Half angle slicing
Shadows Eye Slicing from light’s point of view
Shadows Eye Slicing from eye’s point of view
Incremental Shadows Eye Half angle slicing: good from either point of view
Incremental Shadows Similar aspect ratio from both points of view
Incremental Shadows * Slice pass 1
Incremental Shadows Slice pass 2
Incremental Shadows • Advantages: • Screen space shadows • No leakage • Use render to texture to optimize • Shades perturbed volumes • Simple implementation • Disadvantages: • Aliasing at sharp opacity changes • Fix with slightly larger light buffer
Shadows • Problem: Shadows still too dark • Direct attenuation is inadequate • Need to handle higher order light transport effects Shadows
Shadows • Solution: Translucency • One consequence of light scattering • Smoke, clouds, skin, wax…. Translucent Shadows
Translucency • Wax: Real Shadows
Translucency • Wax: Translucent Real Shadows
Translucency • Add indirect attenuation Direct attenuation, same as shadows Blurred indirect attenuation, includes an indirect alpha
Translucency Direct (Id) and indirect (Ii) attenuation
Translucency • How? • Same as shadows (two light buffers) • Sample previous light buffer multiple times for blur • Ping-pong blending • Store indirect in a color component • Sum direct and indirect in fragment shader for the eye pass • Only use direct attn. for eye pass
Translucency • Problem: Still doesn’t look right Translucent Real Shadows
Translucency • Solution: add spectral attenuation Translucent w/spectral attn. Real
Translucency • Spectral attenuation: • Attenuate some colors more than others • Spectral indirect attn. is simplest • Need separate alpha for RGB • Store in RGB components of light buffer
Translucency • Indirect alpha vs. transport color • Alpha: • Transport: =1-alpha Transport color is easier to specify
Optical Properties • Recap: • Reflective color/Emission (RGB) • Direct attenuation/alpha (A) • Surface scalar (s) • Indirect attenuation (Ar,Ag,Ab) • Others? Scattering, absorption, phase function, density, emission, index of refraction…
Transfer function • Specification • Simple, easy • Expressive • Guided
Transfer function • Typical: 1D linear ramps • Independent R,G,B,A control • Difficult • Trial and error alpha f(x,y,z)
Transfer function • Problem: • RGB = bad color space for humans • No concept of features alpha f(x,y,z)
Transfer function • Better: set color at control points • Use HSV or HLS color spaces • Simplified interface • Still no guidance alpha f(x,y,z)
Transfer function • Guided techniques: • Design Galleries • Thumbnails • Semi-Automatic • Dual-domain interaction
Design Galleries • Treat TF and rendering as a high dimensional parameter space • Stochastically sample space • Cluster images based on fitness • Select best looking image
Design Galleries • Computationally expensive • Difficult to implement • Not guided by dataset specifics • Only handles 1D transfer functions
Thumbnails • Visual history of changes • Show important regions of TF • Show effects of potential changes