[CSCI-4800/5800] - Shaders and GPU Programming Professor Min-Hyung Choi January 20, 2016.

Slides:



Advertisements
Similar presentations
Lecture 0: Course Overview
Advertisements

Exploration of bump, parallax, relief and displacement mapping
Bump Mapping CSE 781 Roger Crawfis.
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
3D Graphics Rendering and Terrain Modeling
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
(conventional Cartesian reference system)
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen’s slides) Instructor: Rick Parent Credit: 4 Class: MWF 10:30.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
COMP4070 Computer Graphics Dr. Amy Zhang. Welcome! 2  Introductions  Administrative Matters  Course Outline  What is Computer Graphics?
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Computer Visualization BIM Curriculum 03. Topics  History  Computer Visualization Methods  Visualization Workflow  Technology Background.
Invitation to Computer Science 5th Edition
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics 靜宜大學 資訊工程系 蔡奇偉 副教授
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics Ed Angel Professor Emeritus of Computer.
CSE Real Time Rendering. TBT (Not So) Real Time Rendering.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Computer Graphics I, Fall 2008 Introduction to Computer Graphics.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 CS4610/7610: Introduction to Computer Graphics.
CSE 581: Interactive Computer Graphics Spring 2012, UG 4 Tuesday, Thursday – 9:00AM – 10:18AM DL 0317 Raghu Machiraju Slides: Courtesy - Prof. Huamin Wang,
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 The Rendering Pipeline. CS788 Topic of HCI 2 Outline  Introduction  The Graphics Rendering Pipeline  Three functional stages  Example  Bottleneck.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
Game Programming 06 The Rendering Engine
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
BUMP-MAPPING SET09115 Intro to Graphics Programming.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
D&E Communications Computer Science Wing Caputo Hall Dept. of Computer Science Millersville University Millersville, PA.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Introduction to Computer Graphics Dr Usman Saeed Assistant Professor Faculty of Computing.
Ying Zhu Georgia State University
Computer Graphics.
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Programmable Pipelines
Graphics Processing Unit
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Interactive Computer Graphics
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics
Introduction to Computer Graphics
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Presentation transcript:

[CSCI-4800/5800] - Shaders and GPU Programming Professor Min-Hyung Choi January 20, 2016

Welcome to Shaders and GPU Programming  Instructor: Dr. Min Choi ‒ Website: cse.ucdenver.edu/~mchoi ‒ Office: Lawernce St. Center LW-812 ‒ Office Hours: MW: 2:00[pm] – 3:30[pm] ‒ Graphics Lab: MF: 9:00[am] – 7:00[pm]  Prerequisites: CSCI-2421 – Data Structures and Program Design ‒ Co-requisites: N/A ‒ Required Knowledge-base: Trigonometry, Linear Algebra, C++, Graphics  Course Format: Hybrid (Online/Lecture) ‒ HW (Programming Assignments) 60% ‒ Final Project (Project Proposal/Implementation) 40%  Course Website: graphics.ucdenver.edu/SGPU/

Shader and GPU Programming  Required Textbook: OpenGL 4 Cookbook ‒ Author: David Wolff ‒ Publisher: Packt Publishing: 2 nd Revised Edition ‒ ISBN-10: ‒ ISBN-13: ‒ Recommended Textbooks: ‒ OpenGL SuperBible  Author: Graham Sellers, et al.  ISBN-10: ‒ Interactive Computer Graphics ‒ Author: Edward Angel and D. Shreiner  ISBN-10: ‒ OpenGL Shading Language  Author: Randi J. Rost et al.  ISBN-10:

Shader and GPU Programming  Course Objective: Build experience in shader programming and GPU programming using existing examples to produce high level, interactive, graphical applications.  Use existing examples to build high level interactive applications  C++/OpenGL Shading (Using newest OpenGL versions)  Qt-based Interactive GUI Applications  Final Project: Application in imaging, graphics, simulation, or virtual reality  Explore the history and development of shader development and the introduction of General Purpose GPU programming (GPGPU)  Introduction to shaders with the Graphics Library Shading Language (GLSL)  Shaders for general purpose parallel computation  Transition from shaders to GPGPU languages (OpenCL/CUDA)

Shader and GPU Programming  Course Topics: ‒ Graphics Pipeline and Rendering ‒ Graphics Processing Unit (GPU) Architecture ‒ 3D Mathematics and Modeling ‒ Graphics and Special Effect Shaders ‒ Lighting, Illumination, and Shadowing ‒ General Purpose GPU Parallel Programming (GPGPU) ‒ Applications:  Animation: Movies, Game design  Game Design: Graphics, Real-time rendering  Scientific Visualization: Data visualization, model visualization  Physical Simulation: Rigid bodies, deformable objects, fluids, etc.  Virtual Reality: Augmented reality, interactive visualization  GPGPU: Numerical Algorithms, Simulation, etc. Cloth Simulation [1]

Course Structure  Programming Assignments (60%) ‒ Programming in C++ with OpenGL (v. > 4.0) ‒ Provided Libraries  Mathematics (Templated Linear Algebra)  Graphics Library (Meshes, Texturing, etc.) ‒ Visual Studio 2013 ‒ Graphical User Interface (GUI) Programming  OpenGL/Qt  Final Project (40%) ‒ Project Proposal ‒ Project Implementation  Can be based on provided example code/shaders  Broader Application Domain (Graphics, Simulation, Virtual Reality, etc.) Grading Scale: % A/A % B/B – 79.9 % C/C – 69.9 % D/D+ < 60.0 % F

What is Shading? Crytek Engine

What is Shading? Unreal Engine 4 (UT4)

What is Shading? Game Engines  Target both visual effects and visual quality for real-time rendering  Extremely common terminology for describing ‘high-quality’ graphics  Massive form of parallel computation Animation  Generate high quality images  Photorealistic environments  Advanced Lighting  Complex Surface Materials  Surface Reflections UE4 High Fidelity Interior Render

What is Shading?  What is shading?  Initially: Perception of 3D objects ‒ Originally based in Lighting Modeling ‒ Rasterization of 3D objects with lighting ‒ Rendering realistic effects  Currently: Advanced 3D Effects ‒ Motion Blur/Depth of Field etc. ‒ Lighting/Light Rays/Bloom/Emission ‒ Shadowing ‒ Reflection/Refraction ‒ Bump mapping/Displacement Mapping etc.  What is a shader? ‒ A shader is a set of techniques and graphics resources that incorporate several graphics algorithms to be executed on a Graphical Processing Unit (GPU) to efficiently render environmental materials and complex visual effects in games, animation, virtual reality, and scientific visualization. Simple Lighting-based Shading (Sketch [vs] Rendered)

What is Shading?  Primitive Components of Shading ‒ Vertex Data (Loaded from Model)  Vertex Position – Position of every 3D point that the model is made of  Surface Normals – Defines the orientation of the surface for each face  Texture Coordinates – Defines how a texture is mapped to a surface  Color – Red, Blue, Green (RGB) color of each vertex ‒ Vertex Connectivity (Loaded from Model)  Triangles  Quads  Polygons ‒ Fragment Generation  Rasterization  Interpolation

(Fixed) Graphics Pipeline Overview Detailed Graphics Pipeline: From 3D model to 2D Screen display

(Fixed) Graphics Pipeline Overview CPUs and GPUs share resources but have very different execution models. Shaders provide a means of implementing massively parallel programs on a GPU.

Graphics Pipeline Overview What is Shading: Basic Shader Pipeline Process of rasterizing a shaded triangle and quad based on a set of vertex colors. All shaders have been derived from this simple principle.

(Programmable) Graphics Pipeline Overview The modifiable components within the graphics pipeline are the Vertex shader and the Fragment shader. These are the programmable sections of the graphics pipeline.

Programmable Graphics Shaders  Graphics Shaders ‒ Heavily rely on mathematical derivations of physical phenomenon ‒ Introduce textures and techniques for producing advanced effects ‒ Massively parallel computation for real-time applications ‒ Extensive amount of research for over 20 years ‒ Creativity + Math = Shader Design

Normal Mapping 1.) Design low-poly mesh 2.) Improve detail with high resolution 3.) Bake high resolution to normal texture 4.) Normal texture defines surface detail 5.) Fast high-quality models Modeling Applications: 3ds Max 2016 Z Brush 4

Parallax Mapping Parallax mapping provides the illusion of large surface offsets using a displacement texture. This technique has been used extensively in real-time applications and game design.

Displacement Mapping Displacement mapping illustrates the potential of real-time tessellation: the low poly mesh is subdivided during runtime to reproduce the visual quality of the high poly model.

Displacement Mapping Displacement mapping illustrates the potential of real-time tessellation: the low poly mesh is subdivided during runtime to reproduce the visual quality of the high poly model.

Advanced Lighting: Water Shaders Even 3D scenes composed of simplistic geometry and low resolution textures can be drastically improved using shaders (Minecraft)

Advanced Lighting: Water Shaders A primary research direction in shader programming has focused on the accurate rendering of water and fluids within physical simulations

Shader Library  Objective: Provide an implementation of all the basic graphics components required to load and view OpenGL shaders (Graphics + Mathematics). ‒ Provides high level abstractions to accelerate shader implementations  Shifts the focus from loading resources to writing GLSL code  Simplifies the process of writing high-level applications ‒ Shaders rely on complex data structures and initial calculations of various geometric properties  Surface Normals, Tangents, etc. ‒ Shaders require an extensive set of resources including models and textures  Model loading  Texture loading  Source code provided on course website

Graphics Library  Shader Library: A graphics library that facilitates the basic operations required for any interactive graphics application. This library includes the following components: ‒ 3D Camera: Provides the ability to change the view of the loaded 3D model. This is critically important for inspecting and viewing complex shader effects. ‒ Mesh Loading: Countless model file formats provide textual representations of 3D models. The provided implementation ‒ Shader Loading: The process of loading, compiling, and linking shaders can be simplified to build higher-level applications ‒ Texture Loading: All higher level shaders require textures of some kind. From lighting to normal mapping, to displacement mapping, parallax mapping and others

Mathematics Library  Templated Linear Algebra Library: A mathematics library that can be used by only copying and pasting it into a working project. The templated implementation allows for vectors and matrices of type float and double This library includes the following primary components: ‒ Vectors: Mathematical representations for points, displacements, surface normals, and directions. ‒ Matrices: Used to store rotations and transformations of 3D objects ‒ Quaternions: Used to represent rotations in 3D space as rotations in the complex plane. Used within most game engines and animation packages. ‒ Transformations: Provides an easy to use interface for moving, scaling, and rotating objects in 3D space

Programmable Shader Example (OpenGL 4.X) Programmable Shading: Standard Light Model Shader (Metal Teapot)  Example: Phong Lighting Model + Texture + Specular Map + Normal Map  Methodology used in many games, modeling, and animation software  Example: How to model, light, and texture a shaded 3D object  Implemented using the C++ source code for this course  Uses GLSL and the programmable graphics pipeline 1.Loaded Model Geometry (Teapot.obj) 2.No lighting 3.Diffuse Lighting (Single light source) 4.Specular Mapping (Surface highlights) 5.Normal + Specular Mapping (Surface roughness, Surface highlights)

Graphical Shader Overview Standard Light Model Shader (Teapot Geometry – No lighting)

Graphical Shader Overview Standard Light Model Shader (Textured)

Graphical Shader Overview Standard Light Model Shader (Diffuse Lighting)

Graphical Shader Overview Standard Light Model Shader (Specular Mapping)

Graphical Shader Overview Standard Light Model Shader (Bump Mapping + Specular Mapping)

Graphical Shader Overview Standard Light Model Shader Result (Bump Mapping + Specular Mapping)

Extending Shading to other Applications  Shading Not Limited to Graphics ‒ Lighting and Modeling in Simulation ‒ Procedural Textures ‒ Graphical Effects ‒ Scientific Visualization ‒ Augmented Reality

References [1] Duksu Kim et al. Hybrid Parallel Continuous Collision Detection using CPUs and GPUs, Computer Graphics Forum, [2] Unreal Engine 4, Free Materials Mini Pack, materials-mini-PACK, 2014.