Shading CMSC 435/634.

Slides:



Advertisements
Similar presentations
Perspective aperture ygyg yryr n zgzg y s = y g (n/z g ) ysys y s = y r (n/z r ) zrzr.
Advertisements

Michael I. Gold NVIDIA Corporation
Bump Mapping CSE 781 Roger Crawfis.
Graphics Pipeline.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
Informationsteknologi Wednesday, December 12, 2007Computer Graphics - Class 171 Today’s class OpenGL Shading Language.
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Status – Week 277 Victor Moya.
Hardware-Based Nonlinear Filtering and Segmentation using High-Level Shading Languages I. Viola, A. Kanitsar, M. E. Gröller Institute of Computer Graphics.
Twelve painting with procedures. Overview Making shaded images with procedures Making a more elegant language Making textures with noise functions.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
David Runyon Lauren Stana Kelsey Vaughn Molly Shelestak.
Procedural Textures.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Real-time Graphical Shader Programming with Cg (HLSL)
Noise and Procedural Techniques John Spitzer Simon Green NVIDIA Corporation.
Geometric Objects and Transformations. Coordinate systems rial.html.
GPU Shading and Rendering Shading Technology 8:30 Introduction (:30–Olano) 9:00 Direct3D 10 (:45–Blythe) Languages, Systems and Demos 10:30 RapidMind.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
Interactive Rendering of Meso-structure Surface Details using Semi-transparent 3D Textures Vision, Modeling, Visualization Erlangen, Germany November 16-18,
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.
A Crash Course in HLSL Matt Christian.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
Shading CMSC 435/634.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
GPU Shading and Rendering: OpenGL Shading Language Marc Olano UMBC.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
OpenGL Shading Language
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.
Computer Graphics Overview
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
Ying Zhu Georgia State University
Photorealistic Rendering vs. Interactive 3D Graphics
Programmable Pipelines
painting with procedures
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Real-time Computer Graphics Overview
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Reflections from Bumpy Surfaces
UMBC Graphics for Games
UMBC Graphics for Games
Graphics Processing Unit
Introduction to Computer Graphics
Programming with OpenGL Part 3: Shaders
Debugging Tools Tim Purcell NVIDIA.
RADEON™ 9700 Architecture and 3D Performance
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
CS 480/680 Computer Graphics GLSL Overview.
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

Shading CMSC 435/634

RenderMan Displacement Surface Light Volume Imager

Displacement Given Compute Position Normal Displacement Surface Light Volume Imager

Surface color Given Compute Position Color Opacity Surface Displacement Surface Light Volume Imager

Lighting Given Compute Surface Position Light Direction Light Color Displacement Light Surface Volume Imager

Volume Effects Given Compute Position Color New Color Volume Displacement Surface Light Volume Imager

Image Effects Given Compute Pixel Color Imager Displacement Surface Light Volume Imager

Non-real time vs. Real-time RenderMan GPU Application Application Texture/ Buffer Displacement Vertex Light Surface Geometry Volume Imager Fragment Displayed Pixels Displayed Pixels

RenderMan vs. GPU RenderMan GPU Developed from General CPU code Seconds to hours per frame 1000s of lines “Unlimited” computation, texture, memory, … GPU Developed from fixed-function hardware Tens of frames per second 1000s of instructions Limited computation, texture, memory, …

History (not real-time) Testbed [Whitted and Weimer 1981] Shade Trees [Cook 1984] Image Synthesizer [Perlin 1985] RenderMan [Hanrahan and Lawson 1990]

History (real-time) Custom HW [Olano and Lastra 1998] Multi-pass standard HW [Peercy, Olano, Airey and Ungar 2000] Register combiners [NVIDIA 2000] Vertex programs [Lindholm et al. 2001] Compiling to mixed HW [Proudfoot et al. 2001] Fragment programs Standardized languages Compute

GLSL / HLSL Vertex, Geometry & Fragment/Pixel C-like, if/while/for Structs & arrays Float + small vector and matrix vec2, vec3, vec4, mat2, mat3, mat4 Swizzle & mask (a.xyz = b.xxw)

GLSL / HLSL Common math & shading functions Trigonometric, exponential, min, max, abs, … length, distance, normalize, dot, cross mix(a, b, t) clamp(t, a, b) step(a, t), smoothstep(a, b, t) reflect, refract

Shader Debugging Render as color Hot reloading Remap debug values Map intermediate values to 0-1 Interpret results Hot reloading Make changes without changing viewpoint Remap debug values vec4(-sign(x), sign(x), abs(x), 1) x / (1 + abs(x)) External debugging tools

Vertex Demo: Blend Positions

Vertex + Fragment Demo: Fresnel Environment Map

Shading Methods Repeating Patterns Shapes Color tables mod, sin Divide and floor Shapes Implicit form: is this pixel inside Color tables Noise or computed patterns

Brick Demo mortar brick gap height width gap

Noise Controlled, repeatable randomness Still spotty GPU implementation Can use texture or compute

Noise Characteristics Repeatable Locally continuous but distant points uncorrolated Values RenderMan [0,1], average 0.5 Perlin’s [-1,1], average 0 1/2 – 1 cycle per unit Versions for 1D-4D input

Noise Subtleties Many noise functions based on a lattice Piecewise function between integer coordinates Hash of integer coordinates  control points Interpolating values easy but poor Even with higher-order interpolation Perlin’s noise Passes through 0 at each integer Hash gives gradient

Perlin Noise in RenderMan Ci = float noise(floor(1/t)*P); 1 2 3 4 5 6 7 8 12 13 9 14 15 16 20

Fractional Brownian Motion (fBm) // Combine octaves, scaled by 1/f for(f=1; f<=floor(1/t); f*=2) Ci += (float noise(f*P)-.5)/f; Ci += .5; 1 2 3 4 5 6 7 8 12 13 9 14 15 16 20

Turbulence // fBm using abs(noise) for(f=1; f<=floor(1/t); f*=2) Ci += abs(float noise(f*P)-.5)/f; Ci += .5; 1 2 3 4 5 6 7 8 12 13 9 14 15 16 20

Advanced Shading Methods Perturbed patterns Adjust position, radius, etc. with noise Bombing Divide space into cells Compute random position in each cell Check if pixel is inside shape Blending Fade effects in and out with smoothstep