510 likes | 738 Views
Multimedia Seminar. DirectX – use und concepts. structure. development / definition parts of DirectX versions concepts perspective. review – MS DOS. Application had exclusive access to the hardware Programming in consideration of different hardware configurations required.
E N D
Multimedia Seminar DirectX – use und concepts
structure • development / definition • parts of DirectX • versions • concepts • perspective
review – MS DOS • Application had exclusive access to the hardware • Programming in consideration of different hardware configurations required
review - Windows 95 • multitasking • ressources had to be shared • poor performance in MM applications
definition • what is DirectX • as direct as possible • as fast as possible • as decent as possible
alternatives • OpenGL • 3dfx Glide
structure • development / definition • parts of DirectX • versions • concepts • perspective
DirectX Components • DirectGraphics • DirectAudio • DirectVideo • DirectPlay • DirectInput • DirectShow
structure • development / definition • parts of DirectX • versions • concepts • perspective
versions • development course of the versions • important features
DirectX 1 • published 1995 with Win95 • DirectDraw, DirectInput, DirectSound, DirectPlay • no support for 3D Graphics yet
DirectX 2 • published 1996 • introduction of Direct3D • creation of simple vector graphics
DirectX 3 • DirectSound-3D extension for DirectSound • support for Intels MMX extensions
DirectX 5 • many new extensions -> skipped V4 • force Feedback input devices • hardwaresupport for 3D Audio • introduction DirectX Media • 3D API updated
DirectX 6 • further 3D extensions (effects, texture compression, …) • integration 3Dnow • updated MMX support • introduction of DirectMusic API
DirectX 7 • further 3D API updates (Vertex Blending, Cubic Environment Mapping, …) • MS Visual Basic Interface
DirectX 8 • 3D API extensions (point sprites to design rain or snow, …) • support for Vertex Shader • D3D & DirectDraw -> DirectGraphics, DirectSound & DirectMusic -> DirectAudio
DirectX 9 (actual version) • HLSL • performance enhancements in Vertex- and Pixelshader • more exact calculations in D3D API • interface to Visual Studio .NET development environment
DxDiag • test DirectX functions • display system hardware
Shader • Definitions: • Shader • Pixel • Vertex
Vertex Shader • geometric calculations • no creation but transformation • used before Pixel Shader • possible parameter passing
Pixel Shader • adressing of textures • color and transparency calculation • using parameters passed by the Vertex Shader for calculations • SIMD
Shader programming pre-DirectX9 • Complex visual effects had to be implemented in assembler 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
Shader programmingDirectX 9 • HLSL / Cg • differences • concept of HLSL/Cg (profiles) • benefits
Shader programming inHLSL / Cg • using known C/C++ constructs float4 cSpec = pow(max(0, dot(Nf, H)), phongExp).xxx; float4 cPlastic = Cd * (cAmbi + cDiff) + Cs * cSpec;
examples for effects • Environment Bump Mapping
Structure of the DirectX APIs • DirectX Media • DirectX Foundation
structure • development / definition • parts of DirectX • versions • concepts • perspective
Direct X - concepts • HAL and HEL • „Pseudo Einprozess System“ • filter concept
HAL und HEL • concept for programming without knowledge of the hardware
„Pseudo“ single process system • more effective hardware usage by exclusive access • release of control over hardware in case of request by other components • already used by MS Game SDK, Vorgänger of DirectX
filter concept in detail • used for processing streams, for example in DirectShow • uses module architecture for stream processing -> flexible usage • modules presented by filter • filter types: source~, transform~, rendering~, effect~, splitter~.
FilterGraph • GraphEdit
supported development environments • Visual C and C++ • Borland C++ • MS Visual Basic • Borland Delphi • Smalltalk MT • Java
DirectX Programming • DirectX SDK as free download available, which contains the programming interfaces • programming based on Component Object Model
COM • client-server architecture • used to import (make available) classes • reusability • many DirectX SDK functions can be reached by COM
COM server • provides exportable classes (COM objects) • COM objects contain the code and are defined by the COM interface • 3 different server types:In-Process-Server, Local Server, Remote Server
COM – in process server • COM object implemented in DLL file • fast access • every process using a COM object has to load it in the memory -> high memory usage
COM - local server • executable Windows programs which implement the COM-Objects • Start of these programs in case of request of an implemented object • communication via RPC-protocol (remote procedure call) -> slow • once loaded, a local server can provide several clients -> low memory usage
COM - remote server • used if server and client are connected by a network • uses DCOM (distributed COM) • also using RPC -> slow access • insecure RPC implementation in DCOM made W32.Blaster attack possible
COM client • uses functions of the COM server • knows the possible functions, declared in the interface • conversation between server and client is done by the marshaler (which can e.g. convert data types)
COM interface • represents a pointer referencing functions of the COM object • each Interface has a unique ID (GUID – global unique identifier) • has to be implemented in a specific IDL (Interface Definition Language) • COM objects live as long as there exist references to their interface
structure • development / definition • parts of DirectX • versions • concepts • perspective
perspective – DirectX Next • release expected 2005 together with Longhorn • unified shaders • PPP - Programmable Primitive Processor • Framebuffer access by shader • virtual memory management • integer instruction set
Questions ? ? ? ? ? ?
The end Thanks for your attention