Rev | Line | |
---|
[2196] | 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 | };
|
---|
| 27 |
|
---|
| 28 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 29 |
|
---|
| 30 | const float4x4 matProjView;
|
---|
| 31 | const float4x4 matView;
|
---|
| 32 | const float4 mtrlEmissive;
|
---|
| 33 |
|
---|
| 34 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 35 | // Vertexshader
|
---|
| 36 | // Profile: 1x1
|
---|
| 37 |
|
---|
| 38 | VS_OUTPUT main( VS_INPUT input )
|
---|
| 39 | {
|
---|
| 40 | VS_OUTPUT output = (VS_OUTPUT)0;
|
---|
| 41 |
|
---|
| 42 | //Transform position to clip space
|
---|
| 43 | output.posScr = mul(input.posObj, matProjView);
|
---|
| 44 |
|
---|
| 45 | //Transform position to eye space -> pos
|
---|
| 46 | float4 posView = mul(input.posObj, matView);
|
---|
| 47 |
|
---|
| 48 | //fog
|
---|
| 49 | output.fog = posView.z / posView.w;
|
---|
| 50 |
|
---|
| 51 | //Color
|
---|
| 52 | output.diffuse = mtrlEmissive;
|
---|
| 53 |
|
---|
| 54 | output.mainTexCoord = input.mainTexCoord;
|
---|
| 55 |
|
---|
| 56 | return output;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | ///////////////////////////////////////////////////////////////////////////////
|
---|
Note: See
TracBrowser
for help on using the repository browser.