Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.

Similar presentations


Presentation on theme: "Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight."— Presentation transcript:

1 Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight

2 HDR and Tone Mapping Clamped to [0,1]Compressed

3 Advances in graphics hardware –Physically-based rendering on the GPU (Purcell et al, 2003) –High dynamic range texture mapping (Debevec et al, 2001)

4 System Overview Interactive tone mapping system for an OpenGL application tone mapping system application LDR image Frame buffer Display callback HDR image

5 Interface to the application –tmInitialize(); // Initialize the system –tmEnable(); // Retarget GL calls Draw geometry tmCompress(); // Compress output –tmDisable(); // Restore app context tone mapping system application

6 Choosing a tone mapping operator Photographic Tone Reproduction for High Contrast Images (Reinhard et al, 2002) –Global operator is a simple transfer function scaled luminance 0 1

7 Choosing a tone mapping operator Local operator –Digital analog to ‘burning’ and ‘dodging’ local area luminance Center-surround

8 Global operator is simple and fast to compute Only one global computation We can dynamically choose the number of zones Why use this tone mapping operator?

9 Variable number of zones: 3

10 Variable number of zones: 4

11 Variable number of zones: 5

12 Variable number of zones: 6

13 Variable number of zones: 7

14 Variable number of zones: 8

15 System block diagram

16 Implementation Target architecture –ATI Radeon 9800 (R350) Data storage –Floating-point off-screen buffers (pbuffers) –Multiple rendering surfaces (GL_AUXi)

17 Implementation Algorithms –ARB fragment and vertex assembly –Generate fragments with image-sized quads Data representation –Vector vs. scalar organization

18 Global operator block diagram

19 Implementation: global operator –Simple luminance transform –Store luminance and log luminance in separate channels HDR image Luminance Log luminance Mipmap reduction LDR image Single pbuffer luminance log luminance

20 Implementation: global operator Single rendering surface log luminance channel log average luminance HDR image Luminance Log luminance Mipmap reduction LDR image Single pbuffer

21 Implementation: global operator operator shader texture 0 texture 1 texture 2 HDR image Luminance Log luminance Mipmap reduction LDR image

22 Local operator block diagram

23 Implementation: GPU-based convolutions Transform n-vector product into multiple 4-vector products filter luminance + + …………

24 Vectorizing the luminance –Output 4 pixels at the same time –Useful for expensive algorithms –Requires a conversion back to scalar form. Stacked domain

25 A simple method for luminance vectorization: Vectorizing the luminance R G B A luminance

26 A simple method for luminance vectorization: Vectorizing the luminance R G B A luminance

27 A simple method for luminance vectorization: Vectorizing the luminance R G B A luminance

28 A simple method for luminance vectorization: Vectorizing the luminance R G B A luminance

29 A simple method for luminance vectorization: Preserves spatial locality Vectorizing the luminance R G B A luminance

30 filter image Example:1 x n inner product stacked image GPU-based convolutions

31 filter image stacked image GPU-based convolutions Pass 1

32 filter image stacked image GPU-based convolutions Pass 1Pass 2 +

33 filter image stacked image GPU-based convolutions Pass 1Pass 2Pass 3 ++

34 GPU-based convolutions Compute multiple 4-vector products per pass –Less shader and texture switching stacked image ++ Single render pass

35 GPU-based convolutions Compute multiple 4-vector products per pass –Less shader and texture switching stacked image ++ Single render pass

36 GPU-based convolutions Compute multiple 4-vector products per pass –Less shader and texture switching stacked image ++ Single render pass

37 GPU-based convolutions Compute multiple 4-vector products per pass –Less shader and texture switching stacked image ++ Single render pass

38 GPU-based convolutions Compute multiple 4-vector products per pass –Less shader and texture switching stacked image ++ Single render pass

39 GPU-based convolutions Advantages : –Handles large kernels –Efficient memory access –No transform back to scalar values 21 x 21 kernel ~ 10 ms 41 x 41 kernel ~ 16 ms 11 x 11 kernel ~ 6 ms 512 X 512 image:

40 System block diagram

41 Calculating adaptation zones luminance 0 Buffer 0Buffer 1 FRONT BACK 1 filtered

42 Calculating adaptation zones luminance 2 Buffer 0Buffer 1 FRONT BACK 1 filtered

43 Calculating adaptation zones luminance 2 Buffer 0 FRONT BACK 3 Buffer 1 filtered

44 Calculating adaptation zones luminance 4 FRONT BACK 3 Buffer 0Buffer 1 filtered

45 Image size Frames per second 16 bit floats 32 bit floats Performance: global operator

46 Performance: local operator Number of zones 16 bit floats 32 bit floats Frames per second

47 Performance comparison: CPU vs. GPU

48 Results: Accuracy Comparison with CPU: 512 x 512 image ImageRMS % error Scaled luminance0.022 % Convolution (5 x 5)0.026 % Convolution (49 x 49)0.032 % Final image1.051 %

49 False-color zone images CPUGPU

50 Compressed: 2 zonesClamped [0,1] Images generated at ~30Hz

51 Compressed: 2 zonesClamped [0,1]

52 Compressed: 2 zonesClamped [0,1] Images generated at ~30Hz

53 Compressed: 2 zonesClamped [0,1] Images generated at ~30Hz

54 Compressed: 2 zonesClamped [0,1] Images generated at ~30Hz

55 Compressed: 2 zonesClamped [0,1] Images generated at ~30Hz

56 Conclusion and Future Work Summary –System for interactively compressing HDR output from an OpenGL application –Complex tone mapping operator on the GPU Future Work –Other tone mapping operators –Further optimizations –Non-invasive implementation


Download ppt "Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight."

Similar presentations


Ads by Google