I developped a small XNA games in 3D. I would like to add a "fog of war" on my models instantiated with an effect in my (.fx) file. The problem is, I do not know how to change the function "PixelShaderFunction".
File [.fx]
Here is the declaration of my variables in my effect file (.fx):
// InstancedModel.fx
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
// Camera settings.
float4x4 World;
float4x4 View;
float4x4 Projection;
//Fog settings
float FogNear;
float FogFar;
float4 FogColor;
And my function "PixelShaderFunction" in my effect file (.fx):
// Both techniques share this same pixel shader.
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
return tex2D(Sampler, input.TextureCoordinate) * input.Color;
}