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

COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Bump Mapping CSE 781 Roger Crawfis.
Graphics Pipeline.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
Reflections from Bumpy Surfaces GPU Graphics. What are we trying to achieve?  Most surfaces are not flat like glass  Some of these surfaces still give.
GLSL I May 28, 2007 (Adapted from Ed Angel’s lecture slides)
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
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.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
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.
David Runyon Lauren Stana Kelsey Vaughn Molly Shelestak.
Interactive Terrain Synthesis
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.
CS 480/680 Computer Graphics Shader Applications Dr. Frederick C Harris, Jr. Fall 2011.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
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.
Shader Applications Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
CS418 Computer Graphics John C. Hart
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
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.
Ying Zhu Georgia State University
Programmable Pipelines
painting with procedures
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
Shading CMSC 435/634.
Reflections from Bumpy Surfaces
UMBC Graphics for Games
UMBC Graphics for Games
Graphics Processing Unit
Programming with OpenGL Part 3: Shaders
RADEON™ 9700 Architecture and 3D Performance
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

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

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);

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;

Turbulence // fBm using abs(noise) for(f=1; f<=floor(1/t); f*=2) Ci += abs(float noise(f*P)-.5)/f; Ci += .5;

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

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(a, b, t) step(a, t), smoothstep(a, b, t) reflect, refract

Shader Debugging Render as color Hot reloading Conditional shading Map intermediate values to 0-1 Interpret results Hot reloading Make changes without changing viewpoint Conditional shading My favorite: vec4(-sign(x), sign(x), abs(x), 1) External debugging tools

Brick Demo mortar brick gap height width gap

Vertex Demo: Blend Positions

Vertex + Fragment Demo: Fresnel Environment Map

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