WWW.ABSTRACT.XLIBX.INFO
FREE ELECTRONIC LIBRARY - Abstract, dissertation, book
 
<< HOME
CONTACTS



«Integrating Realistic Soft Shadows into Your Game Engine Kevin Myers Randima (Randy) Fernando Louis Bavoil Version 1.0 - February 2008 Integrating ...»

Whitepaper

Integrating Realistic Soft

Shadows into Your Game

Engine

Kevin Myers

Randima (Randy) Fernando

Louis Bavoil

Version 1.0 - February 2008

Integrating Realistic Soft Shadows

Into Your Game Engine

Why Soft Shadows are Important

Despite the rapidly rising visual fidelity of today’s games, few games have ever

had shadows with penumbras that change size correctly based on occluder and

receiver geometry as well as light size. Accurate soft shadows are one of the

major steps games must take to become truly photorealistic.

In this whitepaper, we explain how to easily integrate an efficient method for creating realistic soft shadows on DirectX 10 and high-end DirectX 9 GPUs.

Figure 1 shows our technique implemented in the recently released game Hellgate: London, developed by Flagship Studios.

Realistic Soft Shadows with PCSS Ordinary Shadows Figure 1. Realistic Soft Shadows (Left) versus Ordinary Shadows (Right) in Hellgate: London Image used with permission from Flagship Studios.

Three characters are visible in the screenshot, and each is positioned differently with respect to the ground. Realistic soft shadows help to give an accurate impression of each character’s position. At the upper left is a zombie who is standing on the ground, and his shadow is correspondingly hard. On the right is a flying character with two glowing swords. Notice that the shadows of his feet are hard, since they are close to the ground. But in contrast, the shadows of his glowing swords are very soft. Finally, the main character (at the center) is jumping high off the ground, so his shadow is very soft. Altogether, the combination of shadows makes the image at left much more dynamic image than Version 1.0 - February 2008 Integrating Realistic Soft Shadows Into Your Game Engine the image the right. In addition, these visual cues can help players to discern more of what’s happening on-screen, particularly when characters are jumping or objects are flying around.

In a more general sense, soft shadows are important because:

Realistic soft shadows help us to just spatial relationships between objects. For example, the shadow of a bouncing ball will keep varying from hard to soft, and this allows us to perceive how high the ball is off the ground at any point in time.

Varying penumbras give shadows variety and character. This is one

–  –  –

Step 1: Use a 32-Bit Depth Texture Historically 24-Bit has been used for shadow mapping as this was the format that offered hardware-accelerated percentage-closer filtering (PCF). For PCSS though, we need to read the actual depth values in our blocker search. It is therefore advisable to take advantage of the extra precision offered by 32-bit as it is just as fast as 24-bit.

DirectX 10 For DirectX 10, there should be nothing you need to change. Just make sure you’re using a shadow map with format DXGI_FORMAT_R32_TYPELESS. Then use DXGI_FORMAT_D32_FLOAT for the DepthStencilView and DXGI_FORMAT_R32_FLOAT for the ShaderResourceView.

–  –  –

DirectX 9 Shader Changes After Step 1, your original shadow shader will no longer generate a correct image, because the shadow map texture lookup now returns a floating-point value instead of a gray-scale filtered color. But don’t worry – in Step 2, you’ll easily be able to check if you did Step 1 correctly.

If you really want to check Step 1, an easy way is to replace your original tex2D() call with a quick comparison.

–  –  –

Step 2: Replace Shadow Map Lookup with PCSS Function Now that you have a floating-point texture, you have only to replace the old

shadow map texture lookup with the PCSS function call:

–  –  –

PCF_NUM_SAMPLES. This specifies how many filtering samples are used per dimension. The more samples the smoother are the shadows.

A value of 4 (16 samples) is common for the blocker search as well as the PCF filtering, and is equal to what many shipping games do today. Higher values naturally produce higher quality, but reduce performance. If you have detailed textures, they will help to mark any undersampling artifacts, allowing you to keep the number of filtering samples low.

If you change the values, you must also generate other Poisson disks that equal the number of samples you want. For more on Poisson disks and some source

code for generating them see this web page:

http://www.cs.virginia.edu/~gfx/pubs/antimony/ Performance is very high on recent GPU such as GeForce 8800 GTX or GeForce 7800 GTX. Even at 1600 x 1200, with 25 search samples and 16 PCF samples, the technique runs at well over 100 fps (with all pixels on screen shaded). In practice, you can probably restrict the number of pixels shaded to get even better performance.

Integration in Game Settings Menu The PCSS technique is ideally suited for GeForce 8 Series and high-end GeForce 7 Series GPUs that have powerful pixel shaders and texturing subsystems.

Therefore, the best way to expose PCSS to people playing your game is to have an option in your Game Settings called “High Quality Soft Shadows”. If you already auto-detect graphics card performance, the technique can probably be enabled for the highest quality modes.





Ideas for Improvement

To further improve image quality and performance, you can try the following:

Irregular filtering. By spacing the filtering samples irregularly, you can reduce banding without unduly increasing the number of samples. In the code below we use a 16 tap poisson disk (points evenly and randomly distributed about the unit circle) to do the blocker search.

Use SAVSM. The filtering step is very costly (in the code below we do 256 lookups) making PCSS a perfect candidate for Summed Area Variance Shadow Mapping (see Andrew Lauritzen’s chapter in GPU Gems 3). This technique allows for filter kernels of any size to change per pixel.

Use a variable depth bias inside the PCF kernel. Normally, PCF compares the surface depth (coord.z) with the depths in the kernel. For small

–  –  –

// Assuming that LIGHT_FRUSTUM_WIDTH == LIGHT_FRUSTUM_HEIGHT #define LIGHT_SIZE_UV (LIGHT_WORLD_SIZE / LIGHT_FRUSTUM_WIDTH)

–  –  –

float PenumbraSize(float zReceiver, float zBlocker) //Parallel plane estimation { return (zReceiver - zBlocker) / zBlocker;

} void FindBlocker(out float avgBlockerDepth, out float numBlockers, float2 uv, float zReceiver ) { //This uses similar triangles to compute what //area of the shadow map we should search float searchWidth = LIGHT_SIZE_UV * (zReceiver - NEAR_PLANE) / zReceiver;

float blockerSum = 0;

numBlockers = 0;

–  –  –

avgBlockerDepth = blockerSum / numBlockers;

} float PCF_Filter( float2 uv, float zReceiver, float filterRadiusUV ) { float sum = 0.0f;

for ( int i = 0; i PCF_NUM_SAMPLES; ++i ) { float2 offset = poissonDisk[i] * filterRadiusUV;

sum += tDepthMap.SampleCmpLevelZero(PCF_Sampler, uv + offset, zReceiver);

} return sum / PCF_NUM_SAMPLES;

} float PCSS ( Texture2D shadowMapTex, float4 coords ) { float2 uv = coords.xy;

float zReceiver = coords.z; // Assumed to be eye-space z in this code // STEP 1: blocker search float avgBlockerDepth = 0;

float numBlockers = 0;

FindBlocker( avgBlockerDepth, numBlockers, uv, zReceiver );

if( numBlockers 1 ) //There are no occluders so early out (this saves filtering) return 1.0f;

// STEP 2: penumbra size float penumbraRatio = PenumbraSize(zReceiver, avgBlockerDepth);

float filterRadiusUV = penumbraRatio * LIGHT_SIZE_UV * NEAR_PLANE / coords.z;

// STEP 3: filtering return PCF_Filter( uv, zReceiver, filterRadiusUV );

}

–  –  –

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND

OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA

MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE

MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,

MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication or otherwise under any patent or patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. NVIDIA Corporation products are not authorized for use as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the United States and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

Macrovision Compliance Statement NVIDIA Products that are Macrovision enabled can only be sold or distributed to buyers with a valid and existing authorization from Macrovision to purchase and incorporate the device into buyer’s products.

Macrovision copy protection technology is protected by U.S. patent numbers 4,631,603, 4,577,216 and 4,819,098 and other intellectual property rights. The use of Macrovision’s copy protection technology in the device must be authorized by Macrovision and is intended for home and other limited pay-per-view uses only, unless otherwise authorized in writing by Macrovision. Reverse engineering or disassembly is prohibited Copyright © 2008 NVIDIA Corporation. All rights reserved.





Similar works:

«Neurophysiological correlates of biased cognitive processing in addiction Marianne Littel Neurophysiological correlates of biased cognitive processing in addiction Marianne Littel Cover photography by Valo-x-Stock http://valo-x-stock.deviantart.com/ Cover photo manipulation by Esra Zengin http://sallysalander.deviantart.com/ Layout by Ferdinand van Nispen, Citroenvlinder-DTP.nl, Bilthoven Printed by GVO drukkers & vormgevers B.V. | Ponsen & Looijen ISBN 978-90-6464-551-8 Copyright © 2012 M....»

«A Single-Stranded DNA Molecule: a Useful Marker for Osteogenic Progenitor Cells N. Ardjomandi, Niederlaender, 2Jan, Aicher, 3K. Wilhelm, Reinert, 1Siegmar, Wendel, H. Peter, Alexander, 1Dorothea 1Department of Oral and Maxillofacial Surgery, University Hospital Tübingen 2Department of Thoracic, Cardiac and Vascular Surgery, University Hospital Tübingen 3Department of Urology, University Hospital Tübingen Herein we report on the identification of a DNA molecule (aptamer) towards osteogenic...»

«Agent-based Interperability in Telecommunications Applications Vorgelegt von Diplom-Informatiker Tianning Zhang Vom Fachbereich 13 Informatik der Technischen Universität Berlin zur Erlangung des akademischen Grades Doktor-Ingenieur Dr. -Ing. genehmigte Dissertation Promotionsausschuß: Vorsitzender: Prof. Dr. –Ing. Günter Hommel Berichter: Prof. Dr. Dr.h.c. Radu Popescu Zeletin Berichter: Prof. Dr. rer. nat. Thomas Christaller Tag der wissenschaftlichen Aussprache: 3. April 2001 Berlin 2001...»

«June 30, 2008 LICENSEE: SOUTHERN NUCLEAR OPERATING COMPANY, INC. FACILITY: VOGTLE ELECTRIC GENERATING PLANT, UNITS 1 AND 2 SUBJECT: SUMMARY OF PUBLIC MEETINGS ON THE DRAFT SUPPLEMENTAL ENVIRONMENTAL IMPACT STATEMENT REGARDING THE VOGTLE ELECTRIC GENERATING PLANT, UNITS 1 AND 2, LICENSE RENEWAL REVIEW (TAC NOS. MD 5905 and 5906) On June 3, 2008, members of the U.S. Nuclear Regulatory Commission (NRC or the staff) held public meetings at the August Technical College in Waynesboro, GA, concerning...»

«Briefing Initial Appraisal of a European Commission Impact Assessment April 2016 Intergovernmental agreements in the field of energy Impact Assessment (SWD (2016) 27, SWD (2016) 28 (summary)) of a Commission proposal for a Decision of the European Parliament and of the Council on establishing an information exchange mechanism with regard to intergovernmental agreements and non-binding instruments between Member States and third countries in the field of energy and repealing Decision No...»

«9. Deviant Domesticities and Sexualised Childhoods: Prostitutes, Eunuchs and the Limits of the State Child “Rescue” Mission in Colonial India Jessica Hinchy Nanyang Technological University, Singapore Introduction In the late 1860s and early 1870s, colonial officials in north India argued that the British government had a duty to “rescue” girls and boys who were allegedly kidnapped and condemned to a “life of infamy” by eunuchs and women labelled prostitutes. Colonial officials...»

«Université Toulouse 3 Paul Sabatier (UT3 Paul Sabatier) Cotutelle Internationale avec Université Ege, Turquie Deniz ÇOKUSLU 02 Novembre 2012 tre : Découverte et allocation des ressources pour le traitement de requêtes dans les systèmes grilles ED MITT : Domaine STIC : Réseaux, Télécoms, Systèmes et Architecture Institut de Recherche en Informatique de Toulouse Abdelkader HAMEURLAIN, Professeur à l'Université Paul Sabatier Toulouse III, France Kayhan ERC YE, Professeur à...»

«Multi-sensor determination of cloud liquid water content Scott Ellis Abstract Two techniques to compute range resolved liquid water content (LWC) are compared. The first technique uses only radar reflectivity to estimate LWC from a power law fit derived from modified Gamma drop size distributions. The second technique uses overlapping observations from a radar and passive microwave radiometer. The total liquid water path from the radiometer is preserved along the radial and distributed...»

«Revelation 1−7 ® Scripture quotations in this book are taken from the New American Standard Bible®, © 1960, 1962, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1995 by The Lockman Foundation. Used by permission. (www.Lockman.org) Illustrations by Steve Bjorkman Cover by Left Coast Design, Portland, Oregon DISCOVER 4 YOURSELF is a registered trademark of The Hawkins Children’s LLC. Harvest House Publishers, Inc., is the exclusive licensee of the federally registered trademark DISCOVER 4...»

«TUM ¨ INSTITUT FUR INFORMATIK Umfassendes Architekturmodell f¨ r das u Engineering eingebetteter Software-intensiver Systeme Manfred Broy, Martin Feilkas, Johannes Gr¨ nbauer, u Alexander Gruler, Alexander Harhurin, Judith Hartmann, Birgit Penzenstadler, Bernhard Sch¨ tz, Doris Wild a ÀÁÂ ÃÄÅÆÇ TUM-I0816 Juni 08 ¨ ¨ TECHNISCHE UNIVERSITAT MUNCHEN TUM-INFO-06-I0816-0/1.-FI Alle Rechte vorbehalten Nachdruck auch auszugsweise verboten c 2008 Druck: Institut f¨r Informatik der u...»

«Supporting Asynchronous Collaboration for Interactive Visualization Jeffrey Michael Heer Electrical Engineering and Computer Sciences University of California at Berkeley Technical Report No. UCB/EECS-2008-166 http://www.eecs.berkeley.edu/Pubs/TechRpts/2008/EECS-2008-166.html December 17, 2008 Copyright 2008, by the author(s). All rights reserved. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are...»

«TECHNICAL PROPOSAL EMISSION CONTROL TECHNOLOGIES FOR OCEAN GOING VESSELS (OGVs) Hamid Hefazi Principal Investigator: Center for Energy and Environmental Research and Services (CEERS) California State University, Long Beach (CSULB) Long Beach, CA 90840 And Hamid R. Rahai Co-Principal Investigator Center for Energy and Environmental Research and Services (CEERS) California State University, Long Beach (CSULB) Long Beach, CA 90840 Official Authorized to Bind this Proposal: Name Signature _...»





 
<<  HOME   |    CONTACTS
2016 www.abstract.xlibx.info - Free e-library - Abstract, dissertation, book

Materials of this site are available for review, all rights belong to their respective owners.
If you do not agree with the fact that your material is placed on this site, please, email us, we will within 1-2 business days delete him.