render pipe fixes

This commit is contained in:
aap 2020-08-18 11:03:07 +02:00
parent a78a02394e
commit 93c246b6b1
19 changed files with 745 additions and 831 deletions

1
rw.h
View File

@ -22,3 +22,4 @@
#include "src/gl/rwwdgl.h" #include "src/gl/rwwdgl.h"
#include "src/gl/rwgl3.h" #include "src/gl/rwgl3.h"
#include "src/gl/rwgl3shader.h" #include "src/gl/rwgl3shader.h"
#include "src/gl/rwgl3plg.h"

View File

@ -168,7 +168,7 @@ defaultRenderCB_Shader(Atomic *atomic, InstanceDataHeader *header)
setMaterial(m->color, m->surfaceProps); setMaterial(m->color, m->surfaceProps);
if(inst->material->texture){ if(m->texture){
d3d::setTexture(0, m->texture); d3d::setTexture(0, m->texture);
setPixelShader(default_tex_PS); setPixelShader(default_tex_PS);
}else }else

View File

@ -238,15 +238,16 @@ uploadSkinMatrices(Atomic *a)
Skin *skin = Skin::get(a->geometry); Skin *skin = Skin::get(a->geometry);
HAnimHierarchy *hier = Skin::getHierarchy(a); HAnimHierarchy *hier = Skin::getHierarchy(a);
Matrix *invMats = (Matrix*)skin->inverseMatrices; Matrix *invMats = (Matrix*)skin->inverseMatrices;
Matrix tmp; Matrix tmp, tmp2;
Matrix *m = (Matrix*)skinMatrices; float *m = skinMatrices;
if(hier->flags & HAnimHierarchy::LOCALSPACEMATRICES){ if(hier->flags & HAnimHierarchy::LOCALSPACEMATRICES){
for(i = 0; i < hier->numNodes; i++){ for(i = 0; i < hier->numNodes; i++){
invMats[i].flags = 0; invMats[i].flags = 0;
Matrix::mult(m, &invMats[i], &hier->matrices[i]); Matrix::mult(&tmp, &invMats[i], &hier->matrices[i]);
m++; RawMatrix::transpose((RawMatrix*)m, (RawMatrix*)&tmp);
m += 12;
} }
}else{ }else{
Matrix invAtmMat; Matrix invAtmMat;
@ -254,11 +255,12 @@ uploadSkinMatrices(Atomic *a)
for(i = 0; i < hier->numNodes; i++){ for(i = 0; i < hier->numNodes; i++){
invMats[i].flags = 0; invMats[i].flags = 0;
Matrix::mult(&tmp, &hier->matrices[i], &invAtmMat); Matrix::mult(&tmp, &hier->matrices[i], &invAtmMat);
Matrix::mult(m, &invMats[i], &tmp); Matrix::mult(&tmp2, &invMats[i], &tmp);
m++; RawMatrix::transpose((RawMatrix*)m, (RawMatrix*)&tmp2);
m += 12;
} }
} }
d3ddevice->SetVertexShaderConstantF(VSLOC_boneMatrices, skinMatrices, hier->numNodes*4); d3ddevice->SetVertexShaderConstantF(VSLOC_boneMatrices, skinMatrices, hier->numNodes*3);
} }
void void

View File

@ -92,6 +92,8 @@ ObjPipeline *makeDefaultPipeline(void);
// Skin plugin // Skin plugin
void initSkin(void); void initSkin(void);
void uploadSkinMatrices(Atomic *atomic);
void skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance);
ObjPipeline *makeSkinPipeline(void); ObjPipeline *makeSkinPipeline(void);
// MatFX plugin // MatFX plugin

View File

@ -11,6 +11,11 @@ float3 DoDirLight(Light L, float3 N)
return l*L.color.xyz; return l*L.color.xyz;
} }
float3 DoDirLightSpec(Light L, float3 N, float3 V, float power))
{
return pow(saturate(dot(N, normalize(V + -L.direction.xyz))), power)*L.color.xyz;
}
float3 DoPointLight(Light L, float3 V, float3 N) float3 DoPointLight(Light L, float3 V, float3 N)
{ {
// As on PS2 // As on PS2

View File

@ -1,6 +1,6 @@
#include "standardConstants.h" #include "standardConstants.h"
float4x4 boneMatrices[64] : register(c41); float4x3 boneMatrices[64] : register(c41);
struct VS_in struct VS_in
{ {
@ -27,8 +27,8 @@ VS_out main(in VS_in input)
float3 SkinVertex = float3(0.0, 0.0, 0.0); float3 SkinVertex = float3(0.0, 0.0, 0.0);
float3 SkinNormal = float3(0.0, 0.0, 0.0); float3 SkinNormal = float3(0.0, 0.0, 0.0);
for(j = 0; j < 4; j++){ for(j = 0; j < 4; j++){
SkinVertex += mul(boneMatrices[input.Indices[j]], input.Position).xyz * input.Weights[j]; SkinVertex += mul(input.Position, boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
SkinNormal += mul((float3x3)boneMatrices[input.Indices[j]], input.Normal).xyz * input.Weights[j]; SkinNormal += mul(input.Normal, (float3x3)boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
} }
output.Position = mul(combinedMat, float4(SkinVertex, 1.0)); output.Position = mul(combinedMat, float4(SkinVertex, 1.0));

View File

@ -9,7 +9,7 @@
// Parameters: // Parameters:
// //
// float4 ambientLight; // float4 ambientLight;
// float4x4 boneMatrices[64]; // float4x3 boneMatrices[64];
// float4x4 combinedMat; // float4x4 combinedMat;
// int4 firstLight; // int4 firstLight;
// float4 fogData; // float4 fogData;
@ -47,11 +47,11 @@
// ambientLight c15 1 // ambientLight c15 1
// firstLight c16 1 // firstLight c16 1
// lights c17 24 // lights c17 24
// boneMatrices c41 256 // boneMatrices c41 192
// //
vs_2_0 vs_2_0
def c11, 4, 0, 3, 1 def c11, 3, 0, 1, 0
dcl_position v0 dcl_position v0
dcl_normal v1 dcl_normal v1
dcl_texcoord v2 dcl_texcoord v2
@ -59,49 +59,46 @@
dcl_blendweight v4 dcl_blendweight v4
dcl_blendindices v5 dcl_blendindices v5
mul r0, v5, c11.x mul r0, v5, c11.x
mova a0.xy, r0 mova a0.x, r0.x
mul r1.xyz, v1.y, c42[a0.x] dp3 r1.z, v1, c43[a0.x]
mad r1.xyz, c41[a0.x], v1.x, r1 dp4 r2.x, v0, c41[a0.x]
mad r1.xyz, c43[a0.x], v1.z, r1 dp4 r2.y, v0, c42[a0.x]
mul r2.xyz, v1.y, c42[a0.y] dp4 r2.z, v0, c43[a0.x]
mad r2.xyz, c41[a0.y], v1.x, r2 dp3 r1.x, v1, c41[a0.x]
mad r2.xyz, c43[a0.y], v1.z, r2 dp3 r1.y, v1, c42[a0.x]
mul r2.xyz, r2, v4.y mova a0.x, r0.y
mad r1.xyz, r1, v4.x, r2 dp3 r3.z, v1, c43[a0.x]
mul r2.xyz, v0.y, c42[a0.y] dp4 r4.x, v0, c41[a0.x]
mad r2.xyz, c41[a0.y], v0.x, r2 dp4 r4.y, v0, c42[a0.x]
mad r2.xyz, c43[a0.y], v0.z, r2 dp4 r4.z, v0, c43[a0.x]
mad r2.xyz, c44[a0.y], v0.w, r2 mul r4.xyz, r4, v4.y
mul r2.xyz, r2, v4.y mad r2.xyz, r2, v4.x, r4
mul r3.xyz, v0.y, c42[a0.x] dp3 r3.x, v1, c41[a0.x]
mad r3.xyz, c41[a0.x], v0.x, r3 dp3 r3.y, v1, c42[a0.x]
mad r3.xyz, c43[a0.x], v0.z, r3 mul r3.xyz, r3, v4.y
mad r3.xyz, c44[a0.x], v0.w, r3 mad r1.xyz, r1, v4.x, r3
mad r2.xyz, r3, v4.x, r2
mova a0.x, r0.z mova a0.x, r0.z
mul r0.xyz, v1.y, c42[a0.x] dp3 r0.z, v1, c43[a0.x]
mad r0.xyz, c41[a0.x], v1.x, r0 dp4 r3.x, v0, c41[a0.x]
mad r0.xyz, c43[a0.x], v1.z, r0 dp4 r3.y, v0, c42[a0.x]
dp4 r3.z, v0, c43[a0.x]
mad r2.xyz, r3, v4.z, r2
dp3 r0.x, v1, c41[a0.x]
dp3 r0.y, v1, c42[a0.x]
mad r0.xyz, r0, v4.z, r1 mad r0.xyz, r0, v4.z, r1
mul r1.xyz, v0.y, c42[a0.x]
mad r1.xyz, c41[a0.x], v0.x, r1
mad r1.xyz, c43[a0.x], v0.z, r1
mad r1.xyz, c44[a0.x], v0.w, r1
mad r1.xyz, r1, v4.z, r2
mova a0.x, r0.w mova a0.x, r0.w
mul r2.xyz, v1.y, c42[a0.x] dp3 r1.z, v1, c43[a0.x]
mad r2.xyz, c41[a0.x], v1.x, r2 dp4 r3.x, v0, c41[a0.x]
mad r2.xyz, c43[a0.x], v1.z, r2 dp4 r3.y, v0, c42[a0.x]
mad r0.xyz, r2, v4.w, r0 dp4 r3.z, v0, c43[a0.x]
mul r2.xyz, v0.y, c42[a0.x] mad r2.xyz, r3, v4.w, r2
mad r2.xyz, c41[a0.x], v0.x, r2 dp3 r1.x, v1, c41[a0.x]
mad r2.xyz, c43[a0.x], v0.z, r2 dp3 r1.y, v1, c42[a0.x]
mad r2.xyz, c44[a0.x], v0.w, r2 mad r0.xyz, r1, v4.w, r0
mad r1.xyz, r2, v4.w, r1 mul r1.xyz, r2.y, c5
mul r2.xyz, r1.y, c5 mad r1.xyz, c4, r2.x, r1
mad r2.xyz, c4, r1.x, r2 mad r1.xyz, c6, r2.z, r1
mad r2.xyz, c6, r1.z, r2 add r1.xyz, r1, c7
add r2.xyz, r2, c7
mul r3.xyz, r0.y, c9 mul r3.xyz, r0.y, c9
mad r0.xyw, c8.xyzz, r0.x, r3.xyzz mad r0.xyw, c8.xyzz, r0.x, r3.xyzz
mad r0.xyz, c10, r0.z, r0.xyww mad r0.xyz, c10, r0.z, r0.xyww
@ -111,21 +108,21 @@
mov r0.w, c11.y mov r0.w, c11.y
rep i0 rep i0
add r1.w, r0.w, c16.x add r1.w, r0.w, c16.x
mul r1.w, r1.w, c11.z mul r1.w, r1.w, c11.x
mova a0.x, r1.w mova a0.x, r1.w
dp3 r1.w, r0, -c19[a0.x] dp3 r1.w, r0, -c19[a0.x]
max r1.w, r1.w, c11.y max r1.w, r1.w, c11.y
mul r5.xyz, r1.w, c17[a0.x] mul r5.xyz, r1.w, c17[a0.x]
mad r4.xyz, r5, c13.z, r4 mad r4.xyz, r5, c13.z, r4
add r0.w, r0.w, c11.w add r0.w, r0.w, c11.z
endrep endrep
mov r3.xyz, r4 mov r3.xyz, r4
mov r0.w, c11.y mov r0.w, c11.y
rep i1 rep i1
add r1.w, r0.w, c16.y add r1.w, r0.w, c16.y
mul r1.w, r1.w, c11.z mul r1.w, r1.w, c11.x
mova a0.x, r1.w mova a0.x, r1.w
add r5.xyz, r2, -c18[a0.x] add r5.xyz, r1, -c18[a0.x]
dp3 r1.w, r5, r5 dp3 r1.w, r5, r5
rsq r1.w, r1.w rsq r1.w, r1.w
mul r5.xyz, r1.w, r5 mul r5.xyz, r1.w, r5
@ -134,19 +131,19 @@
mul r5.xyz, r2.w, c17[a0.x] mul r5.xyz, r2.w, c17[a0.x]
rcp r1.w, r1.w rcp r1.w, r1.w
rcp r2.w, c17[a0.x].w rcp r2.w, c17[a0.x].w
mad r1.w, r1.w, -r2.w, c11.w mad r1.w, r1.w, -r2.w, c11.z
max r1.w, r1.w, c11.y max r1.w, r1.w, c11.y
mul r5.xyz, r1.w, r5 mul r5.xyz, r1.w, r5
mad r3.xyz, r5, c13.z, r3 mad r3.xyz, r5, c13.z, r3
add r0.w, r0.w, c11.w add r0.w, r0.w, c11.z
endrep endrep
mov r4.xyz, r3 mov r4.xyz, r3
mov r0.w, c11.y mov r0.w, c11.y
rep i2 rep i2
add r1.w, r0.w, c16.z add r1.w, r0.w, c16.z
mul r1.w, r1.w, c11.z mul r1.w, r1.w, c11.x
mova a0.x, r1.w mova a0.x, r1.w
add r5.xyz, r2, -c18[a0.x] add r5.xyz, r1, -c18[a0.x]
dp3 r1.w, r5, r5 dp3 r1.w, r5, r5
rsq r1.w, r1.w rsq r1.w, r1.w
mul r5.xyz, r1.w, r5 mul r5.xyz, r1.w, r5
@ -154,8 +151,8 @@
dp3 r3.w, r5, c19[a0.x] dp3 r3.w, r5, c19[a0.x]
max r2.w, r2.w, c11.y max r2.w, r2.w, c11.y
add r3.w, r3.w, c18[a0.x].w add r3.w, r3.w, c18[a0.x].w
mov r5.w, c11.w mov r5.z, c11.z
add r5.x, r5.w, c18[a0.x].w add r5.x, r5.z, c18[a0.x].w
rcp r5.x, r5.x rcp r5.x, r5.x
mul r3.w, r3.w, r5.x mul r3.w, r3.w, r5.x
slt r5.x, r3.w, c11.y slt r5.x, r3.w, c11.y
@ -165,28 +162,28 @@
mul r5.xyz, r2.w, c17[a0.x] mul r5.xyz, r2.w, c17[a0.x]
rcp r1.w, r1.w rcp r1.w, r1.w
rcp r2.w, c17[a0.x].w rcp r2.w, c17[a0.x].w
mad r1.w, r1.w, -r2.w, c11.w mad r1.w, r1.w, -r2.w, c11.z
max r1.w, r1.w, c11.y max r1.w, r1.w, c11.y
mul r5.xyz, r1.w, r5 mul r5.xyz, r1.w, r5
mad r4.xyz, r5, c13.z, r4 mad r4.xyz, r5, c13.z, r4
add r0.w, r0.w, c11.w add r0.w, r0.w, c11.z
endrep endrep
mov r4.w, v3.w mov r4.w, v3.w
max r0, r4, c11.y max r0, r4, c11.y
min r0, r0, c11.w min r0, r0, c11.z
mul oD0, r0, c12 mul oD0, r0, c12
mul r0, r1.y, c1 mul r0, r2.y, c1
mad r0, c0, r1.x, r0 mad r0, c0, r2.x, r0
mad r0, c2, r1.z, r0 mad r0, c2, r2.z, r0
add r0, r0, c3 add r0, r0, c3
mov oPos, r0 mov oPos, r0
add r0.x, r0.w, -c14.y add r0.x, r0.w, -c14.y
mul r0.x, r0.x, c14.z mul r0.x, r0.x, c14.z
max r0.x, r0.x, c14.w max r0.x, r0.x, c14.w
min oT0.z, r0.x, c11.w min oT0.z, r0.x, c11.z
mov oT0.xy, v2 mov oT0.xy, v2
// approximately 136 instruction slots used // approximately 133 instruction slots used
#endif #endif
const BYTE g_vs20_main[] = const BYTE g_vs20_main[] =
@ -202,7 +199,7 @@ const BYTE g_vs20_main[] =
1, 0, 62, 0, 48, 1, 1, 0, 62, 0, 48, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
64, 1, 0, 0, 2, 0, 64, 1, 0, 0, 2, 0,
41, 0, 0, 1, 166, 0, 41, 0, 192, 0, 166, 0,
80, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0,
0, 0, 96, 1, 0, 0, 0, 0, 96, 1, 0, 0,
2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0,
@ -250,7 +247,7 @@ const BYTE g_vs20_main[] =
77, 97, 116, 114, 105, 99, 77, 97, 116, 114, 105, 99,
101, 115, 0, 171, 171, 171, 101, 115, 0, 171, 171, 171,
3, 0, 3, 0, 4, 0, 3, 0, 3, 0, 4, 0,
4, 0, 64, 0, 0, 0, 3, 0, 64, 0, 0, 0,
0, 0, 0, 0, 99, 111, 0, 0, 0, 0, 99, 111,
109, 98, 105, 110, 101, 100, 109, 98, 105, 110, 101, 100,
77, 97, 116, 0, 3, 0, 77, 97, 116, 0, 3, 0,
@ -308,9 +305,9 @@ const BYTE g_vs20_main[] =
53, 50, 46, 51, 49, 49, 53, 50, 46, 51, 49, 49,
49, 0, 81, 0, 0, 5, 49, 0, 81, 0, 0, 5,
11, 0, 15, 160, 0, 0, 11, 0, 15, 160, 0, 0,
128, 64, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0,
0, 0, 64, 64, 0, 0, 0, 0, 128, 63, 0, 0,
128, 63, 31, 0, 0, 2, 0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0, 0, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2, 15, 144, 31, 0, 0, 2,
3, 0, 0, 128, 1, 0, 3, 0, 0, 128, 1, 0,
@ -326,227 +323,283 @@ const BYTE g_vs20_main[] =
0, 0, 15, 128, 5, 0, 0, 0, 15, 128, 5, 0,
228, 144, 11, 0, 0, 160, 228, 144, 11, 0, 0, 160,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
3, 176, 0, 0, 228, 128, 1, 176, 0, 0, 0, 128,
5, 0, 0, 4, 1, 0, 8, 0, 0, 4, 1, 0,
7, 128, 1, 0, 85, 144, 4, 128, 1, 0, 228, 144,
42, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 5,
1, 0, 7, 128, 41, 32,
228, 160, 0, 0, 0, 176,
1, 0, 0, 144, 1, 0,
228, 128, 4, 0, 0, 5,
1, 0, 7, 128, 43, 32,
228, 160, 0, 0, 0, 176,
1, 0, 170, 144, 1, 0,
228, 128, 5, 0, 0, 4,
2, 0, 7, 128, 1, 0,
85, 144, 42, 32, 228, 160,
0, 0, 85, 176, 4, 0,
0, 5, 2, 0, 7, 128,
41, 32, 228, 160, 0, 0,
85, 176, 1, 0, 0, 144,
2, 0, 228, 128, 4, 0,
0, 5, 2, 0, 7, 128,
43, 32, 228, 160, 0, 0, 43, 32, 228, 160, 0, 0,
85, 176, 1, 0, 170, 144, 0, 176, 9, 0, 0, 4,
2, 0, 228, 128, 5, 0, 2, 0, 1, 128, 0, 0,
0, 3, 2, 0, 7, 128, 228, 144, 41, 32, 228, 160,
2, 0, 228, 128, 4, 0, 0, 0, 0, 176, 9, 0,
85, 144, 4, 0, 0, 4, 0, 4, 2, 0, 2, 128,
1, 0, 7, 128, 1, 0, 0, 0, 228, 144, 42, 32,
228, 128, 4, 0, 0, 144,
2, 0, 228, 128, 5, 0,
0, 4, 2, 0, 7, 128,
0, 0, 85, 144, 42, 32,
228, 160, 0, 0, 85, 176,
4, 0, 0, 5, 2, 0,
7, 128, 41, 32, 228, 160,
0, 0, 85, 176, 0, 0,
0, 144, 2, 0, 228, 128,
4, 0, 0, 5, 2, 0,
7, 128, 43, 32, 228, 160,
0, 0, 85, 176, 0, 0,
170, 144, 2, 0, 228, 128,
4, 0, 0, 5, 2, 0,
7, 128, 44, 32, 228, 160,
0, 0, 85, 176, 0, 0,
255, 144, 2, 0, 228, 128,
5, 0, 0, 3, 2, 0,
7, 128, 2, 0, 228, 128,
4, 0, 85, 144, 5, 0,
0, 4, 3, 0, 7, 128,
0, 0, 85, 144, 42, 32,
228, 160, 0, 0, 0, 176, 228, 160, 0, 0, 0, 176,
4, 0, 0, 5, 3, 0, 9, 0, 0, 4, 2, 0,
7, 128, 41, 32, 228, 160, 4, 128, 0, 0, 228, 144,
0, 0, 0, 176, 0, 0, 43, 32, 228, 160, 0, 0,
0, 176, 8, 0, 0, 4,
1, 0, 1, 128, 1, 0,
228, 144, 41, 32, 228, 160,
0, 0, 0, 176, 8, 0,
0, 4, 1, 0, 2, 128,
1, 0, 228, 144, 42, 32,
228, 160, 0, 0, 0, 176,
46, 0, 0, 2, 0, 0,
1, 176, 0, 0, 85, 128,
8, 0, 0, 4, 3, 0,
4, 128, 1, 0, 228, 144,
43, 32, 228, 160, 0, 0,
0, 176, 9, 0, 0, 4,
4, 0, 1, 128, 0, 0,
228, 144, 41, 32, 228, 160,
0, 0, 0, 176, 9, 0,
0, 4, 4, 0, 2, 128,
0, 0, 228, 144, 42, 32,
228, 160, 0, 0, 0, 176,
9, 0, 0, 4, 4, 0,
4, 128, 0, 0, 228, 144,
43, 32, 228, 160, 0, 0,
0, 176, 5, 0, 0, 3,
4, 0, 7, 128, 4, 0,
228, 128, 4, 0, 85, 144,
4, 0, 0, 4, 2, 0,
7, 128, 2, 0, 228, 128,
4, 0, 0, 144, 4, 0,
228, 128, 8, 0, 0, 4,
3, 0, 1, 128, 1, 0,
228, 144, 41, 32, 228, 160,
0, 0, 0, 176, 8, 0,
0, 4, 3, 0, 2, 128,
1, 0, 228, 144, 42, 32,
228, 160, 0, 0, 0, 176,
5, 0, 0, 3, 3, 0,
7, 128, 3, 0, 228, 128,
4, 0, 85, 144, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 228, 128, 4, 0,
0, 144, 3, 0, 228, 128, 0, 144, 3, 0, 228, 128,
4, 0, 0, 5, 3, 0, 46, 0, 0, 2, 0, 0,
7, 128, 43, 32, 228, 160, 1, 176, 0, 0, 170, 128,
0, 0, 0, 176, 0, 0, 8, 0, 0, 4, 0, 0,
170, 144, 3, 0, 228, 128, 4, 128, 1, 0, 228, 144,
4, 0, 0, 5, 3, 0, 43, 32, 228, 160, 0, 0,
7, 128, 44, 32, 228, 160, 0, 176, 9, 0, 0, 4,
0, 0, 0, 176, 0, 0, 3, 0, 1, 128, 0, 0,
255, 144, 3, 0, 228, 128, 228, 144, 41, 32, 228, 160,
0, 0, 0, 176, 9, 0,
0, 4, 3, 0, 2, 128,
0, 0, 228, 144, 42, 32,
228, 160, 0, 0, 0, 176,
9, 0, 0, 4, 3, 0,
4, 128, 0, 0, 228, 144,
43, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 4,
2, 0, 7, 128, 3, 0,
228, 128, 4, 0, 170, 144,
2, 0, 228, 128, 8, 0,
0, 4, 0, 0, 1, 128,
1, 0, 228, 144, 41, 32,
228, 160, 0, 0, 0, 176,
8, 0, 0, 4, 0, 0,
2, 128, 1, 0, 228, 144,
42, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 4,
0, 0, 7, 128, 0, 0,
228, 128, 4, 0, 170, 144,
1, 0, 228, 128, 46, 0,
0, 2, 0, 0, 1, 176,
0, 0, 255, 128, 8, 0,
0, 4, 1, 0, 4, 128,
1, 0, 228, 144, 43, 32,
228, 160, 0, 0, 0, 176,
9, 0, 0, 4, 3, 0,
1, 128, 0, 0, 228, 144,
41, 32, 228, 160, 0, 0,
0, 176, 9, 0, 0, 4,
3, 0, 2, 128, 0, 0,
228, 144, 42, 32, 228, 160,
0, 0, 0, 176, 9, 0,
0, 4, 3, 0, 4, 128,
0, 0, 228, 144, 43, 32,
228, 160, 0, 0, 0, 176,
4, 0, 0, 4, 2, 0, 4, 0, 0, 4, 2, 0,
7, 128, 3, 0, 228, 128, 7, 128, 3, 0, 228, 128,
4, 0, 0, 144, 2, 0, 4, 0, 255, 144, 2, 0,
228, 128, 46, 0, 0, 2, 228, 128, 8, 0, 0, 4,
0, 0, 1, 176, 0, 0, 1, 0, 1, 128, 1, 0,
170, 128, 5, 0, 0, 4, 228, 144, 41, 32, 228, 160,
0, 0, 7, 128, 1, 0, 0, 0, 0, 176, 8, 0,
85, 144, 42, 32, 228, 160, 0, 4, 1, 0, 2, 128,
0, 0, 0, 176, 4, 0, 1, 0, 228, 144, 42, 32,
0, 5, 0, 0, 7, 128,
41, 32, 228, 160, 0, 0,
0, 176, 1, 0, 0, 144,
0, 0, 228, 128, 4, 0,
0, 5, 0, 0, 7, 128,
43, 32, 228, 160, 0, 0,
0, 176, 1, 0, 170, 144,
0, 0, 228, 128, 4, 0,
0, 4, 0, 0, 7, 128,
0, 0, 228, 128, 4, 0,
170, 144, 1, 0, 228, 128,
5, 0, 0, 4, 1, 0,
7, 128, 0, 0, 85, 144,
42, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 5,
1, 0, 7, 128, 41, 32,
228, 160, 0, 0, 0, 176, 228, 160, 0, 0, 0, 176,
0, 0, 0, 144, 1, 0,
228, 128, 4, 0, 0, 5,
1, 0, 7, 128, 43, 32,
228, 160, 0, 0, 0, 176,
0, 0, 170, 144, 1, 0,
228, 128, 4, 0, 0, 5,
1, 0, 7, 128, 44, 32,
228, 160, 0, 0, 0, 176,
0, 0, 255, 144, 1, 0,
228, 128, 4, 0, 0, 4,
1, 0, 7, 128, 1, 0,
228, 128, 4, 0, 170, 144,
2, 0, 228, 128, 46, 0,
0, 2, 0, 0, 1, 176,
0, 0, 255, 128, 5, 0,
0, 4, 2, 0, 7, 128,
1, 0, 85, 144, 42, 32,
228, 160, 0, 0, 0, 176,
4, 0, 0, 5, 2, 0,
7, 128, 41, 32, 228, 160,
0, 0, 0, 176, 1, 0,
0, 144, 2, 0, 228, 128,
4, 0, 0, 5, 2, 0,
7, 128, 43, 32, 228, 160,
0, 0, 0, 176, 1, 0,
170, 144, 2, 0, 228, 128,
4, 0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0,
7, 128, 2, 0, 228, 128, 7, 128, 1, 0, 228, 128,
4, 0, 255, 144, 0, 0, 4, 0, 255, 144, 0, 0,
228, 128, 5, 0, 0, 4, 228, 128, 5, 0, 0, 3,
2, 0, 7, 128, 0, 0, 1, 0, 7, 128, 2, 0,
85, 144, 42, 32, 228, 160, 85, 128, 5, 0, 228, 160,
0, 0, 0, 176, 4, 0, 4, 0, 0, 4, 1, 0,
0, 5, 2, 0, 7, 128, 7, 128, 4, 0, 228, 160,
41, 32, 228, 160, 0, 0, 2, 0, 0, 128, 1, 0,
0, 176, 0, 0, 0, 144, 228, 128, 4, 0, 0, 4,
2, 0, 228, 128, 4, 0, 1, 0, 7, 128, 6, 0,
0, 5, 2, 0, 7, 128, 228, 160, 2, 0, 170, 128,
43, 32, 228, 160, 0, 0, 1, 0, 228, 128, 2, 0,
0, 176, 0, 0, 170, 144, 0, 3, 1, 0, 7, 128,
2, 0, 228, 128, 4, 0, 1, 0, 228, 128, 7, 0,
0, 5, 2, 0, 7, 128, 228, 160, 5, 0, 0, 3,
44, 32, 228, 160, 0, 0, 3, 0, 7, 128, 0, 0,
0, 176, 0, 0, 255, 144, 85, 128, 9, 0, 228, 160,
2, 0, 228, 128, 4, 0,
0, 4, 1, 0, 7, 128,
2, 0, 228, 128, 4, 0,
255, 144, 1, 0, 228, 128,
5, 0, 0, 3, 2, 0,
7, 128, 1, 0, 85, 128,
5, 0, 228, 160, 4, 0,
0, 4, 2, 0, 7, 128,
4, 0, 228, 160, 1, 0,
0, 128, 2, 0, 228, 128,
4, 0, 0, 4, 2, 0,
7, 128, 6, 0, 228, 160,
1, 0, 170, 128, 2, 0,
228, 128, 2, 0, 0, 3,
2, 0, 7, 128, 2, 0,
228, 128, 7, 0, 228, 160,
5, 0, 0, 3, 3, 0,
7, 128, 0, 0, 85, 128,
9, 0, 228, 160, 4, 0,
0, 4, 0, 0, 11, 128,
8, 0, 164, 160, 0, 0,
0, 128, 3, 0, 164, 128,
4, 0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0,
7, 128, 10, 0, 228, 160, 11, 128, 8, 0, 164, 160,
0, 0, 170, 128, 0, 0, 0, 0, 0, 128, 3, 0,
244, 128, 1, 0, 0, 2, 164, 128, 4, 0, 0, 4,
3, 0, 1, 128, 13, 0, 0, 0, 7, 128, 10, 0,
0, 160, 4, 0, 0, 4, 228, 160, 0, 0, 170, 128,
3, 0, 7, 128, 15, 0, 0, 0, 244, 128, 1, 0,
228, 160, 3, 0, 0, 128, 0, 2, 3, 0, 1, 128,
3, 0, 228, 144, 1, 0, 13, 0, 0, 160, 4, 0,
0, 4, 3, 0, 7, 128,
15, 0, 228, 160, 3, 0,
0, 128, 3, 0, 228, 144,
1, 0, 0, 2, 4, 0,
7, 128, 3, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 128, 11, 0, 85, 160,
38, 0, 0, 1, 0, 0,
228, 240, 2, 0, 0, 3,
1, 0, 8, 128, 0, 0,
255, 128, 16, 0, 0, 160,
5, 0, 0, 3, 1, 0,
8, 128, 1, 0, 255, 128,
11, 0, 0, 160, 46, 0,
0, 2, 0, 0, 1, 176,
1, 0, 255, 128, 8, 0,
0, 4, 1, 0, 8, 128,
0, 0, 228, 128, 19, 32,
228, 161, 0, 0, 0, 176,
11, 0, 0, 3, 1, 0,
8, 128, 1, 0, 255, 128,
11, 0, 85, 160, 5, 0,
0, 4, 5, 0, 7, 128,
1, 0, 255, 128, 17, 32,
228, 160, 0, 0, 0, 176,
4, 0, 0, 4, 4, 0,
7, 128, 5, 0, 228, 128,
13, 0, 170, 160, 4, 0,
228, 128, 2, 0, 0, 3,
0, 0, 8, 128, 0, 0,
255, 128, 11, 0, 170, 160,
39, 0, 0, 0, 1, 0,
0, 2, 3, 0, 7, 128,
4, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 128,
11, 0, 85, 160, 38, 0,
0, 1, 1, 0, 228, 240,
2, 0, 0, 3, 1, 0,
8, 128, 0, 0, 255, 128,
16, 0, 85, 160, 5, 0,
0, 3, 1, 0, 8, 128,
1, 0, 255, 128, 11, 0,
0, 160, 46, 0, 0, 2,
0, 0, 1, 176, 1, 0,
255, 128, 2, 0, 0, 4,
5, 0, 7, 128, 1, 0,
228, 128, 18, 32, 228, 161,
0, 0, 0, 176, 8, 0,
0, 3, 1, 0, 8, 128,
5, 0, 228, 128, 5, 0,
228, 128, 7, 0, 0, 2,
1, 0, 8, 128, 1, 0,
255, 128, 5, 0, 0, 3,
5, 0, 7, 128, 1, 0,
255, 128, 5, 0, 228, 128,
8, 0, 0, 3, 2, 0,
8, 128, 0, 0, 228, 128,
5, 0, 228, 129, 11, 0,
0, 3, 2, 0, 8, 128,
2, 0, 255, 128, 11, 0,
85, 160, 5, 0, 0, 4,
5, 0, 7, 128, 2, 0,
255, 128, 17, 32, 228, 160,
0, 0, 0, 176, 6, 0,
0, 2, 1, 0, 8, 128,
1, 0, 255, 128, 6, 0,
0, 3, 2, 0, 8, 128,
17, 32, 255, 160, 0, 0,
0, 176, 4, 0, 0, 4,
1, 0, 8, 128, 1, 0,
255, 128, 2, 0, 255, 129,
11, 0, 170, 160, 11, 0,
0, 3, 1, 0, 8, 128,
1, 0, 255, 128, 11, 0,
85, 160, 5, 0, 0, 3,
5, 0, 7, 128, 1, 0,
255, 128, 5, 0, 228, 128,
4, 0, 0, 4, 3, 0,
7, 128, 5, 0, 228, 128,
13, 0, 170, 160, 3, 0,
228, 128, 2, 0, 0, 3,
0, 0, 8, 128, 0, 0,
255, 128, 11, 0, 170, 160,
39, 0, 0, 0, 1, 0,
0, 2, 4, 0, 7, 128, 0, 2, 4, 0, 7, 128,
3, 0, 228, 128, 1, 0, 3, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 128, 0, 2, 0, 0, 8, 128,
11, 0, 85, 160, 38, 0, 11, 0, 85, 160, 38, 0,
0, 1, 0, 0, 228, 240, 0, 1, 2, 0, 228, 240,
2, 0, 0, 3, 1, 0, 2, 0, 0, 3, 1, 0,
8, 128, 0, 0, 255, 128, 8, 128, 0, 0, 255, 128,
16, 0, 0, 160, 5, 0, 16, 0, 170, 160, 5, 0,
0, 3, 1, 0, 8, 128, 0, 3, 1, 0, 8, 128,
1, 0, 255, 128, 11, 0, 1, 0, 255, 128, 11, 0,
170, 160, 46, 0, 0, 2, 0, 160, 46, 0, 0, 2,
0, 0, 1, 176, 1, 0, 0, 0, 1, 176, 1, 0,
255, 128, 8, 0, 0, 4, 255, 128, 2, 0, 0, 4,
1, 0, 8, 128, 0, 0,
228, 128, 19, 32, 228, 161,
0, 0, 0, 176, 11, 0,
0, 3, 1, 0, 8, 128,
1, 0, 255, 128, 11, 0,
85, 160, 5, 0, 0, 4,
5, 0, 7, 128, 1, 0, 5, 0, 7, 128, 1, 0,
255, 128, 17, 32, 228, 160, 228, 128, 18, 32, 228, 161,
0, 0, 0, 176, 4, 0, 0, 0, 0, 176, 8, 0,
0, 4, 4, 0, 7, 128,
5, 0, 228, 128, 13, 0,
170, 160, 4, 0, 228, 128,
2, 0, 0, 3, 0, 0,
8, 128, 0, 0, 255, 128,
11, 0, 255, 160, 39, 0,
0, 0, 1, 0, 0, 2,
3, 0, 7, 128, 4, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 128, 11, 0,
85, 160, 38, 0, 0, 1,
1, 0, 228, 240, 2, 0,
0, 3, 1, 0, 8, 128, 0, 3, 1, 0, 8, 128,
0, 0, 255, 128, 16, 0, 5, 0, 228, 128, 5, 0,
85, 160, 5, 0, 0, 3, 228, 128, 7, 0, 0, 2,
1, 0, 8, 128, 1, 0, 1, 0, 8, 128, 1, 0,
255, 128, 11, 0, 170, 160, 255, 128, 5, 0, 0, 3,
46, 0, 0, 2, 0, 0, 5, 0, 7, 128, 1, 0,
1, 176, 1, 0, 255, 128, 255, 128, 5, 0, 228, 128,
8, 0, 0, 3, 2, 0,
8, 128, 0, 0, 228, 128,
5, 0, 228, 129, 8, 0,
0, 4, 3, 0, 8, 128,
5, 0, 228, 128, 19, 32,
228, 160, 0, 0, 0, 176,
11, 0, 0, 3, 2, 0,
8, 128, 2, 0, 255, 128,
11, 0, 85, 160, 2, 0,
0, 4, 3, 0, 8, 128,
3, 0, 255, 128, 18, 32,
255, 160, 0, 0, 0, 176,
1, 0, 0, 2, 5, 0,
4, 128, 11, 0, 170, 160,
2, 0, 0, 4, 5, 0, 2, 0, 0, 4, 5, 0,
7, 128, 2, 0, 228, 128, 1, 128, 5, 0, 170, 128,
18, 32, 228, 161, 0, 0, 18, 32, 255, 160, 0, 0,
0, 176, 8, 0, 0, 3, 0, 176, 6, 0, 0, 2,
1, 0, 8, 128, 5, 0, 5, 0, 1, 128, 5, 0,
228, 128, 5, 0, 228, 128, 0, 128, 5, 0, 0, 3,
7, 0, 0, 2, 1, 0, 3, 0, 8, 128, 3, 0,
8, 128, 1, 0, 255, 128, 255, 128, 5, 0, 0, 128,
5, 0, 0, 3, 5, 0, 12, 0, 0, 3, 5, 0,
7, 128, 1, 0, 255, 128, 1, 128, 3, 0, 255, 128,
5, 0, 228, 128, 8, 0, 11, 0, 85, 160, 4, 0,
0, 3, 2, 0, 8, 128, 0, 4, 2, 0, 8, 128,
0, 0, 228, 128, 5, 0, 5, 0, 0, 128, 2, 0,
228, 129, 11, 0, 0, 3, 255, 129, 2, 0, 255, 128,
11, 0, 0, 4, 3, 0,
8, 128, 3, 0, 255, 128,
19, 32, 255, 160, 0, 0,
0, 176, 5, 0, 0, 3,
2, 0, 8, 128, 2, 0, 2, 0, 8, 128, 2, 0,
255, 128, 11, 0, 85, 160, 255, 128, 3, 0, 255, 128,
5, 0, 0, 4, 5, 0, 5, 0, 0, 4, 5, 0,
7, 128, 2, 0, 255, 128, 7, 128, 2, 0, 255, 128,
17, 32, 228, 160, 0, 0, 17, 32, 228, 160, 0, 0,
@ -558,135 +611,54 @@ const BYTE g_vs20_main[] =
4, 0, 0, 4, 1, 0, 4, 0, 0, 4, 1, 0,
8, 128, 1, 0, 255, 128, 8, 128, 1, 0, 255, 128,
2, 0, 255, 129, 11, 0, 2, 0, 255, 129, 11, 0,
255, 160, 11, 0, 0, 3, 170, 160, 11, 0, 0, 3,
1, 0, 8, 128, 1, 0, 1, 0, 8, 128, 1, 0,
255, 128, 11, 0, 85, 160, 255, 128, 11, 0, 85, 160,
5, 0, 0, 3, 5, 0, 5, 0, 0, 3, 5, 0,
7, 128, 1, 0, 255, 128, 7, 128, 1, 0, 255, 128,
5, 0, 228, 128, 4, 0, 5, 0, 228, 128, 4, 0,
0, 4, 3, 0, 7, 128, 0, 4, 4, 0, 7, 128,
5, 0, 228, 128, 13, 0, 5, 0, 228, 128, 13, 0,
170, 160, 3, 0, 228, 128, 170, 160, 4, 0, 228, 128,
2, 0, 0, 3, 0, 0, 2, 0, 0, 3, 0, 0,
8, 128, 0, 0, 255, 128, 8, 128, 0, 0, 255, 128,
11, 0, 255, 160, 39, 0, 11, 0, 170, 160, 39, 0,
0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 2,
4, 0, 7, 128, 3, 0, 4, 0, 8, 128, 3, 0,
228, 128, 1, 0, 0, 2, 255, 144, 11, 0, 0, 3,
0, 0, 8, 128, 11, 0, 0, 0, 15, 128, 4, 0,
85, 160, 38, 0, 0, 1, 228, 128, 11, 0, 85, 160,
2, 0, 228, 240, 2, 0, 10, 0, 0, 3, 0, 0,
0, 3, 1, 0, 8, 128, 15, 128, 0, 0, 228, 128,
0, 0, 255, 128, 16, 0, 11, 0, 170, 160, 5, 0,
170, 160, 5, 0, 0, 3, 0, 3, 0, 0, 15, 208,
1, 0, 8, 128, 1, 0, 0, 0, 228, 128, 12, 0,
255, 128, 11, 0, 170, 160, 228, 160, 5, 0, 0, 3,
46, 0, 0, 2, 0, 0, 0, 0, 15, 128, 2, 0,
1, 176, 1, 0, 255, 128, 85, 128, 1, 0, 228, 160,
2, 0, 0, 4, 5, 0,
7, 128, 2, 0, 228, 128,
18, 32, 228, 161, 0, 0,
0, 176, 8, 0, 0, 3,
1, 0, 8, 128, 5, 0,
228, 128, 5, 0, 228, 128,
7, 0, 0, 2, 1, 0,
8, 128, 1, 0, 255, 128,
5, 0, 0, 3, 5, 0,
7, 128, 1, 0, 255, 128,
5, 0, 228, 128, 8, 0,
0, 3, 2, 0, 8, 128,
0, 0, 228, 128, 5, 0,
228, 129, 8, 0, 0, 4,
3, 0, 8, 128, 5, 0,
228, 128, 19, 32, 228, 160,
0, 0, 0, 176, 11, 0,
0, 3, 2, 0, 8, 128,
2, 0, 255, 128, 11, 0,
85, 160, 2, 0, 0, 4,
3, 0, 8, 128, 3, 0,
255, 128, 18, 32, 255, 160,
0, 0, 0, 176, 1, 0,
0, 2, 5, 0, 8, 128,
11, 0, 255, 160, 2, 0,
0, 4, 5, 0, 1, 128,
5, 0, 255, 128, 18, 32,
255, 160, 0, 0, 0, 176,
6, 0, 0, 2, 5, 0,
1, 128, 5, 0, 0, 128,
5, 0, 0, 3, 3, 0,
8, 128, 3, 0, 255, 128,
5, 0, 0, 128, 12, 0,
0, 3, 5, 0, 1, 128,
3, 0, 255, 128, 11, 0,
85, 160, 4, 0, 0, 4,
2, 0, 8, 128, 5, 0,
0, 128, 2, 0, 255, 129,
2, 0, 255, 128, 11, 0,
0, 4, 3, 0, 8, 128,
3, 0, 255, 128, 19, 32,
255, 160, 0, 0, 0, 176,
5, 0, 0, 3, 2, 0,
8, 128, 2, 0, 255, 128,
3, 0, 255, 128, 5, 0,
0, 4, 5, 0, 7, 128,
2, 0, 255, 128, 17, 32,
228, 160, 0, 0, 0, 176,
6, 0, 0, 2, 1, 0,
8, 128, 1, 0, 255, 128,
6, 0, 0, 3, 2, 0,
8, 128, 17, 32, 255, 160,
0, 0, 0, 176, 4, 0,
0, 4, 1, 0, 8, 128,
1, 0, 255, 128, 2, 0,
255, 129, 11, 0, 255, 160,
11, 0, 0, 3, 1, 0,
8, 128, 1, 0, 255, 128,
11, 0, 85, 160, 5, 0,
0, 3, 5, 0, 7, 128,
1, 0, 255, 128, 5, 0,
228, 128, 4, 0, 0, 4,
4, 0, 7, 128, 5, 0,
228, 128, 13, 0, 170, 160,
4, 0, 228, 128, 2, 0,
0, 3, 0, 0, 8, 128,
0, 0, 255, 128, 11, 0,
255, 160, 39, 0, 0, 0,
1, 0, 0, 2, 4, 0,
8, 128, 3, 0, 255, 144,
11, 0, 0, 3, 0, 0,
15, 128, 4, 0, 228, 128,
11, 0, 85, 160, 10, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 11, 0,
255, 160, 5, 0, 0, 3,
0, 0, 15, 208, 0, 0,
228, 128, 12, 0, 228, 160,
5, 0, 0, 3, 0, 0,
15, 128, 1, 0, 85, 128,
1, 0, 228, 160, 4, 0,
0, 4, 0, 0, 15, 128,
0, 0, 228, 160, 1, 0,
0, 128, 0, 0, 228, 128,
4, 0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0,
15, 128, 2, 0, 228, 160, 15, 128, 0, 0, 228, 160,
1, 0, 170, 128, 0, 0, 2, 0, 0, 128, 0, 0,
228, 128, 4, 0, 0, 4,
0, 0, 15, 128, 2, 0,
228, 160, 2, 0, 170, 128,
0, 0, 228, 128, 2, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 3, 0,
228, 160, 1, 0, 0, 2,
0, 0, 15, 192, 0, 0,
228, 128, 2, 0, 0, 3, 228, 128, 2, 0, 0, 3,
0, 0, 15, 128, 0, 0, 0, 0, 1, 128, 0, 0,
228, 128, 3, 0, 228, 160, 255, 128, 14, 0, 85, 161,
1, 0, 0, 2, 0, 0, 5, 0, 0, 3, 0, 0,
15, 192, 0, 0, 228, 128, 1, 128, 0, 0, 0, 128,
2, 0, 0, 3, 0, 0, 14, 0, 170, 160, 11, 0,
1, 128, 0, 0, 255, 128,
14, 0, 85, 161, 5, 0,
0, 3, 0, 0, 1, 128, 0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 14, 0, 0, 0, 0, 128, 14, 0,
170, 160, 11, 0, 0, 3, 255, 160, 10, 0, 0, 3,
0, 0, 1, 128, 0, 0, 0, 0, 4, 224, 0, 0,
0, 128, 14, 0, 255, 160, 0, 128, 11, 0, 170, 160,
10, 0, 0, 3, 0, 0, 1, 0, 0, 2, 0, 0,
4, 224, 0, 0, 0, 128, 3, 224, 2, 0, 228, 144,
11, 0, 255, 160, 1, 0, 255, 255, 0, 0
0, 2, 0, 0, 3, 224,
2, 0, 228, 144, 255, 255,
0, 0
}; };

View File

@ -8,7 +8,7 @@
// Parameters: // Parameters:
// //
// float4 ambientLight; // float4 ambientLight;
// float4x4 boneMatrices[64]; // float4x3 boneMatrices[64];
// float4x4 combinedMat; // float4x4 combinedMat;
// float4 fogData; // float4 fogData;
// float4 matCol; // float4 matCol;
@ -24,11 +24,11 @@
// surfProps c13 1 // surfProps c13 1
// fogData c14 1 // fogData c14 1
// ambientLight c15 1 // ambientLight c15 1
// boneMatrices c41 256 // boneMatrices c41 192
// //
vs_2_0 vs_2_0
def c4, 4, 0, 1, 0 def c4, 3, 0, 1, 0
dcl_position v0 dcl_position v0
dcl_texcoord v1 dcl_texcoord v1
dcl_color v2 dcl_color v2
@ -42,27 +42,23 @@
mul oD0, r0, c12 mul oD0, r0, c12
mul r0, v4, c4.x mul r0, v4, c4.x
mova a0.x, r0.y mova a0.x, r0.y
mul r1.xyz, v0.y, c42[a0.x] dp4 r1.x, v0, c41[a0.x]
mad r1.xyz, c41[a0.x], v0.x, r1 dp4 r1.y, v0, c42[a0.x]
mad r1.xyz, c43[a0.x], v0.z, r1 dp4 r1.z, v0, c43[a0.x]
mad r1.xyz, c44[a0.x], v0.w, r1
mul r1.xyz, r1, v3.y mul r1.xyz, r1, v3.y
mova a0.x, r0.x mova a0.x, r0.x
mul r2.xyz, v0.y, c42[a0.x] dp4 r2.x, v0, c41[a0.x]
mad r2.xyz, c41[a0.x], v0.x, r2 dp4 r2.y, v0, c42[a0.x]
mad r2.xyz, c43[a0.x], v0.z, r2 dp4 r2.z, v0, c43[a0.x]
mad r2.xyz, c44[a0.x], v0.w, r2
mad r1.xyz, r2, v3.x, r1 mad r1.xyz, r2, v3.x, r1
mova a0.xy, r0.zwzw mova a0.xy, r0.zwzw
mul r0.xyz, v0.y, c42[a0.x] dp4 r0.x, v0, c41[a0.x]
mad r0.xyz, c41[a0.x], v0.x, r0 dp4 r0.y, v0, c42[a0.x]
mad r0.xyz, c43[a0.x], v0.z, r0 dp4 r0.z, v0, c43[a0.x]
mad r0.xyz, c44[a0.x], v0.w, r0
mad r0.xyz, r0, v3.z, r1 mad r0.xyz, r0, v3.z, r1
mul r1.xyz, v0.y, c42[a0.y] dp4 r1.x, v0, c41[a0.y]
mad r1.xyz, c41[a0.y], v0.x, r1 dp4 r1.y, v0, c42[a0.y]
mad r1.xyz, c43[a0.y], v0.z, r1 dp4 r1.z, v0, c43[a0.y]
mad r1.xyz, c44[a0.y], v0.w, r1
mad r0.xyz, r1, v3.w, r0 mad r0.xyz, r1, v3.w, r0
mul r1, r0.y, c1 mul r1, r0.y, c1
mad r1, c0, r0.x, r1 mad r1, c0, r0.x, r1
@ -75,7 +71,7 @@
min oT0.z, r0.x, c4.z min oT0.z, r0.x, c4.z
mov oT0.xy, v1 mov oT0.xy, v1
// approximately 40 instruction slots used // approximately 36 instruction slots used
#endif #endif
const BYTE g_vs20_main[] = const BYTE g_vs20_main[] =
@ -91,7 +87,7 @@ const BYTE g_vs20_main[] =
1, 0, 62, 0, 164, 0, 1, 0, 62, 0, 164, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
180, 0, 0, 0, 2, 0, 180, 0, 0, 0, 2, 0,
41, 0, 0, 1, 166, 0, 41, 0, 192, 0, 166, 0,
196, 0, 0, 0, 0, 0, 196, 0, 0, 0, 0, 0,
0, 0, 212, 0, 0, 0, 0, 0, 212, 0, 0, 0,
2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0,
@ -115,7 +111,7 @@ const BYTE g_vs20_main[] =
98, 111, 110, 101, 77, 97, 98, 111, 110, 101, 77, 97,
116, 114, 105, 99, 101, 115, 116, 114, 105, 99, 101, 115,
0, 171, 171, 171, 3, 0, 0, 171, 171, 171, 3, 0,
3, 0, 4, 0, 4, 0, 3, 0, 4, 0, 3, 0,
64, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0,
0, 0, 99, 111, 109, 98, 0, 0, 99, 111, 109, 98,
105, 110, 101, 100, 77, 97, 105, 110, 101, 100, 77, 97,
@ -137,7 +133,7 @@ const BYTE g_vs20_main[] =
57, 53, 50, 46, 51, 49, 57, 53, 50, 46, 51, 49,
49, 49, 0, 171, 171, 171, 49, 49, 0, 171, 171, 171,
81, 0, 0, 5, 4, 0, 81, 0, 0, 5, 4, 0,
15, 160, 0, 0, 128, 64, 15, 160, 0, 0, 64, 64,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
128, 63, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0,
31, 0, 0, 2, 0, 0, 31, 0, 0, 2, 0, 0,
@ -170,110 +166,88 @@ const BYTE g_vs20_main[] =
228, 144, 4, 0, 0, 160, 228, 144, 4, 0, 0, 160,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
1, 176, 0, 0, 85, 128, 1, 176, 0, 0, 85, 128,
5, 0, 0, 4, 1, 0, 9, 0, 0, 4, 1, 0,
7, 128, 0, 0, 85, 144, 1, 128, 0, 0, 228, 144,
41, 32, 228, 160, 0, 0,
0, 176, 9, 0, 0, 4,
1, 0, 2, 128, 0, 0,
228, 144, 42, 32, 228, 160,
0, 0, 0, 176, 9, 0,
0, 4, 1, 0, 4, 128,
0, 0, 228, 144, 43, 32,
228, 160, 0, 0, 0, 176,
5, 0, 0, 3, 1, 0,
7, 128, 1, 0, 228, 128,
3, 0, 85, 144, 46, 0,
0, 2, 0, 0, 1, 176,
0, 0, 0, 128, 9, 0,
0, 4, 2, 0, 1, 128,
0, 0, 228, 144, 41, 32,
228, 160, 0, 0, 0, 176,
9, 0, 0, 4, 2, 0,
2, 128, 0, 0, 228, 144,
42, 32, 228, 160, 0, 0, 42, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 5, 0, 176, 9, 0, 0, 4,
1, 0, 7, 128, 41, 32, 2, 0, 4, 128, 0, 0,
228, 160, 0, 0, 0, 176, 228, 144, 43, 32, 228, 160,
0, 0, 0, 144, 1, 0, 0, 0, 0, 176, 4, 0,
228, 128, 4, 0, 0, 5, 0, 4, 1, 0, 7, 128,
1, 0, 7, 128, 43, 32, 2, 0, 228, 128, 3, 0,
228, 160, 0, 0, 0, 176, 0, 144, 1, 0, 228, 128,
0, 0, 170, 144, 1, 0,
228, 128, 4, 0, 0, 5,
1, 0, 7, 128, 44, 32,
228, 160, 0, 0, 0, 176,
0, 0, 255, 144, 1, 0,
228, 128, 5, 0, 0, 3,
1, 0, 7, 128, 1, 0,
228, 128, 3, 0, 85, 144,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
1, 176, 0, 0, 0, 128, 3, 176, 0, 0, 238, 128,
5, 0, 0, 4, 2, 0, 9, 0, 0, 4, 0, 0,
7, 128, 0, 0, 85, 144, 1, 128, 0, 0, 228, 144,
42, 32, 228, 160, 0, 0, 41, 32, 228, 160, 0, 0,
0, 176, 4, 0, 0, 5, 0, 176, 9, 0, 0, 4,
2, 0, 7, 128, 41, 32, 0, 0, 2, 128, 0, 0,
228, 144, 42, 32, 228, 160,
0, 0, 0, 176, 9, 0,
0, 4, 0, 0, 4, 128,
0, 0, 228, 144, 43, 32,
228, 160, 0, 0, 0, 176, 228, 160, 0, 0, 0, 176,
0, 0, 0, 144, 2, 0,
228, 128, 4, 0, 0, 5,
2, 0, 7, 128, 43, 32,
228, 160, 0, 0, 0, 176,
0, 0, 170, 144, 2, 0,
228, 128, 4, 0, 0, 5,
2, 0, 7, 128, 44, 32,
228, 160, 0, 0, 0, 176,
0, 0, 255, 144, 2, 0,
228, 128, 4, 0, 0, 4,
1, 0, 7, 128, 2, 0,
228, 128, 3, 0, 0, 144,
1, 0, 228, 128, 46, 0,
0, 2, 0, 0, 3, 176,
0, 0, 238, 128, 5, 0,
0, 4, 0, 0, 7, 128,
0, 0, 85, 144, 42, 32,
228, 160, 0, 0, 0, 176,
4, 0, 0, 5, 0, 0,
7, 128, 41, 32, 228, 160,
0, 0, 0, 176, 0, 0,
0, 144, 0, 0, 228, 128,
4, 0, 0, 5, 0, 0,
7, 128, 43, 32, 228, 160,
0, 0, 0, 176, 0, 0,
170, 144, 0, 0, 228, 128,
4, 0, 0, 5, 0, 0,
7, 128, 44, 32, 228, 160,
0, 0, 0, 176, 0, 0,
255, 144, 0, 0, 228, 128,
4, 0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0,
7, 128, 0, 0, 228, 128, 7, 128, 0, 0, 228, 128,
3, 0, 170, 144, 1, 0, 3, 0, 170, 144, 1, 0,
228, 128, 5, 0, 0, 4, 228, 128, 9, 0, 0, 4,
1, 0, 7, 128, 0, 0, 1, 0, 1, 128, 0, 0,
85, 144, 42, 32, 228, 160, 228, 144, 41, 32, 228, 160,
0, 0, 85, 176, 4, 0, 0, 0, 85, 176, 9, 0,
0, 5, 1, 0, 7, 128, 0, 4, 1, 0, 2, 128,
41, 32, 228, 160, 0, 0, 0, 0, 228, 144, 42, 32,
85, 176, 0, 0, 0, 144, 228, 160, 0, 0, 85, 176,
1, 0, 228, 128, 4, 0, 9, 0, 0, 4, 1, 0,
0, 5, 1, 0, 7, 128, 4, 128, 0, 0, 228, 144,
43, 32, 228, 160, 0, 0, 43, 32, 228, 160, 0, 0,
85, 176, 0, 0, 170, 144, 85, 176, 4, 0, 0, 4,
1, 0, 228, 128, 4, 0, 0, 0, 7, 128, 1, 0,
0, 5, 1, 0, 7, 128, 228, 128, 3, 0, 255, 144,
44, 32, 228, 160, 0, 0,
85, 176, 0, 0, 255, 144,
1, 0, 228, 128, 4, 0,
0, 4, 0, 0, 7, 128,
1, 0, 228, 128, 3, 0,
255, 144, 0, 0, 228, 128,
5, 0, 0, 3, 1, 0,
15, 128, 0, 0, 85, 128,
1, 0, 228, 160, 4, 0,
0, 4, 1, 0, 15, 128,
0, 0, 228, 160, 0, 0,
0, 128, 1, 0, 228, 128,
4, 0, 0, 4, 0, 0,
15, 128, 2, 0, 228, 160,
0, 0, 170, 128, 1, 0,
228, 128, 2, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 128, 3, 0, 228, 160,
2, 0, 0, 3, 1, 0,
1, 128, 0, 0, 255, 128,
14, 0, 85, 161, 1, 0,
0, 2, 0, 0, 15, 192,
0, 0, 228, 128, 5, 0, 0, 0, 228, 128, 5, 0,
0, 3, 0, 0, 1, 128, 0, 3, 1, 0, 15, 128,
1, 0, 0, 128, 14, 0, 0, 0, 85, 128, 1, 0,
170, 160, 11, 0, 0, 3, 228, 160, 4, 0, 0, 4,
0, 0, 1, 128, 0, 0, 1, 0, 15, 128, 0, 0,
0, 128, 14, 0, 255, 160, 228, 160, 0, 0, 0, 128,
10, 0, 0, 3, 0, 0, 1, 0, 228, 128, 4, 0,
4, 224, 0, 0, 0, 128, 0, 4, 0, 0, 15, 128,
4, 0, 170, 160, 1, 0, 2, 0, 228, 160, 0, 0,
0, 2, 0, 0, 3, 224, 170, 128, 1, 0, 228, 128,
1, 0, 228, 144, 255, 255, 2, 0, 0, 3, 0, 0,
0, 0 15, 128, 0, 0, 228, 128,
3, 0, 228, 160, 2, 0,
0, 3, 1, 0, 1, 128,
0, 0, 255, 128, 14, 0,
85, 161, 1, 0, 0, 2,
0, 0, 15, 192, 0, 0,
228, 128, 5, 0, 0, 3,
0, 0, 1, 128, 1, 0,
0, 128, 14, 0, 170, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
14, 0, 255, 160, 10, 0,
0, 3, 0, 0, 4, 224,
0, 0, 0, 128, 4, 0,
170, 160, 1, 0, 0, 2,
0, 0, 3, 224, 1, 0,
228, 144, 255, 255, 0, 0
}; };

View File

@ -8,7 +8,7 @@
// Parameters: // Parameters:
// //
// float4 ambientLight; // float4 ambientLight;
// float4x4 boneMatrices[64]; // float4x3 boneMatrices[64];
// float4x4 combinedMat; // float4x4 combinedMat;
// int4 firstLight; // int4 firstLight;
// float4 fogData; // float4 fogData;
@ -40,11 +40,11 @@
// ambientLight c15 1 // ambientLight c15 1
// firstLight c16 1 // firstLight c16 1
// lights c17 24 // lights c17 24
// boneMatrices c41 256 // boneMatrices c41 192
// //
vs_2_0 vs_2_0
def c4, 4, 0, 3, 1 def c4, 3, 0, 1, 0
dcl_position v0 dcl_position v0
dcl_normal v1 dcl_normal v1
dcl_texcoord v2 dcl_texcoord v2
@ -53,32 +53,32 @@
dcl_blendindices v5 dcl_blendindices v5
mul r0, v5, c4.x mul r0, v5, c4.x
mova a0.w, r0.x mova a0.w, r0.x
mul r1.xyz, v1.y, c42[a0.w] dp3 r1.z, v1, c43[a0.w]
mova a0.w, r0.x mova a0.w, r0.x
mad r1.xyz, c41[a0.w], v1.x, r1 dp3 r1.x, v1, c41[a0.w]
mova a0.w, r0.x mova a0.w, r0.x
mad r1.xyz, c43[a0.w], v1.z, r1 dp3 r1.y, v1, c42[a0.w]
mova a0.w, r0.y mova a0.w, r0.y
mul r2.xyz, v1.y, c42[a0.w] dp3 r2.z, v1, c43[a0.w]
mova a0.w, r0.y mova a0.w, r0.y
mad r2.xyz, c41[a0.w], v1.x, r2 dp3 r2.x, v1, c41[a0.w]
mova a0.w, r0.y mova a0.w, r0.y
mad r2.xyz, c43[a0.w], v1.z, r2 dp3 r2.y, v1, c42[a0.w]
mul r2.xyz, r2, v4.y mul r2.xyz, r2, v4.y
mad r1.xyz, r1, v4.x, r2 mad r1.xyz, r1, v4.x, r2
mova a0.w, r0.z mova a0.w, r0.z
mul r2.xyz, v1.y, c42[a0.w] dp3 r2.z, v1, c43[a0.w]
mova a0.w, r0.z mova a0.w, r0.z
mad r2.xyz, c41[a0.w], v1.x, r2 dp3 r2.x, v1, c41[a0.w]
mova a0.w, r0.z mova a0.w, r0.z
mad r2.xyz, c43[a0.w], v1.z, r2 dp3 r2.y, v1, c42[a0.w]
mad r1.xyz, r2, v4.z, r1 mad r1.xyz, r2, v4.z, r1
mova a0.w, r0.w mova a0.w, r0.w
mul r2.xyz, v1.y, c42[a0.w] dp3 r2.z, v1, c43[a0.w]
mova a0.w, r0.w mova a0.w, r0.w
mad r2.xyz, c41[a0.w], v1.x, r2 dp3 r2.x, v1, c41[a0.w]
mova a0.w, r0.w mova a0.w, r0.w
mad r2.xyz, c43[a0.w], v1.z, r2 dp3 r2.y, v1, c42[a0.w]
mad r1.xyz, r2, v4.w, r1 mad r1.xyz, r2, v4.w, r1
mul r2.xyz, r1.y, c9 mul r2.xyz, r1.y, c9
mad r1.xyw, c8.xyzz, r1.x, r2.xyzz mad r1.xyw, c8.xyzz, r1.x, r2.xyzz
@ -89,54 +89,46 @@
mov r1.w, c4.y mov r1.w, c4.y
rep i0 rep i0
add r2.w, r1.w, c16.x add r2.w, r1.w, c16.x
mul r2.w, r2.w, c4.z mul r2.w, r2.w, c4.x
mova a0.w, r2.w mova a0.w, r2.w
dp3 r4.x, r1, -c19[a0.w] dp3 r4.x, r1, -c19[a0.w]
max r4.x, r4.x, c4.y max r4.x, r4.x, c4.y
mova a0.w, r2.w mova a0.w, r2.w
mul r4.xyz, r4.x, c17[a0.w] mul r4.xyz, r4.x, c17[a0.w]
mad r3.xyz, r4, c13.z, r3 mad r3.xyz, r4, c13.z, r3
add r1.w, r1.w, c4.w add r1.w, r1.w, c4.z
endrep endrep
mov r3.w, v3.w mov r3.w, v3.w
max r1, r3, c4.y max r1, r3, c4.y
min r1, r1, c4.w min r1, r1, c4.z
mul oD0, r1, c12 mul oD0, r1, c12
mova a0.w, r0.y mova a0.w, r0.y
mul r1.xyz, v0.y, c42[a0.w] dp4 r1.x, v0, c41[a0.w]
mova a0.w, r0.y mova a0.w, r0.y
mad r1.xyz, c41[a0.w], v0.x, r1 dp4 r1.y, v0, c42[a0.w]
mova a0.w, r0.y mova a0.w, r0.y
mad r1.xyz, c43[a0.w], v0.z, r1 dp4 r1.z, v0, c43[a0.w]
mova a0.w, r0.y
mad r1.xyz, c44[a0.w], v0.w, r1
mul r1.xyz, r1, v4.y mul r1.xyz, r1, v4.y
mova a0.w, r0.x mova a0.w, r0.x
mul r2.xyz, v0.y, c42[a0.w] dp4 r2.x, v0, c41[a0.w]
mova a0.w, r0.x mova a0.w, r0.x
mad r2.xyz, c41[a0.w], v0.x, r2 dp4 r2.y, v0, c42[a0.w]
mova a0.w, r0.x mova a0.w, r0.x
mad r2.xyz, c43[a0.w], v0.z, r2 dp4 r2.z, v0, c43[a0.w]
mova a0.w, r0.x
mad r2.xyz, c44[a0.w], v0.w, r2
mad r1.xyz, r2, v4.x, r1 mad r1.xyz, r2, v4.x, r1
mova a0.w, r0.z mova a0.w, r0.z
mul r2.xyz, v0.y, c42[a0.w] dp4 r2.x, v0, c41[a0.w]
mova a0.w, r0.z mova a0.w, r0.z
mad r2.xyz, c41[a0.w], v0.x, r2 dp4 r2.y, v0, c42[a0.w]
mova a0.w, r0.z mova a0.w, r0.z
mad r2.xyz, c43[a0.w], v0.z, r2 dp4 r2.z, v0, c43[a0.w]
mova a0.w, r0.z mad r0.xyz, r2, v4.z, r1
mad r0.xyz, c44[a0.w], v0.w, r2
mad r0.xyz, r0, v4.z, r1
mova a0.w, r0.w mova a0.w, r0.w
mul r1.xyz, v0.y, c42[a0.w] dp4 r1.x, v0, c41[a0.w]
mova a0.w, r0.w mova a0.w, r0.w
mad r1.xyz, c41[a0.w], v0.x, r1 dp4 r1.y, v0, c42[a0.w]
mova a0.w, r0.w mova a0.w, r0.w
mad r1.xyz, c43[a0.w], v0.z, r1 dp4 r1.z, v0, c43[a0.w]
mova a0.w, r0.w
mad r1.xyz, c44[a0.w], v0.w, r1
mad r0.xyz, r1, v4.w, r0 mad r0.xyz, r1, v4.w, r0
mul r1, r0.y, c1 mul r1, r0.y, c1
mad r1, c0, r0.x, r1 mad r1, c0, r0.x, r1
@ -146,10 +138,10 @@
add r0.x, r0.w, -c14.y add r0.x, r0.w, -c14.y
mul r0.x, r0.x, c14.z mul r0.x, r0.x, c14.z
max r0.x, r0.x, c14.w max r0.x, r0.x, c14.w
min oT0.z, r0.x, c4.w min oT0.z, r0.x, c4.z
mov oT0.xy, v2 mov oT0.xy, v2
// approximately 100 instruction slots used // approximately 92 instruction slots used
#endif #endif
const BYTE g_vs20_main[] = const BYTE g_vs20_main[] =
@ -165,7 +157,7 @@ const BYTE g_vs20_main[] =
1, 0, 62, 0, 244, 0, 1, 0, 62, 0, 244, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4, 1, 0, 0, 2, 0, 4, 1, 0, 0, 2, 0,
41, 0, 0, 1, 166, 0, 41, 0, 192, 0, 166, 0,
20, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0,
0, 0, 36, 1, 0, 0, 0, 0, 36, 1, 0, 0,
2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0,
@ -203,7 +195,7 @@ const BYTE g_vs20_main[] =
77, 97, 116, 114, 105, 99, 77, 97, 116, 114, 105, 99,
101, 115, 0, 171, 171, 171, 101, 115, 0, 171, 171, 171,
3, 0, 3, 0, 4, 0, 3, 0, 3, 0, 4, 0,
4, 0, 64, 0, 0, 0, 3, 0, 64, 0, 0, 0,
0, 0, 0, 0, 99, 111, 0, 0, 0, 0, 99, 111,
109, 98, 105, 110, 101, 100, 109, 98, 105, 110, 101, 100,
77, 97, 116, 0, 3, 0, 77, 97, 116, 0, 3, 0,
@ -255,9 +247,9 @@ const BYTE g_vs20_main[] =
46, 51, 49, 49, 49, 0, 46, 51, 49, 49, 49, 0,
171, 171, 81, 0, 0, 5, 171, 171, 81, 0, 0, 5,
4, 0, 15, 160, 0, 0, 4, 0, 15, 160, 0, 0,
128, 64, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0,
0, 0, 64, 64, 0, 0, 0, 0, 128, 63, 0, 0,
128, 63, 31, 0, 0, 2, 0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0, 0, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2, 15, 144, 31, 0, 0, 2,
3, 0, 0, 128, 1, 0, 3, 0, 0, 128, 1, 0,
@ -274,273 +266,238 @@ const BYTE g_vs20_main[] =
228, 144, 4, 0, 0, 160, 228, 144, 4, 0, 0, 160,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 0, 128, 8, 176, 0, 0, 0, 128,
5, 0, 0, 4, 1, 0, 8, 0, 0, 4, 1, 0,
7, 128, 1, 0, 85, 144, 4, 128, 1, 0, 228, 144,
42, 32, 228, 160, 0, 0, 43, 32, 228, 160, 0, 0,
255, 176, 46, 0, 0, 2, 255, 176, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0, 0, 0, 8, 176, 0, 0,
0, 128, 4, 0, 0, 5, 0, 128, 8, 0, 0, 4,
1, 0, 7, 128, 41, 32, 1, 0, 1, 128, 1, 0,
228, 160, 0, 0, 255, 176, 228, 144, 41, 32, 228, 160,
1, 0, 0, 144, 1, 0,
228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
0, 128, 4, 0, 0, 5,
1, 0, 7, 128, 43, 32,
228, 160, 0, 0, 255, 176,
1, 0, 170, 144, 1, 0,
228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
85, 128, 5, 0, 0, 4,
2, 0, 7, 128, 1, 0,
85, 144, 42, 32, 228, 160,
0, 0, 255, 176, 46, 0, 0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176, 0, 2, 0, 0, 8, 176,
0, 0, 85, 128, 4, 0, 0, 0, 0, 128, 8, 0,
0, 5, 2, 0, 7, 128, 0, 4, 1, 0, 2, 128,
41, 32, 228, 160, 0, 0, 1, 0, 228, 144, 42, 32,
255, 176, 1, 0, 0, 144,
2, 0, 228, 128, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 85, 128, 4, 0,
0, 5, 2, 0, 7, 128,
43, 32, 228, 160, 0, 0,
255, 176, 1, 0, 170, 144,
2, 0, 228, 128, 5, 0,
0, 3, 2, 0, 7, 128,
2, 0, 228, 128, 4, 0,
85, 144, 4, 0, 0, 4,
1, 0, 7, 128, 1, 0,
228, 128, 4, 0, 0, 144,
2, 0, 228, 128, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 170, 128, 5, 0,
0, 4, 2, 0, 7, 128,
1, 0, 85, 144, 42, 32,
228, 160, 0, 0, 255, 176, 228, 160, 0, 0, 255, 176,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 170, 128, 8, 176, 0, 0, 85, 128,
4, 0, 0, 5, 2, 0, 8, 0, 0, 4, 2, 0,
7, 128, 41, 32, 228, 160, 4, 128, 1, 0, 228, 144,
0, 0, 255, 176, 1, 0, 43, 32, 228, 160, 0, 0,
255, 176, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
85, 128, 8, 0, 0, 4,
2, 0, 1, 128, 1, 0,
228, 144, 41, 32, 228, 160,
0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 85, 128, 8, 0,
0, 4, 2, 0, 2, 128,
1, 0, 228, 144, 42, 32,
228, 160, 0, 0, 255, 176,
5, 0, 0, 3, 2, 0,
7, 128, 2, 0, 228, 128,
4, 0, 85, 144, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 228, 128, 4, 0,
0, 144, 2, 0, 228, 128, 0, 144, 2, 0, 228, 128,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 170, 128, 8, 176, 0, 0, 170, 128,
4, 0, 0, 5, 2, 0, 8, 0, 0, 4, 2, 0,
7, 128, 43, 32, 228, 160, 4, 128, 1, 0, 228, 144,
0, 0, 255, 176, 1, 0, 43, 32, 228, 160, 0, 0,
170, 144, 2, 0, 228, 128, 255, 176, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
170, 128, 8, 0, 0, 4,
2, 0, 1, 128, 1, 0,
228, 144, 41, 32, 228, 160,
0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 170, 128, 8, 0,
0, 4, 2, 0, 2, 128,
1, 0, 228, 144, 42, 32,
228, 160, 0, 0, 255, 176,
4, 0, 0, 4, 1, 0, 4, 0, 0, 4, 1, 0,
7, 128, 2, 0, 228, 128, 7, 128, 2, 0, 228, 128,
4, 0, 170, 144, 1, 0, 4, 0, 170, 144, 1, 0,
228, 128, 46, 0, 0, 2, 228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0, 0, 0, 8, 176, 0, 0,
255, 128, 5, 0, 0, 4,
2, 0, 7, 128, 1, 0,
85, 144, 42, 32, 228, 160,
0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 255, 128, 4, 0,
0, 5, 2, 0, 7, 128,
41, 32, 228, 160, 0, 0,
255, 176, 1, 0, 0, 144,
2, 0, 228, 128, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 255, 128, 4, 0,
0, 5, 2, 0, 7, 128,
43, 32, 228, 160, 0, 0,
255, 176, 1, 0, 170, 144,
2, 0, 228, 128, 4, 0,
0, 4, 1, 0, 7, 128,
2, 0, 228, 128, 4, 0,
255, 144, 1, 0, 228, 128,
5, 0, 0, 3, 2, 0,
7, 128, 1, 0, 85, 128,
9, 0, 228, 160, 4, 0,
0, 4, 1, 0, 11, 128,
8, 0, 164, 160, 1, 0,
0, 128, 2, 0, 164, 128,
4, 0, 0, 4, 1, 0,
7, 128, 10, 0, 228, 160,
1, 0, 170, 128, 1, 0,
244, 128, 1, 0, 0, 2,
2, 0, 1, 128, 13, 0,
0, 160, 4, 0, 0, 4,
2, 0, 7, 128, 15, 0,
228, 160, 2, 0, 0, 128,
3, 0, 228, 144, 1, 0,
0, 2, 3, 0, 7, 128,
2, 0, 228, 128, 1, 0,
0, 2, 1, 0, 8, 128,
4, 0, 85, 160, 38, 0,
0, 1, 0, 0, 228, 240,
2, 0, 0, 3, 2, 0,
8, 128, 1, 0, 255, 128,
16, 0, 0, 160, 5, 0,
0, 3, 2, 0, 8, 128,
2, 0, 255, 128, 4, 0,
170, 160, 46, 0, 0, 2,
0, 0, 8, 176, 2, 0,
255, 128, 8, 0, 0, 4, 255, 128, 8, 0, 0, 4,
4, 0, 1, 128, 1, 0, 2, 0, 4, 128, 1, 0,
228, 128, 19, 32, 228, 161, 228, 144, 43, 32, 228, 160,
0, 0, 255, 176, 11, 0,
0, 3, 4, 0, 1, 128,
4, 0, 0, 128, 4, 0,
85, 160, 46, 0, 0, 2,
0, 0, 8, 176, 2, 0,
255, 128, 5, 0, 0, 4,
4, 0, 7, 128, 4, 0,
0, 128, 17, 32, 228, 160,
0, 0, 255, 176, 4, 0,
0, 4, 3, 0, 7, 128,
4, 0, 228, 128, 13, 0,
170, 160, 3, 0, 228, 128,
2, 0, 0, 3, 1, 0,
8, 128, 1, 0, 255, 128,
4, 0, 255, 160, 39, 0,
0, 0, 1, 0, 0, 2,
3, 0, 8, 128, 3, 0,
255, 144, 11, 0, 0, 3,
1, 0, 15, 128, 3, 0,
228, 128, 4, 0, 85, 160,
10, 0, 0, 3, 1, 0,
15, 128, 1, 0, 228, 128,
4, 0, 255, 160, 5, 0,
0, 3, 0, 0, 15, 208,
1, 0, 228, 128, 12, 0,
228, 160, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
85, 128, 5, 0, 0, 4,
1, 0, 7, 128, 0, 0,
85, 144, 42, 32, 228, 160,
0, 0, 255, 176, 46, 0, 0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176, 0, 2, 0, 0, 8, 176,
0, 0, 85, 128, 4, 0, 0, 0, 255, 128, 8, 0,
0, 5, 1, 0, 7, 128, 0, 4, 2, 0, 1, 128,
41, 32, 228, 160, 0, 0, 1, 0, 228, 144, 41, 32,
255, 176, 0, 0, 0, 144, 228, 160, 0, 0, 255, 176,
1, 0, 228, 128, 46, 0, 46, 0, 0, 2, 0, 0,
0, 2, 0, 0, 8, 176, 8, 176, 0, 0, 255, 128,
0, 0, 85, 128, 4, 0, 8, 0, 0, 4, 2, 0,
0, 5, 1, 0, 7, 128, 2, 128, 1, 0, 228, 144,
43, 32, 228, 160, 0, 0, 42, 32, 228, 160, 0, 0,
255, 176, 0, 0, 170, 144, 255, 176, 4, 0, 0, 4,
1, 0, 228, 128, 46, 0, 1, 0, 7, 128, 2, 0,
0, 2, 0, 0, 8, 176, 228, 128, 4, 0, 255, 144,
0, 0, 85, 128, 4, 0,
0, 5, 1, 0, 7, 128,
44, 32, 228, 160, 0, 0,
255, 176, 0, 0, 255, 144,
1, 0, 228, 128, 5, 0, 1, 0, 228, 128, 5, 0,
0, 3, 1, 0, 7, 128, 0, 3, 2, 0, 7, 128,
1, 0, 85, 128, 9, 0,
228, 160, 4, 0, 0, 4,
1, 0, 11, 128, 8, 0,
164, 160, 1, 0, 0, 128,
2, 0, 164, 128, 4, 0,
0, 4, 1, 0, 7, 128,
10, 0, 228, 160, 1, 0,
170, 128, 1, 0, 244, 128,
1, 0, 0, 2, 2, 0,
1, 128, 13, 0, 0, 160,
4, 0, 0, 4, 2, 0,
7, 128, 15, 0, 228, 160,
2, 0, 0, 128, 3, 0,
228, 144, 1, 0, 0, 2,
3, 0, 7, 128, 2, 0,
228, 128, 1, 0, 0, 2,
1, 0, 8, 128, 4, 0,
85, 160, 38, 0, 0, 1,
0, 0, 228, 240, 2, 0,
0, 3, 2, 0, 8, 128,
1, 0, 255, 128, 16, 0,
0, 160, 5, 0, 0, 3,
2, 0, 8, 128, 2, 0,
255, 128, 4, 0, 0, 160,
46, 0, 0, 2, 0, 0,
8, 176, 2, 0, 255, 128,
8, 0, 0, 4, 4, 0,
1, 128, 1, 0, 228, 128,
19, 32, 228, 161, 0, 0,
255, 176, 11, 0, 0, 3,
4, 0, 1, 128, 4, 0,
0, 128, 4, 0, 85, 160,
46, 0, 0, 2, 0, 0,
8, 176, 2, 0, 255, 128,
5, 0, 0, 4, 4, 0,
7, 128, 4, 0, 0, 128,
17, 32, 228, 160, 0, 0,
255, 176, 4, 0, 0, 4,
3, 0, 7, 128, 4, 0,
228, 128, 13, 0, 170, 160,
3, 0, 228, 128, 2, 0,
0, 3, 1, 0, 8, 128,
1, 0, 255, 128, 4, 0,
170, 160, 39, 0, 0, 0,
1, 0, 0, 2, 3, 0,
8, 128, 3, 0, 255, 144,
11, 0, 0, 3, 1, 0,
15, 128, 3, 0, 228, 128,
4, 0, 85, 160, 10, 0,
0, 3, 1, 0, 15, 128,
1, 0, 228, 128, 4, 0, 1, 0, 228, 128, 4, 0,
85, 144, 46, 0, 0, 2, 170, 160, 5, 0, 0, 3,
0, 0, 15, 208, 1, 0,
228, 128, 12, 0, 228, 160,
46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 85, 128,
9, 0, 0, 4, 1, 0,
1, 128, 0, 0, 228, 144,
41, 32, 228, 160, 0, 0,
255, 176, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0, 0, 0, 8, 176, 0, 0,
0, 128, 5, 0, 0, 4, 85, 128, 9, 0, 0, 4,
2, 0, 7, 128, 0, 0, 1, 0, 2, 128, 0, 0,
85, 144, 42, 32, 228, 160, 228, 144, 42, 32, 228, 160,
0, 0, 255, 176, 46, 0, 0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176, 0, 2, 0, 0, 8, 176,
0, 0, 0, 128, 4, 0, 0, 0, 85, 128, 9, 0,
0, 5, 2, 0, 7, 128, 0, 4, 1, 0, 4, 128,
41, 32, 228, 160, 0, 0, 0, 0, 228, 144, 43, 32,
255, 176, 0, 0, 0, 144, 228, 160, 0, 0, 255, 176,
2, 0, 228, 128, 46, 0, 5, 0, 0, 3, 1, 0,
7, 128, 1, 0, 228, 128,
4, 0, 85, 144, 46, 0,
0, 2, 0, 0, 8, 176, 0, 2, 0, 0, 8, 176,
0, 0, 0, 128, 4, 0, 0, 0, 0, 128, 9, 0,
0, 5, 2, 0, 7, 128, 0, 4, 2, 0, 1, 128,
43, 32, 228, 160, 0, 0, 0, 0, 228, 144, 41, 32,
255, 176, 0, 0, 170, 144, 228, 160, 0, 0, 255, 176,
2, 0, 228, 128, 46, 0, 46, 0, 0, 2, 0, 0,
0, 2, 0, 0, 8, 176, 8, 176, 0, 0, 0, 128,
0, 0, 0, 128, 4, 0, 9, 0, 0, 4, 2, 0,
0, 5, 2, 0, 7, 128, 2, 128, 0, 0, 228, 144,
44, 32, 228, 160, 0, 0, 42, 32, 228, 160, 0, 0,
255, 176, 0, 0, 255, 144, 255, 176, 46, 0, 0, 2,
2, 0, 228, 128, 4, 0, 0, 0, 8, 176, 0, 0,
0, 128, 9, 0, 0, 4,
2, 0, 4, 128, 0, 0,
228, 144, 43, 32, 228, 160,
0, 0, 255, 176, 4, 0,
0, 4, 1, 0, 7, 128, 0, 4, 1, 0, 7, 128,
2, 0, 228, 128, 4, 0, 2, 0, 228, 128, 4, 0,
0, 144, 1, 0, 228, 128, 0, 144, 1, 0, 228, 128,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 170, 128, 8, 176, 0, 0, 170, 128,
5, 0, 0, 4, 2, 0, 9, 0, 0, 4, 2, 0,
7, 128, 0, 0, 85, 144, 1, 128, 0, 0, 228, 144,
42, 32, 228, 160, 0, 0, 41, 32, 228, 160, 0, 0,
255, 176, 46, 0, 0, 2, 255, 176, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0, 0, 0, 8, 176, 0, 0,
170, 128, 4, 0, 0, 5, 170, 128, 9, 0, 0, 4,
2, 0, 7, 128, 41, 32, 2, 0, 2, 128, 0, 0,
228, 160, 0, 0, 255, 176, 228, 144, 42, 32, 228, 160,
0, 0, 0, 144, 2, 0, 0, 0, 255, 176, 46, 0,
228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
170, 128, 4, 0, 0, 5,
2, 0, 7, 128, 43, 32,
228, 160, 0, 0, 255, 176,
0, 0, 170, 144, 2, 0,
228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
170, 128, 4, 0, 0, 5,
0, 0, 7, 128, 44, 32,
228, 160, 0, 0, 255, 176,
0, 0, 255, 144, 2, 0,
228, 128, 4, 0, 0, 4,
0, 0, 7, 128, 0, 0,
228, 128, 4, 0, 170, 144,
1, 0, 228, 128, 46, 0,
0, 2, 0, 0, 8, 176, 0, 2, 0, 0, 8, 176,
0, 0, 255, 128, 5, 0, 0, 0, 170, 128, 9, 0,
0, 4, 1, 0, 7, 128, 0, 4, 2, 0, 4, 128,
0, 0, 85, 144, 42, 32, 0, 0, 228, 144, 43, 32,
228, 160, 0, 0, 255, 176,
4, 0, 0, 4, 0, 0,
7, 128, 2, 0, 228, 128,
4, 0, 170, 144, 1, 0,
228, 128, 46, 0, 0, 2,
0, 0, 8, 176, 0, 0,
255, 128, 9, 0, 0, 4,
1, 0, 1, 128, 0, 0,
228, 144, 41, 32, 228, 160,
0, 0, 255, 176, 46, 0,
0, 2, 0, 0, 8, 176,
0, 0, 255, 128, 9, 0,
0, 4, 1, 0, 2, 128,
0, 0, 228, 144, 42, 32,
228, 160, 0, 0, 255, 176, 228, 160, 0, 0, 255, 176,
46, 0, 0, 2, 0, 0, 46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 255, 128, 8, 176, 0, 0, 255, 128,
4, 0, 0, 5, 1, 0, 9, 0, 0, 4, 1, 0,
7, 128, 41, 32, 228, 160, 4, 128, 0, 0, 228, 144,
0, 0, 255, 176, 0, 0, 43, 32, 228, 160, 0, 0,
0, 144, 1, 0, 228, 128, 255, 176, 4, 0, 0, 4,
46, 0, 0, 2, 0, 0, 0, 0, 7, 128, 1, 0,
8, 176, 0, 0, 255, 128, 228, 128, 4, 0, 255, 144,
4, 0, 0, 5, 1, 0, 0, 0, 228, 128, 5, 0,
7, 128, 43, 32, 228, 160, 0, 3, 1, 0, 15, 128,
0, 0, 255, 176, 0, 0, 0, 0, 85, 128, 1, 0,
170, 144, 1, 0, 228, 128, 228, 160, 4, 0, 0, 4,
46, 0, 0, 2, 0, 0,
8, 176, 0, 0, 255, 128,
4, 0, 0, 5, 1, 0,
7, 128, 44, 32, 228, 160,
0, 0, 255, 176, 0, 0,
255, 144, 1, 0, 228, 128,
4, 0, 0, 4, 0, 0,
7, 128, 1, 0, 228, 128,
4, 0, 255, 144, 0, 0,
228, 128, 5, 0, 0, 3,
1, 0, 15, 128, 0, 0, 1, 0, 15, 128, 0, 0,
85, 128, 1, 0, 228, 160, 228, 160, 0, 0, 0, 128,
4, 0, 0, 4, 1, 0, 1, 0, 228, 128, 4, 0,
15, 128, 0, 0, 228, 160, 0, 4, 0, 0, 15, 128,
0, 0, 0, 128, 1, 0, 2, 0, 228, 160, 0, 0,
228, 128, 4, 0, 0, 4, 170, 128, 1, 0, 228, 128,
0, 0, 15, 128, 2, 0, 2, 0, 0, 3, 0, 0,
228, 160, 0, 0, 170, 128, 15, 128, 0, 0, 228, 128,
1, 0, 228, 128, 2, 0, 3, 0, 228, 160, 1, 0,
0, 3, 0, 0, 15, 128, 0, 2, 0, 0, 15, 192,
0, 0, 228, 128, 3, 0, 0, 0, 228, 128, 2, 0,
228, 160, 1, 0, 0, 2,
0, 0, 15, 192, 0, 0,
228, 128, 2, 0, 0, 3,
0, 0, 1, 128, 0, 0,
255, 128, 14, 0, 85, 161,
5, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
14, 0, 170, 160, 11, 0,
0, 3, 0, 0, 1, 128, 0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 14, 0, 0, 0, 255, 128, 14, 0,
255, 160, 10, 0, 0, 3, 85, 161, 5, 0, 0, 3,
0, 0, 4, 224, 0, 0, 0, 0, 1, 128, 0, 0,
0, 128, 4, 0, 255, 160, 0, 128, 14, 0, 170, 160,
1, 0, 0, 2, 0, 0, 11, 0, 0, 3, 0, 0,
3, 224, 2, 0, 228, 144, 1, 128, 0, 0, 0, 128,
255, 255, 0, 0 14, 0, 255, 160, 10, 0,
0, 3, 0, 0, 4, 224,
0, 0, 0, 128, 4, 0,
170, 160, 1, 0, 0, 2,
0, 0, 3, 224, 2, 0,
228, 144, 255, 255, 0, 0
}; };

View File

@ -122,8 +122,6 @@ void
defaultRenderCB(Atomic *atomic, InstanceDataHeader *header) defaultRenderCB(Atomic *atomic, InstanceDataHeader *header)
{ {
Material *m; Material *m;
RGBAf col;
GLfloat surfProps[4];
setWorldMatrix(atomic->getFrame()->getLTM()); setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic); lightingCB(atomic);

View File

@ -1,13 +1,16 @@
namespace rw { namespace rw {
namespace gl3 { namespace gl3 {
void initMatFX(void);
ObjPipeline *makeMatFXPipeline(void);
void matfxRenderCB(Atomic *atomic, InstanceDataHeader *header); void matfxRenderCB(Atomic *atomic, InstanceDataHeader *header);
ObjPipeline *makeSkinPipeline(void);
ObjPipeline *makeMatFXPipeline(void);
void initMatFX(void);
void initSkin(void); void initSkin(void);
ObjPipeline *makeSkinPipeline(void);
void skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance);
void skinRenderCB(Atomic *atomic, InstanceDataHeader *header);
void uploadSkinMatrices(Atomic *atomic);
} }
} }

View File

@ -10,15 +10,15 @@ out float v_fog;
void void
main(void) main(void)
{ {
vec4 V = u_world * vec4(in_pos, 1.0); vec4 Vertex = u_world * vec4(in_pos, 1.0);
gl_Position = u_proj * u_view * V; gl_Position = u_proj * u_view * Vertex;
vec3 N = mat3(u_world) * in_normal; vec3 Normal = mat3(u_world) * in_normal;
v_tex0 = in_tex0; v_tex0 = in_tex0;
v_color = in_color; v_color = in_color;
v_color.rgb += u_ambLight.rgb*surfAmbient; v_color.rgb += u_ambLight.rgb*surfAmbient;
v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse; v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
v_color = clamp(v_color, 0.0, 1.0); v_color = clamp(v_color, 0.0, 1.0);
v_color *= u_matColor; v_color *= u_matColor;

View File

@ -11,15 +11,15 @@ const char *default_vert_src =
"void\n" "void\n"
"main(void)\n" "main(void)\n"
"{\n" "{\n"
" vec4 V = u_world * vec4(in_pos, 1.0);\n" " vec4 Vertex = u_world * vec4(in_pos, 1.0);\n"
" gl_Position = u_proj * u_view * V;\n" " gl_Position = u_proj * u_view * Vertex;\n"
" vec3 N = mat3(u_world) * in_normal;\n" " vec3 Normal = mat3(u_world) * in_normal;\n"
" v_tex0 = in_tex0;\n" " v_tex0 = in_tex0;\n"
" v_color = in_color;\n" " v_color = in_color;\n"
" v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n"
" v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse;\n" " v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
" v_color = clamp(v_color, 0.0, 1.0);\n" " v_color = clamp(v_color, 0.0, 1.0);\n"
" v_color *= u_matColor;\n" " v_color *= u_matColor;\n"

View File

@ -9,9 +9,9 @@ out float v_fog;
void void
main(void) main(void)
{ {
vec4 V = u_world * vec4(in_pos, 1.0); vec4 Vertex = u_world * vec4(in_pos, 1.0);
vec4 cV = u_view * V; vec4 CamVertex = u_view * Vertex;
gl_Position = u_proj * cV; gl_Position = u_proj * CamVertex;
v_color = in_color; v_color = in_color;
v_tex0 = in_tex0; v_tex0 = in_tex0;
v_fog = DoFog(gl_Position.w); v_fog = DoFog(gl_Position.w);

View File

@ -10,9 +10,9 @@ const char *im3d_vert_src =
"void\n" "void\n"
"main(void)\n" "main(void)\n"
"{\n" "{\n"
" vec4 V = u_world * vec4(in_pos, 1.0);\n" " vec4 Vertex = u_world * vec4(in_pos, 1.0);\n"
" vec4 cV = u_view * V;\n" " vec4 CamVertex = u_view * Vertex;\n"
" gl_Position = u_proj * cV;\n" " gl_Position = u_proj * CamVertex;\n"
" v_color = in_color;\n" " v_color = in_color;\n"
" v_tex0 = in_tex0;\n" " v_tex0 = in_tex0;\n"
" v_fog = DoFog(gl_Position.w);\n" " v_fog = DoFog(gl_Position.w);\n"

View File

@ -13,16 +13,16 @@ out float v_fog;
void void
main(void) main(void)
{ {
vec4 V = u_world * vec4(in_pos, 1.0); vec4 Vertex = u_world * vec4(in_pos, 1.0);
gl_Position = u_proj * u_view * V; gl_Position = u_proj * u_view * Vertex;
vec3 N = mat3(u_world) * in_normal; vec3 Normal = mat3(u_world) * in_normal;
v_tex0 = in_tex0; v_tex0 = in_tex0;
v_tex1 = (u_texMatrix * vec4(N, 1.0)).xy; v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;
v_color = in_color; v_color = in_color;
v_color.rgb += u_ambLight.rgb*surfAmbient; v_color.rgb += u_ambLight.rgb*surfAmbient;
v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse; v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
v_color = clamp(v_color, 0.0, 1.0); v_color = clamp(v_color, 0.0, 1.0);
v_color *= u_matColor; v_color *= u_matColor;

View File

@ -14,16 +14,16 @@ const char *matfx_env_vert_src =
"void\n" "void\n"
"main(void)\n" "main(void)\n"
"{\n" "{\n"
" vec4 V = u_world * vec4(in_pos, 1.0);\n" " vec4 Vertex = u_world * vec4(in_pos, 1.0);\n"
" gl_Position = u_proj * u_view * V;\n" " gl_Position = u_proj * u_view * Vertex;\n"
" vec3 N = mat3(u_world) * in_normal;\n" " vec3 Normal = mat3(u_world) * in_normal;\n"
" v_tex0 = in_tex0;\n" " v_tex0 = in_tex0;\n"
" v_tex1 = (u_texMatrix * vec4(N, 1.0)).xy;\n" " v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;\n"
" v_color = in_color;\n" " v_color = in_color;\n"
" v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n"
" v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse;\n" " v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
" v_color = clamp(v_color, 0.0, 1.0);\n" " v_color = clamp(v_color, 0.0, 1.0);\n"
" v_color *= u_matColor;\n" " v_color *= u_matColor;\n"

View File

@ -21,15 +21,15 @@ main(void)
SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i]; SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];
} }
vec4 V = u_world * vec4(SkinVertex, 1.0); vec4 Vertex = u_world * vec4(SkinVertex, 1.0);
gl_Position = u_proj * u_view * V; gl_Position = u_proj * u_view * Vertex;
vec3 N = mat3(u_world) * SkinNormal; vec3 Normal = mat3(u_world) * SkinNormal;
v_tex0 = in_tex0; v_tex0 = in_tex0;
v_color = in_color; v_color = in_color;
v_color.rgb += u_ambLight.rgb*surfAmbient; v_color.rgb += u_ambLight.rgb*surfAmbient;
v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse; v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
v_color = clamp(v_color, 0.0, 1.0); v_color = clamp(v_color, 0.0, 1.0);
v_color *= u_matColor; v_color *= u_matColor;

View File

@ -22,15 +22,15 @@ const char *skin_vert_src =
" SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];\n" " SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];\n"
" }\n" " }\n"
" vec4 V = u_world * vec4(SkinVertex, 1.0);\n" " vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n"
" gl_Position = u_proj * u_view * V;\n" " gl_Position = u_proj * u_view * Vertex;\n"
" vec3 N = mat3(u_world) * SkinNormal;\n" " vec3 Normal = mat3(u_world) * SkinNormal;\n"
" v_tex0 = in_tex0;\n" " v_tex0 = in_tex0;\n"
" v_color = in_color;\n" " v_color = in_color;\n"
" v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n"
" v_color.rgb += DoDynamicLight(V.xyz, N)*surfDiffuse;\n" " v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
" v_color = clamp(v_color, 0.0, 1.0);\n" " v_color = clamp(v_color, 0.0, 1.0);\n"
" v_color *= u_matColor;\n" " v_color *= u_matColor;\n"