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 | struct VS_INPUT
|
---|
15 | {
|
---|
16 | float4 posObj: POSITION;
|
---|
17 | float2 mainTexCoord: TEXCOORD0;
|
---|
18 | };
|
---|
19 |
|
---|
20 | struct VS_OUTPUT
|
---|
21 | {
|
---|
22 | float4 posScr: POSITION;
|
---|
23 | float fog: FOG;
|
---|
24 | float4 diffuse: COLOR0;
|
---|
25 | float2 mainTexCoord: TEXCOORD0;
|
---|
26 | float2 offsScale: TEXCOORD1;
|
---|
27 | };
|
---|
28 |
|
---|
29 | ///////////////////////////////////////////////////////////////////////////////
|
---|
30 |
|
---|
31 | const float4x4 matProjView;
|
---|
32 | const float4x4 matView;
|
---|
33 | const float4 mtrlEmissive;
|
---|
34 | const float4 tex0RcpSize;
|
---|
35 |
|
---|
36 | ///////////////////////////////////////////////////////////////////////////////
|
---|
37 | // Vertexshader
|
---|
38 | // Profile: 1x1
|
---|
39 |
|
---|
40 | VS_OUTPUT main( VS_INPUT input )
|
---|
41 | {
|
---|
42 | VS_OUTPUT output = (VS_OUTPUT)0;
|
---|
43 |
|
---|
44 | //Transform position to clip space
|
---|
45 | output.posScr = mul(input.posObj, matProjView);
|
---|
46 |
|
---|
47 | //Transform position to eye space -> pos
|
---|
48 | float4 posView = mul(input.posObj, matView);
|
---|
49 |
|
---|
50 | //fog
|
---|
51 | output.fog = posView.z / posView.w;
|
---|
52 |
|
---|
53 | //Color
|
---|
54 | output.diffuse = mtrlEmissive;
|
---|
55 |
|
---|
56 | output.mainTexCoord = input.mainTexCoord;
|
---|
57 |
|
---|
58 | output.offsScale = tex0RcpSize;
|
---|
59 |
|
---|
60 | return output;
|
---|
61 | }
|
---|
62 |
|
---|
63 | ///////////////////////////////////////////////////////////////////////////////
|
---|