Microsoft PowerPoint - GameProgramming23-PixelShader.ppt

Similar documents
Microsoft Word - game08-midterm.doc

Microsoft PowerPoint - GameProgramming15-MeshII

Microsoft PowerPoint - 10terrain.ppt

서피스셰이더프로그램 셰이더개발을쉽게! Thursday, April 12, 12

Microsoft Word - Cg Shader Programming.doc

untitled

슬라이드 1

Microsoft PowerPoint - Week04_DirectX9 프로그래밍의 기초2.pptx

Microsoft PowerPoint - NV40_Korea_KR_2.ppt

Microsoft PowerPoint - Week03_DirectX9 프로그래밍의 기초.pptx

<4D F736F F F696E74202D B30395FBAEDB7BBB5F95FBDBAC5D9BDC7B9F6C6DB5FB1D7B8B2C0DA2E >

12 강. 문자출력 Direct3D 에서는문자를출력하기위해서 LPD3DXFONT 객체를사용한다 LPD3DXFONT 객체생성과초기화 LPD3DXFONT 객체를생성하고초기화하는함수로 D3DXCreateFont() 가있다. HRESULT D3DXCreateFont

Łø·ŸÕ=¤ ¬ ÇX±xÒ¸ 06 - Èpº– 1

Microsoft PowerPoint - lecture15-ch6.ppt

Microsoft PowerPoint - lecture16-ch6

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

슬라이드 1

LCD Display

ShaderX2: DirectX 9 셰이더 프로그래밍 팁 & 트릭

(Microsoft PowerPoint - \301\24613\260\255 - oFusion \276\300 \261\270\274\272)

PowerPoint 프레젠테이션

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

PowerPoint Template


Microsoft PowerPoint - lecture3-ch2.ppt [호환 모드]

adfasdfasfdasfasfadf

유니티 변수-함수.key

C# Programming Guide - Types

제이쿼리 (JQuery) 정의 자바스크립트함수를쉽게사용하기위해만든자바스크립트라이브러리. 웹페이지를즉석에서변경하는기능에특화된자바스크립트라이브러리. 사용법 $( 제이쿼리객체 ) 혹은 $( 엘리먼트 ) 참고 ) $() 이기호를제이쿼리래퍼라고한다. 즉, 제이쿼리를호출하는기호

int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \

Microsoft Word - cg07-final.doc

API 매뉴얼

untitled

Microsoft PowerPoint - Practical performance_KR_3.ppt

No Slide Title

<4D F736F F F696E74202D20C1A63130B0AD202D20C1F6C7FCB0FA20C7CFB4C3C0C720B7BBB4F5B8B5>

슬라이드 1

디지털영상처리3

MAX+plus II Getting Started - 무작정따라하기

(Microsoft PowerPoint - \301\24608\260\255 - \261\244\277\370\260\372 \300\347\301\372)

KNK_C_05_Pointers_Arrays_structures_summary_v02

歯Lecture2.PDF

UI TASK & KEY EVENT

Index

유니 앞부속

<4D F736F F F696E74202D20C1A63034B0AD202D20C7C1B7B9C0D3B8AEBDBAB3CABFCD20B9ABB9F6C6DBC0D4B7C2>

3주차_Core Audio_ key

B _01_M_Korea.indb

HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M.

T100MD+

UI TASK & KEY EVENT

Index Process Specification Data Dictionary

03장.스택.key

Microsoft PowerPoint - Chapter 6.ppt

<3136C2F720C6F7B7B3BFF8B0ED2E687770>

강의10

DDX4038BT DDX4038BTM DDX4038 DDX4038M 2010 Kenwood Corporation All Rights Reserved. LVT A (MN)

슬라이드 1

MPLAB C18 C

초보자를 위한 C# 21일 완성

Microsoft PowerPoint - [2009] 02.pptx

PowerPoint 프레젠테이션

Microsoft PowerPoint - GameDesign6-Graphics.ppt [호환 모드]

2007_2_project4

Microsoft PowerPoint - es-arduino-lecture-03

DIY 챗봇 - LangCon

Chapter_02-3_NativeApp

<4D F736F F F696E74202D20C1A63037B0AD202D20B1A4BFF8B0FA20B1D7B8B2C0DA>

서강대학교공과대학컴퓨터공학과 CSE4170 기초컴퓨터그래픽스기말고사 (1/9) [CSE4170: 기초컴퓨터그래픽스 ] 기말고사 담당교수 : 임인성 답은연습지가아니라답안지에기술할것. 답안지공간이부족할경우, 답안지뒷면에기술하고, 해당답안지칸에그사실을명기할것. 연습지는수거하

K&R2 Reference Manual 번역본

PowerPoint 프레젠테이션

슬라이드 1

Orcad Capture 9.x

Microsoft PowerPoint - Class10_LOD와자료구조.pptx

Microsoft PowerPoint - 04-Model Class.pptx

Microsoft PowerPoint - ch07 - 포인터 pm0415

슬라이드 1

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770>

Microsoft PowerPoint - chap10-함수의활용.pptx

컴파일러

Microsoft PowerPoint - additional06.ppt [호환 모드]

Microsoft PowerPoint - GameProgramming16-Camera.ppt

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

istay

디지털영상처리3

PowerPoint 프레젠테이션

Microsoft PowerPoint - a10.ppt [호환 모드]

chap10.PDF

data

Deok9_Exploit Technique

歯삼성SDI개요

3D MAX + WEEK 9 Hansung Univ. Interior Design

USER GUIDE

PowerPoint 프레젠테이션

CPX-E-EC_BES_C_ _ k1

2

API 매뉴얼

Microsoft Word - cg07-midterm.doc

10주차.key

untitled

Transcription:

픽셀셰이더 HLSL Pixel Shader 305890 2009년봄학기 6/10/2009 박경신 각픽셀의래스터라이즈과정을위해그래픽카드의 GPU 에서실행되는프로그램 Direct3D 는소프트웨어적으로픽셀셰이더기능을에뮬레이트하지않음 픽셀과텍스처좌표에대한직접적인접근, 처리 멀티텍스처링, 픽셀당조명, 필드깊이, 구름시뮬레이션, 불시뮬레이션, 복잡한그림자테크닉 GPU 가지원하는픽셀셰이더의버전체크 // Step 2: Check for hardware vp. D3DCAPS9 caps; d3d9->getdevicecaps(d3dadapter_default, devicetype, &caps); // If the device s supported version is less than version 2.0 if( caps.pixelshaderversion < D3DPS_VERSION(2,0) ) // Then pixel shader version 2.0 is not supported on this device Overview 픽셀셰이더를이용한멀티텍스처링 멀티텍스처링개념에대한기본적인이해 픽셀셰이더의작성법과생성법및사용법 픽셀셰이더를이용한멀티텍스처링의구현방법 * + 기반 (Base) 스포트라이트 (Spot Light) 텍스트 (Text)

픽셀셰이더를이용한멀티텍스처링 멀티텍스처링의개요 텍스처들을블렌딩함 기반 (Base) * + 스포트라이트 (Spot Light) 텍스트 (Text) 고정기능파이프라인 픽셀셰이더 라이트맵 (light maps) 이라는특수한텍스처맵을이용하면얻게되는장점 조명이미리계산됨 전반적인처리속도향상 단, 물체와조명이모두정적이여야함 Direct3D 조명모델보다훨씬정확하고정교한광원모델의이용가능 난반사라이트맵, 정반사라이트맵, 안개맵, 디테일맵 멀티텍스처링결과 멀티텍스처의활성화 텍스처지정함수와샘플러상태지정함수 HRESULT HRESULT SetTexture( SetTexture( DWORD DWORD Stage, Stage, // // specifies specifies the the texture texture stage stage index index IDirect3DBaseTexture9 IDirect3DBaseTexture9 *ptexture *ptexture ); ); HRESULT HRESULT SetSamplerState( SetSamplerState( DWORD DWORD Sampler, Sampler, // // specifies specifies the the texture texture stage stage index index D3DSAMPLERSTATETYPE D3DSAMPLERSTATETYPE Type, Type, DWORD DWORD Value Value ); 예 );) // Set first texture and corresponding sampler states Device->SetTexture( 0, BaseTex); Device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // Set second texture and corresponding sampler states Device->SetTexture( 1, SpotLightTex); Device->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // Set third texture and corresponding sampler states Device->SetTexture( 2, StringTex); Device->SetSamplerState(2, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(2, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(2, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); 멀티텍스처좌표 각버텍스는활성화된텍스처개수와같은수의텍스처좌표집합을가져야함 최대 8개의텍스처좌표지원 예 ) struct MultiTexVertex MultiTexVertex(float x, float y, float z, float u0, float v0, float u1, float v1, float u2, float v2) _x = x; _y = y; _z = z; _u0 = u0; _v0 = v0; _u1 = u1; _v1 = v1; _u2 = u2, _v2 = v2; float _x, _y, _z; float _u0, _v0; float _u1, _v1; float _u2, _v2; static const DWORD FVF; ; const DWORD MultiTexVertex::FVF = D3DFVF_XYZ D3DFVF_TEX3;

픽셀셰이더의입출력 입력 픽셀의컬러와텍스처좌표 예 ) struct PS_INPUT vector c0 vector c1 float2 t0 float2 t1 float2 t2 ; 픽셀셰이더의입력 버텍스셰이더의출력 출력 픽셀의하나의컬러 예 ) struct VS_OUTPUT vector finalpixelcolor ; : COLOR0; : COLOR1; : TEXCOORD0; : TEXCOORD1; : TEXCOORD2; : COLOR0; 픽셀셰이더의이용단계 픽셀셰이더를작성하고컴파일 컴파일된셰이더코드에기반한픽셀셰이더를나타내는 IDirect3DPixelShader9 인터페이스를생성 IDirect3DDevice9::SetPixelShader 메서드를이용해픽셀셰이더활성화 이용이끝난뒤, 픽셀셰이더제거 픽셀셰이더의작성과컴파일 HLSL 을이용해픽셀셰이더프로그램작성 ASCII 텍스트파일 ( 텍스트편집기이용 ) 픽셀셰이더컴파일 D3DXCompileShaderFromFile 함수이용 컴파일된셰이더코드를포함하는 ID3DXBuffer 포인터리턴 hr = D3DXCompileShaderFromFile( "ps_multitex.txt", 0, 0, "Main", // entry point function name "ps_1_1", D3DXSHADER_DEBUG, &shader, &errorbuffer, &MultiTexCT); 픽셀셰이더만들기 HRESULT IDirect3DDevice9::CreatePixelShader( const const DWORD *pfunction, IDirect3DPixelShader9** ppshader ); ); 예 ) IDirect3DPixelShader9* MultiTexPS = 0; ID3DXConstantTable* MultiTexCT = 0; ID3DXBuffer* shader = 0; ID3DXBuffer* errorbuffer = 0; hr = D3DXCompileShaderFromFile( "ps_multitex.txt", 0, 0, "Main", // entry point function name "ps_1_1", D3DXSHADER_DEBUG, &shader, &errorbuffer, &MultiTexCT); hr = Device->CreatePixelShader( (DWORD*)shader->GetBufferPointer(), &MultiTexPS);

픽셀셰이더의활성화와제거 픽셀세이더의활성화 HRESULT IDirect3DDevice9::SetPixelShader( IDirect3DPixelShader9* pshader ); ); 예 ) Device->BeginScene(); 이용이끝난뒤에는픽셀셰이더를제거 예 ) Device->SetPixelShader(MultiTexPS); Device->SetFVF(MultiTexVertex::FVF); Device->SetStreamSource(0, QuadVB, 0, sizeof(multitexvertex)); Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2); Device->EndScene(); d3d::release<idirect3dpixelshader9*>(multitexps); d3d::release<id3dxconstanttable*>(multitexct); HLSL 샘플러객체 (u,v) 텍스처좌표로인덱스하려는텍스처 텍스처와샘플러상태를식별하는객체 (u,v) 인덱스할출력컬러 Sampling 텍스처좌표 + 텍스처 예 ) sampler BaseTex; sampler SpotLightTex; 픽셀셰이더코드 sampler StringTex; IDirect3DTexture9* BaseTex = 0; D3DXHANDLE BaseTexHandle = 0; D3DXCONSTANT_DESC BaseTexDesc; D3DXCreateTextureFromFile(Device, "crate.bmp", &BaseTex); BaseTexHandle = MultiTexCT->GetConstantByName(0, "BaseTex"); MultiTexCT->GetConstantDesc(BaseTexHandle, &BaseTexDesc, &count); Device->SetTexture( BaseTexDesc.RegisterIndex, BaseTex); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); Sample: Multitexturing Shader: ps_multitex.txt sampler BaseTex; sampler SpotLightTex; sampler StringTex; struct PS_INPUT float2 base : TEXCOORD0; float2 spotlight : TEXCOORD1; float2 text : TEXCOORD2; ; struct PS_OUTPUT vector diffuse : COLOR0; ; PS_OUTPUT Main(PS_INPUT input) PS_OUTPUT output = (PS_OUTPUT)0; vector b = tex2d(basetex, input.base); vector s = tex2d(spotlighttex, input.spotlight); vector t = tex2d(stringtex, input.text); vector c = b * s + t; c += 0.1f; output.diffuse = c; return output;

Global Variables IDirect3DPixelShader9* MultiTexPS = 0; ID3DXConstantTable* MultiTexCT = 0; IDirect3DVertexBuffer9* QuadVB = 0; IDirect3DTexture9* BaseTex = 0; IDirect3DTexture9* SpotLightTex = 0; IDirect3DTexture9* StringTex = 0; D3DXHANDLE BaseTexHandle = 0; D3DXHANDLE SpotLightTexHandle = 0; D3DXHANDLE StringTexHandle = 0; D3DXCONSTANT_DESC BaseTexDesc; D3DXCONSTANT_DESC SpotLightTexDesc; D3DXCONSTANT_DESC StringTexDesc; struct MultiTexVertex MultiTexVertex(float x, float y, float z, float u0, float v0, float u1, float v1, float u2, float v2) _x = x; _y = y; _z = z; _u0 = u0; _v0 = v0; _u1 = u1; _v1 = v1; _u2 = u2, _v2 = v2; float _x, _y, _z; float _u0, _v0; float _u1, _v1; float _u2, _v2; static const DWORD FVF; ; const DWORD MultiTexVertex::FVF = D3DFVF_XYZ D3DFVF_TEX3; Creating a Vertex Buffer bool Setup() HRESULT hr = 0; Device->CreateVertexBuffer( 6 * sizeof(multitexvertex), D3DUSAGE_WRITEONLY, MultiTexVertex::FVF, D3DPOOL_MANAGED, &QuadVB, 0); MultiTexVertex* v = 0; QuadVB->Lock(0, 0, (void**)&v, 0); v[0] = MultiTexVertex(-10.0f, -10.0f, 5.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); v[1] = MultiTexVertex(-10.0f, 10.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); v[2] = MultiTexVertex( 10.0f, 10.0f, 5.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f); v[3] = MultiTexVertex(-10.0f, -10.0f, 5.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); v[4] = MultiTexVertex( 10.0f, 10.0f, 5.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f); v[5] = MultiTexVertex( 10.0f, -10.0f, 5.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); QuadVB->Unlock(); Compiling and Creating a PS Obtaining Handles and Initializing PS s Variables ID3DXBuffer* shader = 0; ID3DXBuffer* errorbuffer = 0; hr = D3DXCompileShaderFromFile( "ps_multitex.txt", 0, 0, "Main", // entry point function name "ps_1_1", D3DXSHADER_DEBUG, &shader, &errorbuffer, &MultiTexCT); if( errorbuffer ) ::MessageBox(0, (char*)errorbuffer->getbufferpointer(), 0, 0); d3d::release<id3dxbuffer*>(errorbuffer); if(failed(hr)) ::MessageBox(0, "D3DXCompileShaderFromFile() - FAILED", 0, 0); return false; hr = Device->CreatePixelShader( (DWORD*)shader->GetBufferPointer(), &MultiTexPS); if(failed(hr)) ::MessageBox(0, "CreateVertexShader - FAILED", 0, 0); return false; d3d::release<id3dxbuffer*>(shader); D3DXCreateTextureFromFile(Device, "crate.bmp", &BaseTex); D3DXCreateTextureFromFile(Device, "spotlight.bmp", &SpotLightTex); D3DXCreateTextureFromFile(Device, "text.bmp", &StringTex); D3DXMATRIX P; D3DXMatrixPerspectiveFovLH(&P, D3DX_PI * 0.25f, (float)width / (float)height, 1.0f, 1000.0f); Device->SetTransform(D3DTS_PROJECTION, &P); Device->SetRenderState(D3DRS_LIGHTING, false); BaseTexHandle = MultiTexCT->GetConstantByName(0, "BaseTex"); SpotLightTexHandle = MultiTexCT->GetConstantByName(0, "SpotLightTex"); StringTexHandle = MultiTexCT->GetConstantByName(0, "StringTex"); UINT count; MultiTexCT->GetConstantDesc(BaseTexHandle, &BaseTexDesc, &count); MultiTexCT->GetConstantDesc(SpotLightTexHandle, &SpotLightTexDesc, &count); MultiTexCT->GetConstantDesc(StringTexHandle, &StringTexDesc, &count); MultiTexCT->SetDefaults(Device); return true;

Display ( ) (1) Display ( ) (2) bool Display(float timedelta) if( Device ) // Update the scene: code snipped... Device->Clear(0, 0, D3DCLEAR_TARGET D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); Device->BeginScene(); Device->SetPixelShader(MultiTexPS); Device->SetFVF(MultiTexVertex::FVF); Device->SetStreamSource(0, QuadVB, 0, sizeof(multitexvertex)); Device->SetTexture( BaseTexDesc.RegisterIndex, BaseTex); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(BaseTexDesc.RegisterIndex, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); Device->SetTexture( SpotLightTexDesc.RegisterIndex, SpotLightTex); Device->SetSamplerState(SpotLightTexDesc.RegisterIndex, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(SpotLightTexDesc.RegisterIndex, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(SpotLightTexDesc.RegisterIndex, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); Device->SetTexture( StringTexDesc.RegisterIndex, StringTex); Device->SetSamplerState(StringTexDesc.RegisterIndex, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(StringTexDesc.RegisterIndex, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); Device->SetSamplerState(StringTexDesc.RegisterIndex, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2); Device->EndScene(); Device->Present(0, 0, 0, 0); return true; Cleanup ( ) 연습문제 Phong Shading void Cleanup() d3d::release<idirect3dvertexbuffer9*>(quadvb); d3d::release<idirect3dtexture9*>(basetex); d3d::release<idirect3dtexture9*>(spotlighttex); d3d::release<idirect3dtexture9*>(stringtex); d3d::release<idirect3dpixelshader9*>(multitexps); d3d::release<id3dxconstanttable*>(multitexct);

Shader: phong.txt struct VS_INPUT vector position : POSITION; vector normal : NORMAL; ; struct VS_OUTPUT vector position : POSITION; vector light : TEXCOORD0; vector normal : TEXCOORD1; vector view : TEXCOORD2; ; Shader: phong.txt VS_OUTPUT VS_Main(VS_INPUT input) VS_OUTPUT output = (VS_OUTPUT)0; output.position = mul(input.position, ViewProjMatrix); LightDirection.w = 0.0f; input.normal.w = 0.0f; output.light = mul(lightdirection, ViewMatrix); output.normal = mul(input.normal, ViewMatrix); output.view = normalize(mul(input.position, ViewMatrix)); struct PS_INPUT vector light : TEXCOORD0; vector normal : TEXCOORD1; vector view : TEXCOORD2; ; struct PS_OUTPUT vector diffuse : COLOR; ; return output; Shader: phong.txt Shader: phong.txt (3) PS_OUTPUT PS_Main(PS_INPUT input) PS_OUTPUT output = (PS_OUTPUT)0; float d = saturate(dot(input.normal, input.light)); input.light.w = 0.0f; input.normal.w = 0.0f; vector r = normalize(reflect(input.light, input.normal)); float s = pow(saturate(dot(input.view, r)), 8); output.diffuse = (AmbientMtrl * AmbientLightIntensity) + (d * (DiffuseLightIntensity * DiffseMtrl)) + (s * (SpecularLightIntensity * SpecularMtrl)); return output;

Global Variables Compiling a Vertex Shader Creating a Vertex Shader Compiling a Pixel Shader

Creating a Pixel Shader Obtaining Handles and Initializing Variables Cleanup ( ) Display ( )

Exercise Bump Mapping 범프매핑 표면이렌더링될때, 법선벡터에잡음을넣어왜곡시키는기법 표면색상에작은변동이생겨울퉁불퉁해보임 텍스처맵 탄젠트좌표계 컬러맵 N U N N U V N U V 범프맵 법선벡터와탄젠트벡터의계산 V U V HRESULT HRESULT D3DXComputeNormals( LPD3DXBASEMESH pmesh, pmesh, CONST CONST DWORD DWORD ** padjacency padjacency ); ); HRESULT HRESULTWINAPI WINAPID3DXComputeTangent( LPD3DXMESH LPD3DXMESHMesh, Mesh, DWORD DWORDTexStageIndex, DWORD DWORDTangentIndex, DWORD DWORDBinormIndex, DWORD DWORDWrap, Wrap, const const DWORD DWORD *padjacency *padjacency););

Global Variables Loading a Mesh from X-File Computing Normal & Tangent Vectors Cleanup & Compiling VS

Creating VS & Compiling PS Creating PS & Getting Handles Getting Handles for Samplers Cleanup ( )

Enabling VS and PS Bump Mapping Shader: bump.txt (1) Shader: bump.txt (2)

Shader: bump.txt (3)