home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
InfDX
/
Shaders
/
rdecal-deferred-transparent-pixel.hlsl
< prev
next >
Wrap
Text File
|
2005-10-06
|
1KB
|
46 lines
//***************************************************************************
// Author: Laszlo Rimoczi (Rimo)
// Purpose: RDecal.mat
//
// Copyright (C) 2005 by Digital Reality Inc.
// All rights reserved.
//
// This source may not be distributed and/or modified without
// expressly written permission by Digital Reality Inc.
//***************************************************************************
struct VS_OUTPUT
{
float4 cDiffuse: COLOR0;
float2 cUV1: TEXCOORD0;
float2 cUV2: TEXCOORD1;
float2 cFog: TEXCOORD2; // (Rimo) Fog, ideiglenes
};
float2 TDX_CONST_RFOGPLANE; // (Rimo) Fog, ideiglenes
float4 TDX_CONST_RFOGCOLOR; // (Rimo) Fog, ideiglenes
sampler pDiffuse: register(s0);
float4 main(VS_OUTPUT i_sIn) : COLOR
{
float4 cColor = tex2D(pDiffuse, i_sIn.cUV1);
cColor.a = tex2D(pDiffuse, i_sIn.cUV2).a;
#if TDX_SHADERFLAG_LIGHTING
cColor.rgb *= i_sIn.cDiffuse;
#else
cColor.rgb *= i_sIn.cDiffuse;
#endif
cColor.a *= i_sIn.cDiffuse.a;
if(TDX_CONST_RFOGPLANE.x < TDX_CONST_RFOGPLANE.y) // (Rimo) Fog, ideiglenes
{
float nFactor = 1.0f - TDX_CONST_RFOGCOLOR.a * saturate((i_sIn.cFog.x - TDX_CONST_RFOGPLANE.x) / (TDX_CONST_RFOGPLANE.y - TDX_CONST_RFOGPLANE.x));
cColor.a *= nFactor;
}
return cColor;
}