source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/src/res/levelutil/shader/prog/d3d9_hlsl/lightfilter_d3d9_hlsl_vs2x0.s3d_shadercode @ 2196

Revision 2196, 1.5 KB checked in by szirmay, 17 years ago (diff)
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
14struct VS_INPUT
15{
16    float4 posObj: POSITION;
17    float2 screen: TEXCOORD0;
18};
19
20struct VS_OUTPUT
21{
22    float4 posScr: POSITION;
23    float2 screen: TEXCOORD0;
24    float2 scale: TEXCOORD1;
25};
26
27///////////////////////////////////////////////////////////////////////////////
28
29const float4x4 matProjView;
30const float4 tex0RcpSize;
31const float4 passInfo;
32
33///////////////////////////////////////////////////////////////////////////////
34// Vertexshader
35// Profile: 2x0
36
37VS_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.