#ifdef MAP_SHADERS
//---
struct VS_OUTPUT_MAP
{
float4 Pos : POSITION;
float4 Color : COLOR0;
float2 Tex0 : TEXCOORD0;
float4 SunLight : TEXCOORD1;
float4 ShadowTexCoord : TEXCOORD2;
float2 ShadowTexelPos : TEXCOORD3;
float Fog : FOG;
float3 ViewDir : TEXCOORD6;
float3 WorldNormal : TEXCOORD7;
};
VS_OUTPUT_MAP vs_main_map(uniform const int PcfMode, float4 vPosition : POSITION, float3 vNormal : NORMAL,
float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
INITIALIZE_OUTPUT(VS_OUTPUT_MAP, Out);
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPosition);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
Out.Tex0 = tc;
float4 diffuse_light = vAmbientColor;
if (true /*_UseSecondLight*/)
{
diffuse_light += vLightColor;
}
//directional lights, compute diffuse color
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
//apply material color
// Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
Out.Color = (vMaterialColor * vColor * diffuse_light);
//shadow mapping variables
float wNdotSun = saturate(dot(vWorldN, -vSunDir));
Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor;
if (PcfMode != PCF_NONE)
{
float4 ShadowPos = mul(matSunViewProj, vWorldPos);
Out.ShadowTexCoord = ShadowPos;
Out.ShadowTexCoord.z /= ShadowPos.w;
Out.ShadowTexCoord.w = 1.0f;
Out.ShadowTexelPos = Out.ShadowTexCoord * fShadowMapSize;
//shadow mapping variables end
}
Out.ViewDir = normalize(vCameraPos-vWorldPos);
Out.WorldNormal = vWorldN;
//apply fog
float3 P = mul(matWorldView, vPosition); //position in view space
float d = length(P);
Out.Fog = get_fog_amount_map(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_main_map(VS_OUTPUT_MAP In, uniform const int PcfMode)
{
PS_OUTPUT Output;
float4 tex_col = tex2D(MeshTextureSampler, In.Tex0);
INPUT_TEX_GAMMA(tex_col.rgb);
float sun_amount = 1;
if ((PcfMode != PCF_NONE))
{
sun_amount = GetSunAmount(PcfMode, In.ShadowTexCoord, In.ShadowTexelPos);
}
Output.RGBColor = tex_col * ((In.Color + In.SunLight * sun_amount));
//add fresnel term
{
float fresnel = 1-(saturate(dot( normalize(In.ViewDir), normalize(In.WorldNormal))));
fresnel *= fresnel;
Output.RGBColor.rgb *= max(0.6,fresnel+0.1);
}
// gamma correct
OUTPUT_GAMMA(Output.RGBColor.rgb);
return Output;
}
DEFINE_TECHNIQUES(diffuse_map, vs_main_map, ps_main_map) //diffuse shader with fresnel effect
//---
struct VS_OUTPUT_MAP_BUMP
{
float4 Pos : POSITION;
float4 Color : COLOR0;
float3 Tex0 : TEXCOORD0;
//float4 SunLight : TEXCOORD1;
float4 ShadowTexCoord : TEXCOORD2;
float2 ShadowTexelPos : TEXCOORD3;
float Fog : FOG;
float3 SunLightDir : TEXCOORD4;
float3 SkyLightDir : TEXCOORD5;
float3 ViewDir : TEXCOORD6;
float3 WorldNormal : TEXCOORD7;
};
VS_OUTPUT_MAP_BUMP vs_main_map_bump(uniform const int PcfMode, float4 vPosition : POSITION,
float3 vNormal : NORMAL, float3 vTangent : TANGENT, float3 vBinormal : BINORMAL,
float2 tc : TEXCOORD0, float4 vColor : COLOR0,float4 vLightColor : COLOR1)
{
INITIALIZE_OUTPUT(VS_OUTPUT_MAP_BUMP, Out);
//dstn Flat Map Experiment
float4 vPositionOrig = vPosition;
vPosition.z = map_flatten(vCameraPos.z, vPosition.z);
Out.Tex0.z = map_smoothstep(vCameraPos.z);
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPositionOrig);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
float3 vWorld_binormal = normalize(mul((float3x3)matWorld, vBinormal)); //normal in world space
float3 vWorld_tangent = normalize(mul((float3x3)matWorld, vTangent)); //normal in world space
float3x3 TBNMatrix = float3x3(vWorld_tangent, vWorld_binormal, vWorldN);
Out.Tex0.xy = tc;
float4 diffuse_light = vAmbientColor;
if (true /*_UseSecondLight*/)
{
diffuse_light += vLightColor;
}
//directional lights, compute diffuse color
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
//point lights
#ifndef USE_LIGHTING_PASS
diffuse_light += calculate_point_lights_diffuse(vWorldPos, vWorldN, false, false);
#endif
//apply material color
// Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
Out.Color = (vMaterialColor * vColor * diffuse_light);
Out.Color.a = vColor.a;
//shadow mapping variables
//move sun light to pixel shader
//float wNdotSun = saturate(dot(vWorldN, -vSunDir));
//Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor;
Out.SunLightDir = normalize(mul(TBNMatrix, -vSunDir));
if (PcfMode != PCF_NONE)
{
float4 ShadowPos = mul(matSunViewProj, vWorldPos);
Out.ShadowTexCoord = ShadowPos;
Out.ShadowTexCoord.z /= ShadowPos.w;
Out.ShadowTexCoord.w = 1.0f;
Out.ShadowTexelPos = Out.ShadowTexCoord * fShadowMapSize;
//shadow mapping variables end
}
Out.ViewDir = normalize(vCameraPos-vWorldPos);
Out.WorldNormal = vWorldN;
float height = 1 / (Out.Pos.z / 10);
//apply fog
float3 P = mul(matWorldView, vPosition); //position in view space
float d = length(P);
Out.Fog = get_fog_amount_map(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_main_map_bump(VS_OUTPUT_MAP_BUMP In, uniform const int PcfMode)
{
PS_OUTPUT Output;
float4 tex_col = tex2D(MeshTextureSampler, In.Tex0.xy);
float4 blend_col = tex2D(Diffuse2Sampler, In.Tex0.xy);
tex_col = lerp(tex_col, blend_col, In.Tex0.z);
INPUT_TEX_GAMMA(tex_col.rgb);
float3 normal = lerp((2.0f * tex2D(NormalTextureSampler, In.Tex0.xy * map_normal_detail_factor).rgb - 1.0f), 1.0f, In.Tex0.z);
/*if (In.Tex0.z == 1)
{
normal = 1.0;
}*/
//float wNdotSun = saturate(dot(vWorldN, -vSunDir));
//Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor;
float4 In_SunLight = saturate(dot(normal, In.SunLightDir)) * vSunColor * vMaterialColor;// * vColor; vertex color needed??
float sun_amount = 1;
if ((PcfMode != PCF_NONE))
{
sun_amount = GetSunAmount(PcfMode, In.ShadowTexCoord, In.ShadowTexelPos);
}
Output.RGBColor = lerp(tex_col * ((In.Color + In_SunLight * sun_amount)), tex_col, In.Tex0.z);
//add fresnel term
{
float fresnel = 1-(saturate(dot( normalize(In.ViewDir), normalize(In.WorldNormal))));
fresnel *= fresnel;
Output.RGBColor.rgb *= max(0.6,fresnel+0.1);
}
// gamma correct
OUTPUT_GAMMA(Output.RGBColor.rgb);
return Output;
}
DEFINE_TECHNIQUES(diffuse_map_bump, vs_main_map_bump, ps_main_map_bump) //diffuse shader with fresnel effect + bumpmapping(if shader_quality medium)..
//---
struct VS_OUTPUT_MAP_MOUNTAIN
{
float4 Pos : POSITION;
float Fog : FOG;
float4 Color : COLOR0;
float4 Tex0 : TEXCOORD0;
float4 SunLight : TEXCOORD1;
float4 ShadowTexCoord : TEXCOORD2;
float2 ShadowTexelPos : TEXCOORD3;
float3 ViewDir : TEXCOORD6;
float3 WorldNormal : TEXCOORD7;
};
VS_OUTPUT_MAP_MOUNTAIN vs_map_mountain(uniform const int PcfMode, float4 vPosition : POSITION, float3 vNormal : NORMAL,
float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
INITIALIZE_OUTPUT(VS_OUTPUT_MAP_MOUNTAIN, Out);
//dstn Flat Map Experiment
float4 vPositionOrig = vPosition;
vPosition.z = map_flatten(vCameraPos.z, vPosition.z);
Out.Tex0.w = map_smoothstep(vCameraPos.z);
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPositionOrig);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
float3 P = mul(matWorldView, vPosition); //position in view space
Out.Tex0.xy = tc;
Out.Tex0.z = /*saturate*/(0.7f * (vWorldPos.z - 1.5f));
float4 diffuse_light = vAmbientColor;
if (true /*_UseSecondLight*/)
{
diffuse_light += vLightColor;
}
//directional lights, compute diffuse color
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
//apply material color
// Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
Out.Color = (vMaterialColor * vColor * diffuse_light);
//shadow mapping variables
float wNdotSun = saturate(dot(vWorldN, -vSunDir));
Out.SunLight = (wNdotSun) * vSunColor;
if (PcfMode != PCF_NONE)
{
float4 ShadowPos = mul(matSunViewProj, vWorldPos);
Out.ShadowTexCoord = ShadowPos;
Out.ShadowTexCoord.z /= ShadowPos.w;
Out.ShadowTexCoord.w = 1.0f;
Out.ShadowTexelPos = Out.ShadowTexCoord * fShadowMapSize;
//shadow mapping variables end
}
Out.ViewDir = normalize(vCameraPos-vWorldPos);
Out.WorldNormal = vWorldN;
//apply fog
float d = length(P);
Out.Fog = get_fog_amount_map(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_map_mountain(VS_OUTPUT_MAP_MOUNTAIN In, uniform const int PcfMode)
{
PS_OUTPUT Output;
float4 tex_col = tex2D(MeshTextureSampler, In.Tex0.xy);
float4 blend_col = tex2D(Diffuse2Sampler, In.Tex0.xy);
INPUT_TEX_GAMMA(tex_col.rgb);
tex_col.rgb += saturate(In.Tex0.z * (tex_col.a) - 1.5f);
tex_col.a = 1.0f;
tex_col = lerp(tex_col, blend_col, In.Tex0.w);
if ((PcfMode != PCF_NONE))
{
float sun_amount = GetSunAmount(PcfMode, In.ShadowTexCoord, In.ShadowTexelPos);
// sun_amount *= sun_amount;
Output.RGBColor = saturate(tex_col) * ((In.Color + In.SunLight * sun_amount));
}
else
{
Output.RGBColor = saturate(tex_col) * (In.Color + In.SunLight);
}
{
float fresnel = 1-(saturate(dot( In.ViewDir, In.WorldNormal)));
// fresnel *= fresnel;
Output.RGBColor.rgb *= max(0.6,fresnel+0.1);
}
// gamma correct
OUTPUT_GAMMA(Output.RGBColor.rgb);
return Output;
}
DEFINE_TECHNIQUES(map_mountain, vs_map_mountain, ps_map_mountain)
//---
struct VS_OUTPUT_MAP_MOUNTAIN_BUMP
{
float4 Pos : POSITION;
float4 Color : COLOR0;
float4 Tex0 : TEXCOORD0;
//float4 SunLight : TEXCOORD1;
float4 ShadowTexCoord : TEXCOORD2;
float2 ShadowTexelPos : TEXCOORD3;
float Fog : FOG;
float3 SunLightDir : TEXCOORD4;
float3 SkyLightDir : TEXCOORD5;
float3 ViewDir : TEXCOORD6;
float3 WorldNormal : TEXCOORD7;
};
VS_OUTPUT_MAP_MOUNTAIN_BUMP vs_map_mountain_bump(uniform const int PcfMode, float4 vPosition : POSITION,
float3 vNormal : NORMAL, float3 vTangent : TANGENT, float3 vBinormal : BINORMAL,
float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
INITIALIZE_OUTPUT(VS_OUTPUT_MAP_MOUNTAIN_BUMP, Out);
//dstn Flat Map Experiment
float4 vPositionOrig = vPosition;
vPosition.z = map_flatten(vCameraPos.z, vPosition.z);
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPositionOrig);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
float3 vWorld_binormal = normalize(mul((float3x3)matWorld, vBinormal)); //normal in world space
float3 vWorld_tangent = normalize(mul((float3x3)matWorld, vTangent)); //normal in world space
float3x3 TBNMatrix = float3x3(vWorld_tangent, vWorld_binormal, vWorldN);
float3 P = mul(matWorldView, vPosition); //position in view space
Out.Tex0.xy = tc;
Out.Tex0.z = /*saturate*/(0.7f * (vWorldPos.z - 1.5f));
Out.Tex0.w = map_smoothstep(vCameraPos.z);
float4 diffuse_light = vAmbientColor;
if (true /*_UseSecondLight*/)
{
diffuse_light += vLightColor;
}
//directional lights, compute diffuse color
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
//apply material color
// Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
Out.Color = (vMaterialColor * vColor * diffuse_light);
//shadow mapping variables
//float wNdotSun = saturate(dot(vWorldN, -vSunDir));
//Out.SunLight = (wNdotSun) * vSunColor;
Out.SunLightDir = normalize(mul(TBNMatrix, -vSunDir));
if (PcfMode != PCF_NONE)
{
float4 ShadowPos = mul(matSunViewProj, vWorldPos);
Out.ShadowTexCoord = ShadowPos;
Out.ShadowTexCoord.z /= ShadowPos.w;
Out.ShadowTexCoord.w = 1.0f;
Out.ShadowTexelPos = Out.ShadowTexCoord * fShadowMapSize;
//shadow mapping variables end
}
Out.ViewDir = normalize(vCameraPos-vWorldPos);
Out.WorldNormal = vWorldN;
//apply fog
float d = length(P);
Out.Fog = get_fog_amount_map(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_map_mountain_bump(VS_OUTPUT_MAP_MOUNTAIN_BUMP In, uniform const int PcfMode)
{
PS_OUTPUT Output;
float4 sample_col = tex2D(MeshTextureSampler, In.Tex0.xy);
float4 tex_col = sample_col;
tex_col.rgb += saturate(In.Tex0.z * (sample_col.a) - 1.5f);
tex_col.a = 1.0f;
/*
float snow = In.Tex0.z * (0.1f + sample_col.a) - 1.5f;
if (snow > 0.5f)
{
tex_col = float4(1.0f,1.0f,1.0f,1.0f);
}
*/
float4 blend_col = tex2D(Diffuse2Sampler, In.Tex0.xy);
tex_col = lerp(tex_col, blend_col, In.Tex0.w);
INPUT_TEX_GAMMA(tex_col.rgb);
float3 normal = lerp((2.0f * tex2D(NormalTextureSampler, In.Tex0 * map_normal_detail_factor).rgb - 1.0f), 1.0f, In.Tex0.w);
//float wNdotSun = saturate(dot(vWorldN, -vSunDir));
//Out.SunLight = (wNdotSun) * vSunColor;
float4 In_SunLight = saturate(dot(normal, In.SunLightDir)) * vSunColor;
if ((PcfMode != PCF_NONE))
{
float sun_amount = GetSunAmount(PcfMode, In.ShadowTexCoord, In.ShadowTexelPos);
// sun_amount *= sun_amount;
Output.RGBColor = lerp(saturate(tex_col) * ((In.Color + In_SunLight * sun_amount)), tex_col, In.Tex0.w);
}
else
{
Output.RGBColor = lerp(saturate(tex_col) * (In.Color + In_SunLight), tex_col, In.Tex0.w);;
}
{
float fresnel = 1-(saturate(dot( In.ViewDir, In.WorldNormal)));
// fresnel *= fresnel;
Output.RGBColor.rgb *= max(0.6,fresnel+0.1);
}
// gamma correct
OUTPUT_GAMMA(Output.RGBColor.rgb);
return Output;
}
DEFINE_TECHNIQUES(map_mountain_bump, vs_map_mountain_bump, ps_map_mountain_bump)
//---
struct VS_OUTPUT_MAP_WATER
{
float4 Pos : POSITION;
float4 Color : COLOR0;
float3 Tex0 : TEXCOORD0;
float3 LightDir : TEXCOORD1;//light direction for bump
float3 CameraDir : TEXCOORD3;//camera direction for bump
float4 PosWater : TEXCOORD4;//position according to the water camera
float Fog : FOG;
};
VS_OUTPUT_MAP_WATER vs_map_water (uniform const bool reflections, float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1, float3 vTangent : TANGENT, float3 vBinormal : BINORMAL)
{
INITIALIZE_OUTPUT(VS_OUTPUT_MAP_WATER, Out);
// dstn Flat Map Experiment
/*float4 vPositionOrig = vPosition;
float distance = smoothstep(30, 50, length(mul(matWorldView, vPosition)));
vPosition.z *= distance * min(vPosition.z, 250) * 0.01f * ((1 - sin(75 * tc.x + time_var)) - (sin(35 * tc.y + 0.5f * time_var)));*/
float4 vPositionOrig = vPosition;
vPosition.z = map_flatten(vCameraPos.z, vPosition.z);
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPositionOrig);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
float3 vWorld_binormal = normalize(mul((float3x3)matWorld, vBinormal)); //normal in world space
float3 vWorld_tangent = normalize(mul((float3x3)matWorld, vTangent)); //normal in world space
float3x3 TBNMatrix = float3x3(vWorld_tangent, vWorld_binormal, vWorldN);
float3 P = mul(matWorldView, vPosition); //position in view space
Out.Tex0.z = map_smoothstep(vCameraPos.z);
Out.Tex0.xy = tc + texture_offset.xy;
float4 diffuse_light = vAmbientColor + vLightColor;
//directional lights, compute diffuse color
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
float wNdotSun = max(-0.0001f, dot(vWorldN, -vSunDir));
diffuse_light += (wNdotSun) * vSunColor;
//apply material color
// Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
Out.Color = (vMaterialColor * vColor) * diffuse_light;
//Out.Color.rgb += Out.Pos.y;
if(reflections)
{
float4 water_pos = mul(matWaterViewProj, vWorldPos);
Out.PosWater.xy = (float2(water_pos.x, -water_pos.y)+water_pos.w)/2;
Out.PosWater.xy += (vDepthRT_HalfPixel_ViewportSizeInv.xy * water_pos.w);
Out.PosWater.zw = water_pos.zw;
}
{
//float3 vWorldN = float3(0,0,1); //vNormal;
//normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
//float3 vWorld_tangent = float3(1,0,0);
//float3 vWorld_tangent = normalize(mul((float3x3)matWorld, vTangent)); //normal in world space
//float3 vWorld_binormal = float3(0,1,0);
// float3 vWorld_binormal = normalize(cross(vWorld_tangent, vNormal)); //normalize(mul((float3x3)matWorld, vBinormal)); //normal in world space
float3x3 TBNMatrix = float3x3(vWorld_tangent, vWorld_binormal, vWorldN);
float3 point_to_camera_normal = normalize(vCameraPos.xyz - vWorldPos.xyz);
Out.CameraDir = mul(TBNMatrix, -point_to_camera_normal);
Out.LightDir = mul(TBNMatrix, -vSunDir);
}
/*
float terminator = smoothstep(30, 50, Out.Pos.z);
//Vertical Wave Displacements: If more than 25 units away from camera and camera isn't aiming down
if(Out.Pos.z > 25 && vCameraPos.z < 30)
Out.Pos.y += terminator * min(Out.Pos.z, 250) * 0.01f * ((1 - sin(75 * vWorldPos.x + time_var)) - (sin(35 * vWorldPos.y + 0.5f * time_var)));
else
Out.Pos.y += 0.01f * ((1 - sin(75 * vWorldPos.x + time_var)) - (sin(35 * vWorldPos.y + 0.5f * time_var)));
*/
float height = 1 / (Out.Pos.z / 10);
//apply fog
float d = length(P);
Out.Fog = get_fog_amount_map(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_map_water(uniform const bool reflections, VS_OUTPUT_MAP_WATER In)
{
PS_OUTPUT Output;
Output.RGBColor = In.Color;
float4 tex_col = tex2D(MeshTextureSampler, In.Tex0.xy);
float4 blend_col = tex2D(Diffuse2Sampler, In.Tex0.xy);
tex_col.rgb = lerp(tex_col, blend_col * /*float3(0.25,0.35,0.5)*/ 0.85, In.Tex0.z);
INPUT_TEX_GAMMA(tex_col.rgb);
/////////////////////
float3 normal;
normal.xy = (2.0f * tex2D(NormalTextureSampler, In.Tex0 * 8).ag - 1.0f);
normal.z = sqrt(1.0f - dot(normal.xy, normal.xy));
float NdotL = saturate( dot(normal, In.LightDir) );
float3 vView = normalize(In.CameraDir);
// Fresnel term
float fresnel = 1-(saturate(dot(vView, normal)));
fresnel = 0.0204f + 0.9796 * (fresnel * fresnel * fresnel * fresnel * fresnel);
Output.RGBColor.rgb += fresnel * In.Color.rgb;
/////////////////////
if(reflections)
{
//float4 tex = tex2D(ReflectionTextureSampler, g_HalfPixel_ViewportSizeInv.xy + 0.25f * normal.xy + float2(0.5f + 0.5f * (In.PosWater.x / In.PosWater.w), 0.5f - 0.5f * (In.PosWater.y / In.PosWater.w)));
In.PosWater.xy += 0.35f * normal.xy;
float4 tex = tex2Dproj(ReflectionTextureSampler, In.PosWater);
INPUT_OUTPUT_GAMMA(tex.rgb);
tex.rgb = min(tex.rgb, 4.0f);
Output.RGBColor.rgb *= NdotL * lerp(tex_col.rgb, tex.rgb, reflection_factor);
}
else
{
Output.RGBColor.rgb *= tex_col.rgb;
}
if (In.CameraDir.z > 0.5)
{
Output.RGBColor.rgb = tex2Dproj(ReflectionTextureSampler, In.PosWater);
}
//Output.RGBColor.rgb = lerp(Output.RGBColor.rgb, blend_col.rgb * float3(0.5,0.5,1), In.Tex0.z);
OUTPUT_GAMMA(Output.RGBColor.rgb); //0.5 * normal + 0.5; //
//Output.RGBColor.rgb = In.Color.rgb;
Output.RGBColor.a = In.Color.a * tex_col.a;
return Output;
}
technique map_water
{
pass P0
{
VertexShader = compile vs_2_0 vs_map_water(false);
PixelShader = compile ps_2_a ps_map_water(false);
}
}
technique map_water_high
{
pass P0
{
VertexShader = compile vs_2_0 vs_map_water(true);
PixelShader = compile ps_2_a ps_map_water(true);
}
}
#endif