Shading Languages GeForce3, DirectX 8 Michael Oswald.

Slides:



Advertisements
Similar presentations
Dx8 Pixel Shaders Sim Dietrich NVIDIA Corporation
Advertisements

Fragment level programmability in OpenGL Evan Hart
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
DirectX 8 and GeForce3 Christian Schär & Sacha Saxer.
Normal Map Compression with ATI 3Dc™ Jonathan Zarge ATI Research Inc.
Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)
Week 8 - Friday.  What did we talk about last time?  Radiometry  Photometry  Colorimetry  Lighting with shader code  Ambient  Directional (diffuse.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Graphics Hardware CMSC 435/634. Transform Shade Clip Project Rasterize Texture Z-buffer Interpolate Vertex Fragment Triangle A Graphics Pipeline.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
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.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
The Programmable Graphics Hardware Pipeline Doug James Asst. Professor CS & Robotics.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
Modern Graphics Hardware 2002 Vertex Programs Joe Michael Kniss.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Status – Week 277 Victor Moya.
Status – Week 276 Victor Moya. Hardware Pipeline Command Processor. Command Processor. Vertex Shader. Vertex Shader. Rasterization. Rasterization. Pixel.
ARB Fragment Program in GPULib. Summary Fragment program arquitecture New instructions.  Emulating instructions not supported directly New Required GL.
Status – Week 279 Victor Moya. Rasterization Setup triangles (calculate slope values). Setup triangles (calculate slope values). Fill triangle: Interpolate.
Status – Week 281 Victor Moya. Objectives Research in future GPUs for 3D graphics. Research in future GPUs for 3D graphics. Simulate current and future.
Vertex & Pixel Shaders CPS124 – Computer Graphics Ferdinand Schober.
Compilation, Architectural Support, and Evaluation of SIMD Graphics Pipeline Programs on a General-Purpose CPU Mauricio Breternitz Jr, Herbert Hum, Sanjeev.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
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.
Geometric Objects and Transformations. Coordinate systems rial.html.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Using Vertex Shader in DirectX 8.1 강 신 진
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.
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.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Blending, Modern Hardware.
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.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
VIS Group, University of Stuttgart Tutorial T4: Programmable Graphics Hardware for Interactive Visualization Programmable Graphics Hardware (Martin Kraus)
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
A User-Programmable Vertex Engine Erik Lindholm Mark Kilgard Henry Moreton NVIDIA Corporation Presented by Han-Wei Shen.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lab: Vertex Shading Chris Wynn Ken Hurley. Objective Hands-On vertex shader programming Start with simple programs … Part 1: Textured-Lit Teapot.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
David Luebke 1 1/25/2016 Programmable Graphics Hardware.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Pixel Shader  Based on nVIDIA’s GF3/4 architecture  Texture shader + register combiner texture unit 0texture program texture unit 1texture program texture.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
- Introduction - Graphics Pipeline
Programmable Pipelines
Hardware-Based Cell Projection
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
CS451Real-time Rendering Pipeline
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
Introduction to Programmable Hardware
Where does the Vertex Engine fit?
CS5500 Computer Graphics April 17, 2006 CS5500 Computer Graphics
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Presentation transcript:

Shading Languages GeForce3, DirectX 8 Michael Oswald

2 / 26 Shading Languages

GeForce3, DirectX 8 Michael Oswald

4 / 26 Shading Languages n Different approaches: u RenderMan n pure Software-solution u ISL n Interactive n Compiles ISL to OpenGL n Can be speed up by hardware u PixelFlow n Hardware-implementation n pfman generates C++-Code for OpenGL u GeForce3 n Own assembly-language for vertex- and pixel- shaders

Michael Oswald 5 / 26 DirectX 8.0 n Common Rendering-Pipeline Transform & Lighting RasterizationDisplay GenerationTraversal

Michael Oswald 6 / 26 DirectX 8.0 n DirectX8 Pipeline Transform & Lighting RasterizationDisplay GenerationTraversal Vertex- Shader Pixel-Shader

Michael Oswald 7 / 26 Vertex Shaders n Small assembler-programs executed per vertex n One input vertex generates one output vertex n No topological information u no edge, face, no neighbour-vertex information n Dynamically loadable

Michael Oswald 8 / 26 Vertex Shaders Vertex Attributes Vertex Program Vertex Output

Michael Oswald 9 / 26 Vertex Shaders Vertex Attributes Vertex Program Vertex Output 16x4 registers e.g. position, normals, lightvector, colors, densities, weights, velocities...

Michael Oswald 10 / 26 Vertex Shaders Vertex Attributes Vertex Program Vertex Output Program Parameters Temporary Registers A0 128 instructions 96x4 registers 12x4 registers

Michael Oswald 11 / 26 Vertex Shaders Vertex Attributes Vertex Program Vertex Output Program Parameters Temporary Registers A0 15x4 registers homogeneous clip space position, diffuse and specular color, up to 4 texture coordinates, fog value, point size

Michael Oswald 12 / 26 Vertex Shaders Language n Operand Modifiers: u Negation, „Swizzeling“, „Smearing“, Masking n Common commands u MOV, ADD, MUL, MIN, MAX n Special calculation-commands u MAD „multiply and add“  RCP „reciprocal“ of scalar-value 1/x  RCS „reciprocal square root“ 1/sqrt(x)

Michael Oswald 13 / 26 Vertex Shaders Language u EXP, LOG (accurate to ~11 Bits) n Vector calculations u DP33-Component dot-product u DP44-Component dot-product n Conditionals u SGESet greater or equal u SLTSet less than

Michael Oswald 14 / 26 Vertex Shaders Language n Lighting u LIT:calculates ambient, diffuse and specular lighting coefficients n Distance-vector u DSTcalculates a „distance attenuation“ vector (1, d, d², 1/d)

Michael Oswald 15 / 26 Vertex Shader Language n Macros: EXP, FRC, LOGfull precision but slow M3x2, M3x3, M3x4, M4x3, M4x4full matrix- multiplication n No branches! u Use SGE, SLT and multiply and accumulate

Michael Oswald 16 / 26 Pixel Shaders Pixel Hpos d0d1 TC0TC1TC2TC3 Pixel ALU color

Michael Oswald 17 / 26 Pixel Shaders Pixel t3 t2 t0 Hpos d0d1 TC0TC1TC2TC3 Pixel ALU t1 Stage3 Stage0 Stage2 Stage1 Texture Stages color texture

Michael Oswald 18 / 26 Pixel Shaders Pixel c0 t3 t2 t0 r1 c1 c2 c3 c7 c4... Hpos d0d1 TC0TC1TC2TC3 r0 Pixel ALU t1 Stage3 Stage0 Stage2 Stage1 Texture Stages temp color textureconstant

Michael Oswald 19 / 26 Pixel Shader Language n Define Constants: u DEF c#, x, y, z, w n Blending-Operations: u MOV, ADD, SUB,MUL, MAD, DP3 u CND D, R0.a, S1, S2 u LRP D, factor, S1, S2

Michael Oswald 20 / 26 Pixel Shader Language n Argument Modifiers u Alpha replicate, Invert, Negate, Bias, Signed Scale n Instruction Modifiers u Double Result, Quadruple Result, Halve Result, Saturate  Saturation can be used together with scaling: dp3_x2_sat r1, r0_bx2, t0_bx2

Michael Oswald 21 / 26 Pixel Shader Language n Texture Adressing Operations u Simple color-fetch: tex u Bump Env Map: texbem, texbeml u Turn coord into color: texcoord tDest u Kill Pixel: texkill

Michael Oswald 22 / 26 Pixel Shader Language n Matrix Calculation Operations texm3x2pad, texm3x2tex texm3x3pad, texm3x3spec, texm3x3vspec, texm3x3tex n Dependent texture-lookup texreg2ar texreg2gb

Michael Oswald 23 / 26 Vertex + Pixel Shader

Michael Oswald 24 / 26 Vertex + Pixel Shader

Michael Oswald 25 / 26 What to expect... n Extensive use of shading languages n More flexibility n More space for textures, matrices... n Faster Hardware n New bus-systems n Realtime Ray-Tracing?

Michael Oswald 26 / 26 The End