source: GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/Shark3D/demo_v5x0x7_t164x31u_enterpr_kwin32/src/res/levelutil/shader/prog/d3d9_hlsl/indirect_texturing_black_d3d9_hlsl_ps2x0.s3d_shadercode @ 2330

Revision 2330, 1.6 KB checked in by igarcia, 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 PS_INPUT
15{
16    float4 diffuse: COLOR0;
17    float2 texCoord0: TEXCOORD0;
18    float2 texCoord1: TEXCOORD1;
19};
20
21///////////////////////////////////////////////////////////////////////////////
22
23sampler tex0: register(s0);
24sampler tex1: register(s1);
25
26float sourceTextureSize;
27float epsilonX;
28float epsilonY;
29float sqrtNumSamples;
30
31///////////////////////////////////////////////////////////////////////////////
32// Pixelshader
33// Profile: 2x0
34
35float4 main(PS_INPUT input): COLOR0
36{
37   sourceTextureSize = 16.0;
38   sqrtNumSamples = 4.0;
39   epsilonX = -0.35;
40   epsilonY = -0.06;
41
42   float4 ocolor = float4(0.0, 1.0, 0.0, 0.0);
43   float2 epsilon = float2(epsilonX, epsilonY);
44   float4 value = tex2D(tex0, input.texCoord1).xyzw;
45   float2 coords = float2(0.0, 1.0) - abs(input.texCoord0 - ( value.xy - epsilon ) );
46
47   if (value.w != 0.0)
48   {   
49        float2 newcoord = (float2(1.0, 1.0) - value.zw) + ((coords * sourceTextureSize) / sqrtNumSamples);
50        ocolor = float4(tex2D(tex1, newcoord).xyzw);
51   }
52   return ocolor;
53   //return tex2D(tex1, input.texCoord0);
54}
55
56///////////////////////////////////////////////////////////////////////////////
Note: See TracBrowser for help on using the repository browser.