DirectX 8 and GeForce3 Christian Schär & Sacha Saxer.

Slides:



Advertisements
Similar presentations
Dx8 Pixel Shaders Sim Dietrich NVIDIA Corporation
Advertisements

Fragment level programmability in OpenGL Evan Hart
COMPUTER GRAPHICS SOFTWARE.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
High-Quality Unstructured Volume Rendering on the PC Platform High-Quality Unstructured Volume Rendering on the PC Platform Hardware Workshop 2002 Stefan.
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.
Normal Map Compression with ATI 3Dc™ Jonathan Zarge ATI Research Inc.
Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Hardware CMSC 435/634. Transform Shade Clip Project Rasterize Texture Z-buffer Interpolate Vertex Fragment Triangle A Graphics Pipeline.
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.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Shading Languages GeForce3, DirectX 8 Michael Oswald.
A Crash Course on Programmable Graphics Hardware Li-Yi Wei 2005 at Tsinghua University, Beijing.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
Status – Week 243 Victor Moya. Summary Current status. Current status. Tests. Tests. XBox documentation. XBox documentation. Post Vertex Shader geometry.
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
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.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
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 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
Status – Week 281 Victor Moya. Objectives Research in future GPUs for 3D graphics. Research in future GPUs for 3D graphics. Simulate current and future.
1 Copyright © 2001 Intel Corporation. * Other names and brands may be claimed as the property of others. Meltdown 2001 Optimizing DirectX* Graphic Applications.
Vertex & Pixel Shaders CPS124 – Computer Graphics Ferdinand Schober.
Lighting & Shading.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
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.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Using Vertex Shader in DirectX 8.1 강 신 진
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.
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.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Blending, Modern Hardware.
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.
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.
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
A User-Programmable Vertex Engine Erik Lindholm Mark Kilgard Henry Moreton NVIDIA Corporation Presented by Han-Wei Shen.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
GAM666 – Introduction To Game Programming ● Programmer's perspective of Game Industry ● Introduction to Windows Programming ● 2D animation using DirectX.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
Ray Tracing using Programmable Graphics Hardware
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
Pixel Shader  Based on nVIDIA’s GF3/4 architecture  Texture shader + register combiner texture unit 0texture program texture unit 1texture program texture.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Ying Zhu Georgia State University
Antigone Engine.
Programmable Pipelines
The Graphic PipeLine
A Crash Course on Programmable Graphics Hardware
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
Introduction to Programmable Hardware
Graphics Processing Unit
Where does the Vertex Engine fit?
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Presentation transcript:

DirectX 8 and GeForce3 Christian Schär & Sacha Saxer

Overview DirectX Direct3D 8 Vertex Shader Pixel Shader Hardware Support Conclusions Future

DirectX Components DirectDraw Direct3D DirectSound DirectMusic DirectShow DirectInput DirectPlay 2D Graphics API 3D Graphics API Sound API Music API Multimedia Streams API Input API Network API

Direct3D Hardware Abstraction Layer Classic Rendering Pipeline Vertex Shader Pixel Shader D3DX

Hardware Abstraction Layer

Classic Rendering Pipeline CreateVertexBuffer(); SetVertexShader(); SetStreamSource(); DrawPrimitive();

Vertex Shader Small assembly language program Replaces the Transformation and Lighting Engine Responsible for World and View transformations Is executed once per vertex Has no neighborhood information Prepares data for the Pixel Shader

Modified Rendering Pipeline

Vertex Shader Architecture 16 Input registers (r/o) 96 Constant registers (r/o) 12 Temp registers (r/w) 1 Address register (w/o) Output registers Max. 128 instructions

Vertex Shader Assembly Input: vn Vertex c[n] Constants an Address rn Temp Output: oPos Position oTn Texture oDn Color oFog/oPts

Vertex Shader Instructions  mov r, s0  add r, s0, s1  sub r, s0, s1  mul r, s0, s1  mad r, s0, s1, s2  rcp r, s0.w  rsq r, s0.w ; copy ; sum ; difference ; multiply ; multiply-add ; reciprocal ; reciprocal sqrt

Vertex Shader Instructions  dp3 r, s0, s1  dp4 r, s0, s1  min r, s0, s1  max r, s0, s1  slt r, s0, s1  sge r, s0, s1 ; 3D dot product ; 4D dot product ; per component ; 1.0 if less than ; 1.0 if greater/equal

Vertex Shader Instructions  expp r, s0.w  logp r, s0.w  lit r, s0, s1  dst r, s0, s1 ; partial prec. ; lighting fn ; distance fn

Register modifier Component Modifier  r.{x} {y} {z} {w}  r.[xyzw][xyzw][xyzw][xyzw]  -r Description Destination mask Source swizzle Source negation

Sample Vertex Shader vs.1.1 m4x4 r0, v0, c[CV_WORLD_0] m4x4 oPos, r0, c[CV_VIEWPROJ_0] m3x3 r1, v3, c[CV_WORLD_0] dp3 r1.x, r1, c[CV_LIGHT] max r1.1, r1.x, c[CV_ZERO].x mul r1, r1.x, c[CV_DIFUSE] add r1, r1, c[CV_AMBIENT] min r1, r1, c{CV_ONE].x mov oD0.x, r1.x mov oD0.y, r1.x mov oD0.z, r1.x

Pixel Shader Small assembly language program Replaces the Texturing and Lighting Engine Is executed once per pixel Has no neighborhood information Does further calculations on the Vertex Shader ’ s output The output is the color of the pixel

Modified Rendering Pipeline

Pixel Shader Architecture TexAddrOp 0 TexAddrOp 1 TexAddrOp 2 TexAddrOp 3 Triangle Rasterizer 8 Texture Blend Ops Specular / Fog Computed Alpha Blending Dx8 Pixel Shaders

Pixel Shader Assembly Input: vn Vertex color tn Texture cn Constants Output: rn Temp r0 Output color

Pixel Shader Instructions  mov r, s0  add r, s0, s1  sub r, s0, s1  mul r, s0, s1  mad r, s0, s1, s2 ; copy ; sum ; difference ; multiply ; multiply-add

Pixel Shader Instructions  dp3 r, s0, s1  lrp r, s0, s1, s2  cnd r, r0.a, s1, s2  sub r0, v0, v1_bias cnd r0, r0.a, c0, c1 ; 3D dot product ; lin. interp. blend ; r= r0.a>0.5 ? s1 : s2 ; r= v0 > v1 ? c0 : c1

Texture Instructions  tex t  texbem t  texbeml t, s  texcoord t  texkill t  texm3x2pad t, s  texm3x2tex t, s  texm3x3pad t, s  texm3x3tex t, s  texm3x3spec t, s0, s1  texm3x3vspec t, s  texreg2ar t, s  texreg2gb t, s ; normal sample ; bumped env. mapping ; … with Luminance ; sample tex. coords. ; black, if coords < 0 ; Matrix multiplications ; ; … +refl. +env. map. ; ; use s.ar as coords. ; use s.gb as coords.

Sample Texture Instructions  tex t  texm3x2pad t0, s  texm3x2tex t1, s  tex t0  texm3x3pad t1, t0  texm3x3pad t2, t0  texm3x3spec t3, t0, c0  mov r0, t3 ; put texture col. into t ; 3x2 matrix multiplication ; get normal vector from t0 ; eye-ray vector from c0 ; cube env. texture from t3 ; do env. mapping ; output color

Modifiers Component Modifier  r.{a} {rgb}  1-r  -r  r_bias  r_bx2 Description Source/Destination mask Invert Negate , *2

Modifiers Instruction Modifier  _x2  _x4  _d2  _sat Description multiply result by 2 multiply result by 4 divide result by 2 cramp result

Sample Pixel Shader ps.1.1 tex t1 mov r0, t1 ; use texture color mov r0.a, v0 ; get diffuse lighting from ; vertex interpolation

D3DX Mesh Optimizing adjacency required sort by attribute compact progressive meshes

D3DX Progressive Meshes different levels of detail (LOD) half edge collapse cloning by sharing of vertex buffers streamable save method OptimizeBaseLOD TrimByVertices/TrimByFaces

D3DX Skinned Meshes vertex data, bone data with vertex indices support for.X files export filters for Maya, 3D Studio Max available up to 4 indices per vertex up to 12 indices per face up to 256 bone palettes ConvertToBlendedMesh() reduces to this constraints ConvertToIndexBlendedMesh() same, but less subsets Uses GeForce ’ s restricted skinning support by rendering a prefix in hardware.

Conclusions very flexible tool hardware accelerated low level interface (assembly) vertex shaders theoretically applicable to point-sampled geometry rendering of shadows needs lots of work

What ’ s next? subdivision surfaces in hardware (TruForm technology by ATI) displacement maps

References MSDN (Microsoft Developer Network) NVIDIA Whitepapers –Introduction to Vertex Shaders –Introdction to Pixel Shaders