previous |  up  | next
 

Per-Pixel Lighting   

Author:  TheTutor

While vertex lighting may be sufficient for your lighting needs, there is nothing quite like the beautiful lighting experience that per-pixel lighting offers.  Per-pixel lighting is an extension of vertex lighting.  In stead of calculating the lighting value at each vertex, it is instead done at each pixel.  The tutorial showcases a comparison of vertex vs per-pixel lighting and gives a straight forward approach to implementing per-pixel lighting using HLSL and a .fx file. 

Functions/Methods Used:  Direct3DCreate9(), D3DXCreateEffectFromFile(), assert()

IDirect3D9::  CreateDevice(), Release()

IDirect3DDevice9::  BeginScene(), EndScene(), SetFVF(), DrawPrimitiveUP(), Clear(), Release()

ID3DXEffect:: Begin(), End(), BeginPass(), EndPass(), SetTechnique(), SetMatrix(), SetFloat(), Release()

ID3DXBuffer:: GetBufferPointer()

ID3DXMesh:: CloneMeshFVF(), LockVertexBuffer(), UnlockVertexBuffer(), GetVertexBuffer(), GetIndexBuffer(), GetNumVertices(), GetNumFaces(), Release()

HLSL:  mul(), normalize(), pow(), max(), dot()


purchase full version
Access EXE

 
 
 

 

 

 


 C
 C++
 Win32
 Direct3D
 OpenGL
 C#
 Java
 Free Tutorials