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_stddef_d3d9_hlsl.s3d_shadercode_run>
|
---|
16 |
|
---|
17 | ///////////////////////////////////////////////////////////////////////////////
|
---|
18 |
|
---|
19 | struct PS_INPUT
|
---|
20 | {
|
---|
21 | float2 mainTexCoord: TEXCOORD0;
|
---|
22 | float4 diffuse: COLOR0;
|
---|
23 | float fogCoord: TEXCOORD2;
|
---|
24 | };
|
---|
25 |
|
---|
26 | ///////////////////////////////////////////////////////////////////////////////
|
---|
27 |
|
---|
28 | const float4 paramFog;
|
---|
29 |
|
---|
30 | sampler tex0: register(s0);
|
---|
31 |
|
---|
32 | ///////////////////////////////////////////////////////////////////////////////
|
---|
33 | // Pixelshader
|
---|
34 | // Profile: 2x0
|
---|
35 |
|
---|
36 | float4 main(PS_INPUT input): COLOR0
|
---|
37 | {
|
---|
38 | float4 outCol = input.diffuse;
|
---|
39 | float4 texCol0 = tex2D(tex0, input.mainTexCoord);
|
---|
40 | outCol = outCol * texCol0;
|
---|
41 | // Preserve original opacity from texture.
|
---|
42 | outCol.a = texCol0.a;
|
---|
43 |
|
---|
44 | outCol.rgb = s3d_calcFogExp(
|
---|
45 | outCol.rgb, paramFog.rgb, paramFog.a, input.fogCoord);
|
---|
46 | return outCol;
|
---|
47 | }
|
---|
48 |
|
---|
49 | ///////////////////////////////////////////////////////////////////////////////
|
---|
Note: See
TracBrowser
for help on using the repository browser.