A GPU Based Particle System for Rain and Snow
Total Page:16
File Type:pdf, Size:1020Kb
ABSTRACT HUSSAIN, SYED ASIF. Stereoscopic, Real-time, and Photorealistic Rendering of Natural Phenomena – A GPU based Particle System for Rain and Snow. (Under the direction of Dr. David F.McAllister and Dr. Edgar Lobaton.) Natural phenomena exhibit a variety of forms such as rain, snow, fire, smoke, fog, and clouds. Realistic stereoscopic rendering of such phenomena have implications for scientific visualization, entertainment, and the video game industry. However, among all natural phenomena, creating a convincing stereoscopic view of a computer generated rain or snow, in real-time, is particularly difficult. Moreover, the literature in rendering of precipitation in stereo is non-existent and research in stereo rendering of other natural phenomenon is sparse. A survey of recent work in stereo rendering of natural phenomenon, such as vegetation, fire, and clouds, is done to analyze how stereoscopic rendering is implemented. Similarly, a literature review of monoscopic rendering of rain and snow is completed to learn about the behavior and distribution of particles in precipitation phenomena. From these reviews, it is hypothesized that the monoscopic rendering of rain or snow can be extended to stereo with real-time and photorealistic results. The goal of this study is to validate this hypothesis and demonstrate it by implementing a particle system using a graphics processing unit (GPU). The challenges include modeling realistic particle distributions, use of illumination models, and the impact of scene dynamics due to environmental changes. The modern open graphics library shading language (GLSL) and single instruction multiple threads (SIMT) architecture is used to take advantage of data-parallelism in a graphics processor. The particle geometry is modeled by a few vertices, which are morphed into a raindrop or snowflake shapes. Every vertex is processed in parallel, using the SIMT GPU architecture. A compute shader program, a new compute mode GPU programming language, is used to implement the effects of physical forces on rain or snow particles. Additionally for rain, the concept of retinal persistence is used to elongate the raindrop so that it appears as a falling rain streak. Dynamic level of detail on rain streaks and snowflakes is implemented so that particles closer to the viewer have more visual detail then particles farther away. Illumination models are applied for photorealistic output. The scene is rendered for the left- and right-eye views to produce stereoscopic output, while reducing rendering complexity by drawing some features such as object shadows only once. Additional experiments are performed to evaluate and compare various 2D-3D soft- ware video converters. The goal of these experiments is to determine effectiveness of the 2D-3D converters in producing realistic stereoscopic output of scenes containing water phenomenon. Such scenes are challenging to convert due to scene complexity such as details in scene dynamics, illumination, and reflective distortion. Comparisons between five 2D-3D software video converters are provided by using quantitative and subjective evaluations. The study concludes with experiments on the visual factors necessary to pro- duce photorealistic output. The experimental method uses a series of controlled human experiments where participants are presented with video clips and still photographs of real precipitation. The stimuli vary along three visual factors such as number of particles, particle sizes, and their motion. The goal is to determine the statistical ranking and im- portance of these visual factors for producing a photorealistic output. The experiments are extended to investigate if stereo improves photorealism. Experimental stimuli include post-processing on rendered output to produce variable lighting, glow, and fog effects to study their impact on photorealism as the stereo camera moves in the scene. © Copyright 2017 by Syed Asif Hussain All Rights Reserved Stereoscopic, Real-time, and Photorealistic Rendering of Natural Phenomena – A GPU based Particle System for Rain and Snow by Syed Asif Hussain A dissertation submitted to the Graduate Faculty of North Carolina State University in partial fulfillment of the requirements for the Degree of Doctor of Philosophy Computer Engineering Raleigh, North Carolina 2017 APPROVED BY: Dr. David F.McAllister Dr. Edgar Lobaton Co-chair of Advisory Committee Co-chair of Advisory Committee Dr. Edward Grant Dr. Gregory T. Byrd Dr. Theodore R. Simons DEDICATION This dissertation is dedicated to my family, their unending support and love made this work possible, and to my committee who gave me the necessary foundation to reach my goals. ii BIOGRAPHY Syed grew up in Pakistan. His favorite after school activity was to use his brother’s Sinclair ZX Spectrum personal computer. This early introduction to computers inspired him to pursue higher education in computer engineering. As luck has it, his brother won a scholarship to study at Duke university and encouraged Syed to follow his engineering dreams at NC State university. In 1994 Syed graduated from NC State with a Bachelor of Science degree in computer engineering with a minor in mathematics. He continued his graduate studies at NC State while working as a software engineer, which resulted in a Master of Science in electrical engineering with thesis in 1998. He went on to work in the software industry and moved to Massachusetts. He was conferred with an online degree from NC State in 2003, a Master of Engineering with a concentration in computer science. Syed came back to Raleigh to join NC State with an ultimate goal, to be a Doctor of Philosophy. Along with achieving his research objectives, Syed has been teaching at a local community college since 2010. iii ACKNOWLEDGEMENTS I would like to acknowledge and thank every member of my committee. Special thanks to my academic advisor Dr. McAllister for motivating me to move onward and upward. His expertise are paramount in my understanding of the field. My accomplishments are incomplete without his support. My committee co-chair Dr. Lobaton has always been understanding, accessible, and open for discussion. His insight has led to many improve- ments in my work. Many thanks to Dr. Grant for his engaging lectures and for always being on my side. Always welcoming Dr. Byrd has been instrumental in providing me with en- couragement in times of need. Thank you for always keeping your door open and being approachable, kind, and fair. Before anyone on my committee, there was Dr. Simons. He, along with John Wettroth of Maxim Integrated, played a pivotal role in helping me find my way and point me in the direction of success. Many thanks to Dr. Perros as without him being approachable and open to discuss my plans, I would not have been able to form a committee of exceptional faculty. I am forever in debt. Thank you. Lastly, I must acknowledge my family. To my wife for giving me hope of success when I needed it the most and to our daughters and son for giving meaning to our lives. Thank you for all the joy and opportunities to provide unconditional love. iv TABLE OF CONTENTS LIST OF TABLES .................................................. viii LIST OF FIGURES ................................................. ix Chapter 1 Introduction ........................................... 1 1.1 Research Objectives......................................... 3 1.1.1 Stereoscopic Rendering................................. 4 1.1.2 Real-time Execution ................................... 4 1.1.3 Photorealistic Output .................................. 5 1.1.4 The 2D-3D Conversion ................................. 5 1.1.5 Perceptual Space and Measuring Photorealism................ 6 1.2 Research Contributions ...................................... 6 1.3 Chapters Layout............................................ 7 Chapter 2 Formation of Rain and Snow ............................... 9 2.1 Types of Rain and Snow ...................................... 10 2.1.1 Convectional Rain..................................... 11 2.1.2 Frontal Rain ......................................... 12 2.1.3 Relief or Orographic Rain................................ 13 2.1.4 Dry Snow ........................................... 13 2.1.5 Wet Snow........................................... 14 2.2 Rain Intensity, Size and Shape.................................. 14 2.3 Snow Intensity, Size and Shape................................. 15 Chapter 3 Literature Review ....................................... 19 3.1 Stereoscopic Rendering of Natural Phenomenon.................... 20 3.2 Monoscopic Rendering of Rain................................. 21 3.3 Monoscopic Rendering of Snow ................................ 30 3.4 Computational Analysis...................................... 38 3.4.1 Rendering Performance – Rain............................ 38 3.4.2 Rendering Performance – Snow........................... 43 Chapter 4 Stereo Rendering ....................................... 47 4.1 Depth Perception........................................... 48 4.2 Psychological Depth Cues..................................... 49 4.3 Physiological Depth Cues..................................... 51 4.4 Creating Stereo Pairs ........................................ 55 4.5 Viewing Stereo Pairs......................................... 57 4.5.1 Free Viewing......................................... 59 v 4.5.2 Time-parallel Viewing.................................. 59 4.5.3 Time-multiplexed Viewing............................... 62