Line | |
---|
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 screen: TEXCOORD0;
|
---|
18 | };
|
---|
19 |
|
---|
20 | struct VS_OUTPUT
|
---|
21 | {
|
---|
22 | float4 posScr: POSITION;
|
---|
23 | float2 screen: TEXCOORD0;
|
---|
24 | float2 scale: TEXCOORD1;
|
---|
25 | };
|
---|
26 |
|
---|
27 | ///////////////////////////////////////////////////////////////////////////////
|
---|
28 |
|
---|
29 | const float4x4 matProjView;
|
---|
30 | const float4 tex0RcpSize;
|
---|
31 | const float4 passInfo;
|
---|
32 |
|
---|
33 | ///////////////////////////////////////////////////////////////////////////////
|
---|
34 | // Vertexshader
|
---|
35 | // Profile: 2x0
|
---|
36 |
|
---|
37 | VS_OUTPUT main(VS_INPUT input)
|
---|
38 | {
|
---|
39 | VS_OUTPUT output = (VS_OUTPUT)0;
|
---|
40 | output.posScr = mul(input.posObj, matProjView);
|
---|
41 |
|
---|
42 | // Smoothing parameters:
|
---|
43 | // Go from wide to small to avoid artifacts in case of depth jumps.
|
---|
44 | // Use pow(2,iter) instead of pow(3,iter),
|
---|
45 | // because this gives a better quality:
|
---|
46 | float iter = passInfo.x;
|
---|
47 | float smooth = exp2(iter);
|
---|
48 |
|
---|
49 | output.screen.xy = input.screen;
|
---|
50 | output.scale.xy = tex0RcpSize * smooth;
|
---|
51 |
|
---|
52 | return output;
|
---|
53 | }
|
---|
54 |
|
---|
55 | ///////////////////////////////////////////////////////////////////////////////
|
---|
Note: See
TracBrowser
for help on using the repository browser.