[2453] | 1 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 2 | //
|
---|
| 3 | // ## ######
|
---|
| 4 | // ###### ###
|
---|
| 5 | // ## ############### Shark 3D Engine (www.shark3d.com)
|
---|
| 6 | // ########## # # #
|
---|
| 7 | // ######## Copyright (c) 1996-2006 Spinor GmbH.
|
---|
| 8 | // ######### # # # All rights reserved.
|
---|
| 9 | // ## ##########
|
---|
| 10 | // ##
|
---|
| 11 | //
|
---|
| 12 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 13 |
|
---|
| 14 | #include \
|
---|
| 15 | <levelutil/shader/prog/d3d9_hlsl/include_stddef_d3d9_hlsl.s3d_shadercode_run>
|
---|
| 16 |
|
---|
| 17 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 18 |
|
---|
| 19 | struct VS_INPUT
|
---|
| 20 | {
|
---|
| 21 | float4 posObj: POSITION;
|
---|
| 22 | S3D_BONE_DECL_STD(boneWgh, boneSubscr)
|
---|
| 23 | float2 tex0:TEXCOORD0;
|
---|
| 24 | float3 normal:NORMAL;
|
---|
| 25 | };
|
---|
| 26 |
|
---|
| 27 | struct VS_OUTPUT
|
---|
| 28 | {
|
---|
| 29 | float4 posScr : POSITION;
|
---|
| 30 | float3 dir: TEXCOORD0;
|
---|
| 31 | };
|
---|
| 32 |
|
---|
| 33 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 34 |
|
---|
| 35 | const float4x4 matProj;
|
---|
| 36 | const float4x4 matView;
|
---|
| 37 | S3D_MATBONE_DECL_STD(matBone)
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 41 | // Vertexshader
|
---|
| 42 | // Profile: 1x1
|
---|
| 43 | float4 last_Center;
|
---|
| 44 | float4x4 worldMat;
|
---|
| 45 |
|
---|
| 46 | VS_OUTPUT main(VS_INPUT input)
|
---|
| 47 | {
|
---|
| 48 | VS_OUTPUT output = (VS_OUTPUT)0;
|
---|
| 49 |
|
---|
| 50 | float4x4 matBoneFinal;
|
---|
| 51 | S3D_BONE_TRANSF_STD(matBoneFinal, matBone, input.boneWgh, input.boneSubscr);
|
---|
| 52 | // Transform vectors by matBoneFinal
|
---|
| 53 | float4 posView = mul(input.posObj, matBoneFinal);
|
---|
| 54 | output.posScr = mul(posView, matProj);
|
---|
| 55 |
|
---|
| 56 | float4 wPos = mul(posView, worldMat);
|
---|
| 57 | output.dir = wPos.xyz - last_Center.xyz ;
|
---|
| 58 |
|
---|
| 59 | return output;
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | ///////////////////////////////////////////////////////////////////////////////
|
---|