home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2005 May
/
Gamestar_73_2005-05_dvd.iso
/
Dema
/
IMPERIAL_GLORY
/
data1.cab
/
NewComponent1
/
Data.pak
/
Engine
/
LinearTweenLightmap.vsh
< prev
next >
Wrap
Text File
|
2005-02-12
|
2KB
|
30 lines
//-----------------------------------------------------------------------------------
// Constantes especificadas por la aplicacion
//-----------------------------------------------------------------------------------
// c0-c3 = world/view/projection matrix
// c5 = (fWeight1, 1.0 - fWeight, 1.0, 0.0)
//
// Vertex components (as specified in the vertex DECL)
// v0 = Position 1 (stream 1)
// v1 = Position 2 (stream 2)
// v2 = Texcoords (stream 0)
// v3 = Texcoords (stream 0)
//-----------------------------------------------------------------------------------
// Vertex-Shader interpola 2 posiciones desde 2 streams y aplica transformacion
// y un lightmap, y asigna coordenadas de textura desde canal independiente!
//-----------------------------------------------------------------------------------
vs.1.1
dcl_position0 v0 // v0 = Position 1 (stream 1)
dcl_position1 v1 // v1 = Position 2 (stream 2)
dcl_texcoord0 v2 // v2 = Texcoords (stream 0)
dcl_texcoord1 v3 // v3 = Texcoords (stream 0)
mul r0, v0, c5.y // Multiplicamos posicion vertice 1 por (1-fblending)
mad r0, v1, c5.x, r0 // Sumamos a eso posicion vertice 2 por (fblending)
m4x4 oPos, r0, c0 // transform vΘrtices by view/projection matrix
mov oD0.xyzw, c5.zzzz // load constant color
mov oT0.xy, v2 // Copiamos coordenadas de textura
mov oT1.xy, v3 // Copiamos coordenadas del lightmap
mov oFog, c5.z // Asignamos el factor de niebla