/
Cass Everitt Cass Everitt

Cass Everitt - PDF document

tatyana-admore
tatyana-admore . @tatyana-admore
Follow
392 views
Uploaded On 2015-09-21

Cass Everitt - PPT Presentation

2 Why is correct transparency hardTwo depth buffersEnter the shadow mapPrecisioninvariance issuesDepth replace texture shaderBlending the layers 3 Good TransparencyBad Transparency 4 Most hardware d ID: 136202

2 Why correct transparency hard?Two

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Cass Everitt" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Cass Everitt 2 Why is correct transparency hard?Two depth buffersEnter the shadow mapPrecision/invariance issuesDepth replace texture shaderBlending the layers 3 Good TransparencyBad Transparency 4 Most hardware does object-order renderingCorrect transparency requires sorted traversalHave to render polygons in sorted orderNot very convenientPolygons can’t intersectLot of extra application workEspecially difficult for dynamic scene databases 5 multiple depth layersFirst pass render finds front-most fragment color/depthEach successive pass render finds (extracts) the fragment color/depth for the next-nearest fragment on a per pixel basisUse dual depth buffers to compare previous nearest fragment with currentSecond “depth buffer” used for comparison (read only) from texture [more on this later] 6 Layer 0Layer 1Layer 2Layer 3 7 Cross-section view ofdepth peeling 0 depth 1Layer 0Layer 1Layer 2 Depth peeling strips away depth layers with each successive pass. The frames above show thefrontmost(leftmost) surfaces as bold black lines, surfaces as lightgreylines.0 depth 10 depth 1 8 for ( = 0; num_passes; ++ )clear color bufferdepth unit 0:== 0) { disable depth test }else { enable depth test }bind depth buffer (% 2)disable depth writes /* read-only depth test */set depthfuncto GREATERdepth unit 1:bind depth buffer ((+1) % 2)clear depth bufferenable depth writes;enable depth test;set depthfuncto LESSrender scenesave color buffer RGBA as layer 9 There is no “dual depth buffer” extension to OpenGL, so what can we do?Just need one depth test with writeable depth buffer –the other can be read-onlyShadow mapping a read-only depth test!Depth test can have an arbitrary camera locationOther interesting uses for clip volumesFast copies make this proposition reasonableCopies will be unnecessary in the future… 10 Using shadow mapping hardware introduces depth rasterizationusually just needs to match output depth buffer precision, and requires no perspective correctionTexture hardware requires perspective correction and projection at high precisionMaking things match would be difficult without the DEPTH_REPLACE texture shaderComputes with texture hardware at texture precisionSolves invariance problems at some extra expenseWill be cheaper in the future… 11 1 layer2 layers3 layers4 layers 12 Each time we peel, we capture the RGBA, then as a final step, we blend all the layers together from Opaque fragments completely overwrite previous transparent onesCould peel from back to front and start with all fully opaque objectsFewer layers requiredWould be useful with occlusion / visibility testMust peel all layers to avoid blending artifactsVariations on this approach would still allow early exit (buffer_region extension) 13 Get correct transparency without invasive changes to internal data structuresCan be “bolted on” to existing CAD/CAM appsscene traversals for correctly sorted depths= 4 is often quite satisfactory (see previous slide)Depth Peeling instrumental in “Woo shadowmaps”Other uses?Shadow maps are for more than shadows! 14 cass@nvidia.com http://www.nvidia.com/developer Thanks for attending