Geometric Objects and Transformations. Coordinate systems rial.html.

Slides:



Advertisements
Similar presentations
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
Advertisements

Perspective aperture ygyg yryr n zgzg y s = y g (n/z g ) ysys y s = y r (n/z r ) zrzr.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Real-time Dynamic HDR Based Lighting in a Static Environment Marcus Hennix Daniel Johansson Gunnar Johansson Martin Wassborn.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Introduction to Shader Programming
GPUGI: Global Illumination Effects on the GPU
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
The programmable pipeline Lecture 10 Slide Courtesy to Dr. Suresh Venkatasubramanian.
Vertex & Pixel Shaders CPS124 – Computer Graphics Ferdinand Schober.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
GAM532 DPS932 – Week 1 Rendering Pipeline and Shaders.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
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)
CSE 381 – Advanced Game Programming Basic 3D Graphics
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Week 2 - Wednesday CS361.
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 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Matrices from HELL Paul Taylor Basic Required Matrices PROJECTION WORLD VIEW.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
1 Dr. Scott Schaefer Programmable Shaders. 2/30 Graphics Cards Performance Nvidia Geforce 6800 GTX 1  6.4 billion pixels/sec Nvidia Geforce 7900 GTX.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
Real-time Shadow Mapping. Shadow Mapping Shadow mapping uses two-pass rendering - render depth texture from the light ’ s point-of-view - render from.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
GAM532 DPS932 – Week 2 Vertex Shaders. The Shader Pipeline Vertex Processing Primitive Assembly / Processing Rasterization Fragment Process Pixel Output.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
2009 GRAPHICS : PROJECT 1 BASED ON DX9 BASICS. Documented by Dongjoon Kim SNU CS Ph.D Course Student Contact : NOTE.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
Ray Tracing using Programmable Graphics Hardware
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The GPU.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
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.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
- Introduction - Graphics Pipeline
Programmable Shaders Dr. Scott Schaefer.
Programmable Pipelines
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Introduction to Computer Graphics with WebGL
UMBC Graphics for Games
Chapter VI OpenGL ES and Shader
Graphics Processing Unit
Lecture 13 Clipping & Scan Conversion
Computer Graphics Practical Lesson 10
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
OpenGL-Rendering Pipeline
Presentation transcript:

Geometric Objects and Transformations

Coordinate systems rial.html

Clockwise = Front Face

The DirectX 10 Pipeline Stage 1: Model Space -> World Space

The DirectX 10 Pipeline Stage 2: World Space -> Camera Space (Not done in OpenGL 2.x)

The DirectX 10 Pipeline Stage 3: Camera Space -> Projection Space

The DirectX 10 Pipeline Stage 4: Change the Clipping Matrix (If you are not using the std Projection Matrix)

The DirectX 10 Pipeline Stage 5: Clipping (Not a Matrix!)

The DirectX 10 Pipeline Stage 6: Projected Space -> Clipping Space (Flips the Y-Axis)

The DirectX 10 Pipeline Stage 7: Projected Space -> Screen Space (Coordinates passed to the rasterizer)

Up till Dx9 this was all done for us... With the new approach to Rendering, NOTHING is default Need to write our own: – Geometry Shader (Optional) – Vertex Shader – Pixel Shader – Code to run the Combined Vertex Shader + Pixel Shader on the GPU (Effect)

HLSL High Level Shader Language, the Dx only solution. Cg, the Nvidia Dx / GL solution GLSL, the GL only solution

What about a real Vertex Shader? matrix World; matrix View; matrix Projection; VS_OUTPUT VS( float4 Pos : POSITION, float4 Color : COLOR ) { VS_OUTPUT output = (VS_OUTPUT)0; output.Pos = mul( Pos, World ); output.Pos = mul( output.Pos, View ); output.Pos = mul( output.Pos, Projection ); output.Color = Color; return output; }

Our Super Cheap Vertex Shader float4 VS( float4 Pos : POSITION ) : SV_POSITION { return Pos; } The Colon: sets the semantics of the data (metadata)

Geometry Shaders WTF? Grass Water Fur +ve Less Bus Data Less CPU + Memory usage -ve More GPU Load No Dx9 or below compatibility (Who cares!)

Vertex Shader Base Functions: – World – View – Projection Transformation Extensions: – Water Movement – Plant movements – Object Morphing

Pixel (Fragment) Shader Colouring Simple texturing Cell shading Normal mapping Particle effects Alpha blending Etc!

Semantics (metadata) There are so few data types in GPU programming (Typically just a load of floats) Using Semantics we can specify the intended purpose of the variables What does this do: float3 pos : POSITION; Creates 3x floats to store the xyz + tells HLSL the floats are used as a position

Semantics What about: float4x4 wvp : WORLDVIEWPROJ...

float4 PS( float4 Pos : SV_POSITION ) : SV_Target { return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // BGRA }

In both OpenGL and Direct3D Z is the depth of the viewport!!!! hence the Z-buffer (Depth Buffer)

Z Buffer Depth – Due to the scalar nature of the Pyramid Viewport – Depth precision drops as the distance between the Near and Far planes are moved apart – This will result in more artefacts and visual errors

Viewport types Orthogonal – No depth perception (scaling) Projected – This is the typical 3D viewport Objects \ Vertices are scaled and rotated based on the ‘virtual’ distance from the screen

References