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

Revision 2196, 1.7 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
14#include \
15    <levelutil/shader/prog/d3d9_hlsl/include_shmap_filter_d3d9_hlsl.s3d_shadercode_run>
16
17///////////////////////////////////////////////////////////////////////////////
18
19struct PS_INPUT
20{
21    float4 lightProjCoord: TEXCOORD0;
22    float4 lightShmapCoord: TEXCOORD1;
23};
24
25///////////////////////////////////////////////////////////////////////////////
26
27const float4 lightIntens;
28
29const float4 lightShmapSize;
30const float4 lightShmapRcpSize;
31
32sampler lightProjSamp: register(s0);
33sampler lightShmapSamp: register(s1);
34
35///////////////////////////////////////////////////////////////////////////////
36// Pixelshader
37// Profile: 2x0
38
39float4 main(PS_INPUT input): COLOR0
40{
41    float3 clipVal = input.lightShmapCoord.www
42            - abs(2 * input.lightShmapCoord.xyz - input.lightShmapCoord.www);
43    clip(clipVal.xyz);
44   
45    float4 outCol = lightIntens;
46
47    float4 texColProjTex = tex2Dproj(lightProjSamp, input.lightProjCoord);
48
49    float bright = s3d_shmapFilter(lightShmapSamp, input.lightShmapCoord,
50            lightShmapSize, lightShmapRcpSize);
51
52    outCol *= texColProjTex * bright;
53
54    return outCol;
55}
56
57///////////////////////////////////////////////////////////////////////////////
Note: See TracBrowser for help on using the repository browser.