0% found this document useful (0 votes)
45 views23 pages

GFSDK Shadows - Detailed Partner Info

Uploaded by

Krisp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views23 pages

GFSDK Shadows - Detailed Partner Info

Uploaded by

Krisp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Geforce SDK Shadow Lib

1 NVIDIA Confidential
Agenda

Features
Comparison Screenshots
Integration
API
Artistic Requirements
Performance

2 NVIDIA Confidential
Features - Overview

Renders shadow maps


Application provides function pointer
containing draw calls
Excepts externally generated maps too!
Supported light types:
Spot
Directional (with cascades)
Renders shadow buffer
Application provides depth buffer
Filtering technique types:
Hard
PCF
PCSS+

3 NVIDIA Confidential
Features – PCSS+

Adapted to support directional light sources


Adaptive quality level for cascades
Aliasing reduction algorithm
Penumbra control as blocker depth reaches zero
Dramatic performance increases with convergence
testing algorithm

4 NVIDIA Confidential
Regular PCF - Fixed Filter Size

5 NVIDIA Confidential
PCSS+ - Physically Based Filter Size

6 NVIDIA Confidential
CHS – Fixed Filter Size

Fixed kernel
size is
problematic
for cascades

7 NVIDIA Confidential
PCSS+

8 NVIDIA Confidential
CHS – Upper Limit to Penumbra Size

9 NVIDIA Confidential
PCSS+

10 NVIDIA Confidential
CHS – Aliasing

11 NVIDIA Confidential
PCSS+ - Reduced Aliasing

12 NVIDIA Confidential
Integration - Overview

DirectX 11 capable engine


Shadow maps:
Provide a function pointer containing draw calls – let the
library do the rest
Provide your own rendered shadow maps – along with
information used to render them
Depth buffer (either single sample or MSAA)
Library produces fullscreen shadow buffer
Needs combining with color buffer

13 NVIDIA Confidential
Integration – How Long?
Providing your own shadow maps:
This is the path of least resistance
Only requires 1 full screen pass to render the shadow buffer
~1 day with engine programmer & technical artist
Library renders shadow maps:
Need to group draw calls in a function (passed to the lib)
~2-3 days with engine programmer & technical artist (really
depends on engine architecture...)
Tuning
Very quick when params can be changed at runtime
~1/2 a day

14 NVIDIA Confidential
Integration - Tips

Provide resolved depth buffer if it exists


Requires the max depth sub-sample
Resolve will occur if MSAA buffer is provided
Use the debug shaders:
linear depth, cascade view & light frustum view
Ensure matrices are identical to those used to
render shadow maps and main scene
Start with sensible default values as described in the
main header file
Tune params at runtime via the game console
15 NVIDIA Confidential
API – On Create Device

NV_ShadowLib_GetVersion()
Check that header file matches DLL version
NV_ShadowLib_OpenDX()
Pass in ID3D11Device & ID3D11DeviceContext
Returns a NV_ShadowLib_Ctx
NV_ShadowLib_AddBuffer()
Creates a shadow buffer
NV_ShadowLib_AddMap()
Optional – if not providing your own shadow maps

16 NVIDIA Confidential
API – On Resize Window

NV_ShadowLib_RemoveBuffer()
Release the existing shadow buffer
NV_ShadowLib_AddBuffer()
Create a new one of the correct size

17 NVIDIA Confidential
API – On Render

NV_ShadowLib_RenderMap()
Optional – if not providing your own shadow maps
NV_ShadowLib_ClearBuffer()
Clears the shadow buffer
NV_ShadowLib_RenderBuffer()
Can be called multiple times to composite from different
shadow maps
NV_ShadowLib_FinalizeBuffer()
Gives back the finalized shadow buffer

18 NVIDIA Confidential
API – On Destroy Device

NV_ShadowLib_RemoveMap()
Optional – if not providing your own shadow maps
NV_ShadowLib_RemoveBuffer()
Release the shadow buffer
NV_ShadowLib_CloseDX()
Fully release all resources and the NV_ShadowLib_Ctx

19 NVIDIA Confidential
API – On Debug!

NV_ShadowLib_DevModeDisplayMap()
NV_ShadowLib_DevModeDisplayMapFrustum()
NV_ShadowLib_DevModeDisplayBuffer()
NV_ShadowLib_DevModeToggleDebugCascadeShader()
...

20 NVIDIA Confidential
Artistic Requirements

Really just parameter tuning:


Light size and position
Penumbra size and gradient
Shadow map resolution
Overall shadow intensity

21 NVIDIA Confidential
Performance: Directional Light
PCSS+ CHS 15x15
5 6
4 5
4
3 GTX680 GTX680
3
2
2
1 HD7970 HD7970
GHz 1 GHz
0 0
Shadow Shadow Shadow Shadow
Map Buffer Map Buffer

- Performance numbers in miliseconds


- Shadow buffer resolution: 1920x1200
- Shadow map resolution: 2048x2048
- 4 Cascades
22 NVIDIA Confidential
Performance: Spot Light
PCSS+ CHS 15x15
2 4
1.5 3
GTX680 GTX680
1 2
0.5 HD7970 1 HD7970
GHz GHz
0 0
Shadow Shadow Shadow Shadow
Map Buffer Map Buffer

- Performance numbers in miliseconds


- Shadow buffer resolution: 1920x1200
- Shadow map resolution: 2048x2048

23 NVIDIA Confidential

You might also like