Teaching Cg. Real-Time Graphics Has Come a Long Way Virtua Fighter (SEGA Corporation) NV1 50K triangles/sec 1M pixel ops/sec 1995 Dead or Alive 3 (Tecmo.

Slides:



Advertisements
Similar presentations
GPGPU Programming Dominik G ö ddeke. 2Overview Choices in GPGPU programming Illustrated CPU vs. GPU step by step example GPU kernels in detail.
Advertisements

Lecture 1: Introduction
Lecture 1 – Introduction, Overview
Debugging Tools Tim Purcell NVIDIA. Programming Soap Box Successful programming systems require at least three ‘tools’ Successful programming systems.
Multimedia Seminar DirectX – use und concepts. 2 structure development / definition parts of DirectX versions concepts perspective.
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
CS-378: Game Technology Lecture #9: More Mapping Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
ICS 415Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Introduction Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem March 1, 2009.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Cg Overview Cg is the High Level language from NVIDIA for programming GPUs, developed in close collaboration with Microsoft Cg is 100% compatible with.
Gearbox Software PRODUCTION PIPELINE – JOBS TITLES – JOB DESCRIPTIONS.
A Games Class Using XNA Game Studio Express Art Gittleman California State University Long Beach
Realtime 3D Computer Graphics Computer Graphics Computer Graphics Software & Hardware Rendering Software & Hardware Rendering 3D APIs 3D APIs Pixel & Vertex.
Cg – C for Graphics Eric Vidal CS 280. History General graphics processing languages – Renderman shading language (1988) Assembly languages for graphics.
CSU0021 Computer Graphics © Chun-Fa Chang CSU0021 Computer Graphics September 10, 2014.
COMP4070 Computer Graphics Dr. Amy Zhang. Welcome! 2  Introductions  Administrative Matters  Course Outline  What is Computer Graphics?
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 16 Computer Graphics Course Introduction.
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.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Real-time Graphical Shader Programming with Cg (HLSL)
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
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.
Computer Graphics Tz-Huan Huang National Taiwan University.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
Real-Time Shading Using Programmable Graphics Hardware Introduction, Setup and Examples Wan-Chun Ma National Taiwan University.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics Ed Angel Professor Emeritus of Computer.
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,
Computational Biology 2008 Advisor: Dr. Alon Korngreen Eitan Hasid Assaf Ben-Zaken.
Windows, Linux, Mac, Android, iOS
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
NVIDIA CONFIDENTIAL Hardware Shading for Artists.
GPGPU Tools and Source Code Mark HarrisNVIDIA Developer Technology.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
The Cg Runtime Cyril Zeller. Cg Pipeline Graphics programs are written in Cg and compiled to low-level assembly code... Cg Runtime API...
Computer Software Types Three layers of software Operation.
Havok FX Physics on NVIDIA GPUs. Copyright © NVIDIA Corporation 2004 What is Effects Physics? Physics-based effects on a massive scale 10,000s of objects.
David Luebke 1 1/20/2016 Real-Time Rendering CS 446 David Luebke.
GAM666 – Introduction To Game Programming ● Programmer's perspective of Game Industry ● Introduction to Windows Programming ● 2D animation using DirectX.
David Luebke 1 1/25/2016 Programmable Graphics Hardware.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
CSc 4841/6841 Computer Animation Lecture 2 Overview of 3D Computer Graphics.
How to use a Pixel Shader CMT3317. Pixel shaders There is NO requirement to use a pixel shader for the coursework though you can if you want to You should.
Building Comfort With MATLAB
Chapter 1 An overview on Computer Graphics
Introduction to Visual Basic 2008 Programming
Chapter 1 An overview on Computer Graphics
CS 4722 Computer Graphics and Multimedia Spring 2018
Chapter 6 GPU, Shaders, and Shading Languages
CSc 4820/6820 Computer Graphics Algorithms Lecture 2
Introduction and Overview
CIS16 Application Development – Programming with Visual Basic
Unit 20 Software Part 2.
Overview Course Overview Course Webpage Administrative issues
Unit 20 Software Part 2.
Introduction to Computer Graphics
CS5500 Computer Graphics April 17, 2006 CS5500 Computer Graphics
Debugging Tools Tim Purcell NVIDIA.
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Graphics Processing Unit
Presentation transcript:

Teaching Cg

Real-Time Graphics Has Come a Long Way Virtua Fighter (SEGA Corporation) NV1 50K triangles/sec 1M pixel ops/sec 1995 Dead or Alive 3 (Tecmo Corporation) Xbox (NV2A) 100M triangles/sec 1G pixel ops/sec 2001Dawn (NVIDIA Corporation) GeForce FX (NV30) 200M triangles/sec 2G pixel ops/sec 2003

The Motivation for Cg increasingly more powerful Graphics hardware has become increasingly more powerful assembly code is hard Programming powerful hardware with assembly code is hard more than 1,000 assembly instructions long GeForce FX supports programs more than 1,000 assembly instructions long high-level language Programmers need the benefits of a high-level language: Easier programming Easier code reuse Easier debugging Assembly … DP3 R0, c[11].xyzx, c[11].xyzx; RSQ R0, R0.x; MUL R0, R0.x, c[11].xyzx; MOV R1, c[3]; MUL R1, R1.x, c[0].xyzx; DP3 R2, R1.xyzx, R1.xyzx; RSQ R2, R2.x; MUL R1, R2.x, R1.xyzx; ADD R2, R0.xyzx, R1.xyzx; DP3 R3, R2.xyzx, R2.xyzx; RSQ R3, R3.x; MUL R2, R3.x, R2.xyzx; DP3 R2, R1.xyzx, R2.xyzx; MAX R2, c[3].z, R2.x; MOV R2.z, c[3].y; MOV R2.w, c[3].y; LIT R2, R2;... float3 cSpecular = pow(max(0, dot(Nf, H)), phongExp).xxx; float3 cPlastic = Cd * (cAmbient + cDiffuse) + Cs * cSpecular;

The High-Level Language for Graphics The High-Level Language for Graphics open-source Cg is an open-source high-level shading language to make graphics programming faster and easier C-like language and a compiler Cg replaces assembly code with a C-like language and a compiler Cg was developed in close collaboration with Microsoft and is syntactically equivalent to HLSL, the shading language in DirectX 9 cross-APIOpenGL & DirectXcross-platformWindows, Linux, and Mac OS Cg is cross-API (OpenGL & DirectX) and cross-platform (Windows, Linux, and Mac OS) Cg is a key enabler of cinematic computing The biggest revolution in graphics in 10 years, and the foundation for the next 10. Kurt Akeley (on Cg & CineFX) Graphics Architect, NVIDIA Co-founder of SGI Designer of OpenGL

How Cg Works Shaders are created Shaders are created (from scratch, from a common repository, or modified from other shaders) modeling in Digital Content Creation (DCC) applicationsrendering in other applications These shaders are used for modeling in Digital Content Creation (DCC) applications or rendering in other applications The Cg compiler The Cg compiler compiles the shaders to a variety of target platforms, including APIs, OSes, and GPUs

Why Teach Cg? programmabilityperformance Cg targets the right level of programmability and performance what happens at the surface It allows students to focus on what happens at the surface of an object state management OpenGL / DirectX forces students to focus on state management, not algorithms not interactive Software rendering is generally not interactive topics outside of graphics, such as: Students can also use Cg to explore topics outside of graphics, such as: GPU-accelerated physics Collision detection Chemical Simulation …

Why Teach Cg? basic diffuse lighting Lets look at a simple example: basic diffuse lighting N dot L calculation The N dot L calculation is the key computer graphics concept being taught OpenGL or DirectX the GPU calculates N dot L With OpenGL or DirectX, you set state for the material and light colors, but then the GPU calculates N dot L invisibly for you you get to write the shader With Cg, you get to write the shader that performs the N dot L calculation escape the fixed-function rendering pipelines limitations Cg also allows you to escape the fixed-function rendering pipelines limitations

Why Teach Cg? Students who learn Cg can apply their skills in a variety of situations Graphics APIs OpenGL DirectX Operating Systems Windows Linux Mac OS Graphics Hardware NVIDIA GPUs ATI GPUs Other GPUs that support OpenGL and DirectX 9 Linux Mac OS X OpenGL DirectX 9.0 compliant GPU DirectX 8.0 compliant GPU Actual Screenshots of Same Shader on Different Platforms (2 of 5 on ATI Hardware)

Why Teach Cg? Cg is integrated with the major DCC and CAD applications 3ds max 5 Maya 4.5 SOFTIMAGE|XSI 3.0 SolidWorks Digital Immersion Mental Images Next Version of SolidWorks, Using Cg Rendered with Cg (Courtesy of Alias|Wavefront)

Cg Integration in DCC Rendering Pipelines Direct Cg Code Editing and Compilation Images courtesy Alias|Wavefront, discreet, and Softimage|XSI

Comprehensive Documentation NVIDIA Cg Compiler Cg Standard Library Cg Runtime Libraries for DirectX and OpenGL NVIDIA Cg Browser Cg Language Specification Cg Users Manual Cg Shaders (assorted pre-written programs)

The Cg Tutorial Book

The first book about hardware shading to: graphics concepts Discuss graphics concepts thoroughly complete examples Provide complete examples complete hands-on framework Provide a complete hands-on framework to try and modify the examples, out-of-the- box end-of-chapter exercisesfurther reading Includes end-of-chapter exercises and further reading

The Cg Tutorial Book Available now, online and in bookstores Book Web site: Includes: Links to excerpts Purchasing information Software updates Teaching Resources Supplementary Material Errata

Cg in Universities and Research Universities: Harvard MIT Caltech Stanford Purdue Brown University University of Illinois University of Texas, Austin University of North Carolina Utah Government Labs: NCSA Sandia Cg is a great tool for developing hardware accelerated graphics software for applications such as procedural modeling, simulating natural phenomena, exploring interactive advanced shading and rendering, and visualizing scientific and medical data. Dr. David S. Ebert Purdue University

Fitting Cg into a Course Curriculum graphics courses Cg is appropriate for introductory or advanced graphics courses Introductory courses Introductory courses can use The Cg Tutorial as a primary textbook, or as a textbook for a segment of the course about Real-Time Graphics Advanced courses Advanced courses can use Cg as the language to experiment in, with The Cg Tutorial as a supplementary textbook (much like the OpenGL Programming Guide would often be) Real-time 3D graphics courses Real-time 3D graphics courses will probably focus on Cg, and The Cg Tutorial will be an ideal textbook for these coresupplementary The Cg Tutorial fits well as a core or supplementary textbook complete software framework The complete software framework is a great base to build assignments on