home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
InfDX
/
Shaders
/
window-deferred-transparent-pixel.hlsl
< prev
next >
Wrap
Text File
|
2005-10-06
|
982b
|
37 lines
struct VS_OUTPUT
{
half4 Diffuse : COLOR0;
float2 UvMap : TEXCOORD0;
float2 UvMap2 : TEXCOORD1;
float2 Fog: TEXCOORD2; // (Rimo) Fog, ideiglenes
};
float2 TDX_CONST_RFOGPLANE; // (Rimo) Fog, ideiglenes
float4 TDX_CONST_RFOGCOLOR; // (Rimo) Fog, ideiglenes
sampler s_2d : register(s0);
sampler s_refl : register(s1);
half4 main(VS_OUTPUT In) : COLOR
{
half4 Color;
half4 Diffuse=tex2D(s_2d, In.UvMap);
half4 Reflection=tex2D(s_refl, In.UvMap2);
Color.rgb=(saturate(((1-Diffuse.a)*Reflection.rgb)*2)+(Diffuse.rgb*Diffuse.a))*In.Diffuse;
#if TDX_SHADERFLAG_LIGHTING
Color.rgb*=2;
#endif
Color.a=Diffuse.a+0.5;
if(TDX_CONST_RFOGPLANE.x < TDX_CONST_RFOGPLANE.y) // (Rimo) Fog, ideiglenes
{
float nFactor = TDX_CONST_RFOGCOLOR.a * saturate((In.Fog.x - TDX_CONST_RFOGPLANE.x) / (TDX_CONST_RFOGPLANE.y - TDX_CONST_RFOGPLANE.x));
Color = lerp(Color, half4(TDX_CONST_RFOGCOLOR.rgb, 1), nFactor);
}
return Color;
}