DX4 - DirectX Programming #4 Kang, Seongtae Computer...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
DirectX Programming #4 Kang, Seongtae Computer Graphics, 2009 Spring
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programmable Shader For recent hardwares, vertex and pixel processing stage of the graphics pipeline is programmable Programmable Vertex Shader Programmable Pixel Shader Geometry processing also programmable since D3D10
Background image of page 2
Programming for Shader In early stage, hardware-dependant mnemonic language is used to program for shader Shader Assembler Currently, C-like shading language is widely used Cg, HLSL, GLSL General programming platform to utilize GPU’s computing power for general purpose is being introduced lately NVIDIA CUDA OpenCL
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Brief History on Programmable Shader Pixar RenderMan Interface Specification (1988) Concept of Shader Language(SL) is introduced Required special-purpose hardwares and used for studio works Luxo Jr. (SIGGRAPH, 1986)
Background image of page 4
Brief History on Programmable Shader Programmable shader for consumer hardware Microsoft DirectX 8 (Shader Model 1.1) Shader assembler is introduced for vertex and pixel shader programmability
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Brief History on Programmable Shader NVIDIA Cg (1998) Introduced to program NVIDIA’s programmable GPU C-like grammar with reserved keywords // input vertex struct VertIn { float4 pos : POSITION; float4 color : COLOR0; }; // output vertex struct VertOut { float4 pos : POSITION; float4 color : COLOR0; }; // vertex shader main entry VertOut main(VertIn IN, uniform float4x4 modelViewProj) { VertOut OUT; OUT.pos = mul(modelViewProj, IN.pos); // calculate output coords OUT.color = IN.color; // copy input color to output OUT.color.z = 1.0f; // blue component of color = 1.0f return OUT; }
Background image of page 6
Brief History on Programmable Shader Microsoft High-Level Shading Language (HLSL) Introduced with Microsoft DirectX 9 (Shader Model 2) Developed alongside NVIDIA Cg Very similar to Cg struct VS_OUTPUT0 { float4 Pos : POSITION; // position float4 ObjSliceTex : TEXCOORD0; // Scaled Front slice Texture Coordinate float4 OutInterTex
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

DX4 - DirectX Programming #4 Kang, Seongtae Computer...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online