I realised that adjusting the sampler states using:
sampler ShadowMapSampler = sampler_state
Texture = <ShadowMap>;
minfilter = point;
magfilter = point;
mipfilter = point;
Doesn't seem to do anything in MonoGame.
So I used (in the C# code):
var pointsampler = new SamplerState
AddressU = TextureAddressMode.Wrap,
AddressV = TextureAddressMode.Wrap,
AddressW = TextureAddressMode.Wrap,
Filter = TextureFilter.Point,
GraphicsDevice.SamplerStates = linearsampler;
And in the HLSL:
sampler ShadowMapSampler : register(s0);
My question is: How do I set the texture part like I used to?
I would have been able to just sample using:
distanceStoredInDepthMap = tex2D(ShadowMapSampler, lightSamplePos);
But I can't because there's no texture set in the sampler.