How can I use SamplerState in my HLSL code? When I try to set my custom SamplerStater in .SampleLevel parameters I get error [SM5] /Plugin/WeatherShader/FluidSimulation.usf(3,8-39): error X3538: Sampler parameter must come from a literal expression.
SamplerState MySamplerState
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = Clamp;
AddressV = Clamp;
AddressW = Clamp;
};
return tex.SampleLevel(MySamplerState, UV, 0);
Here tex is the texture that is input to my custom node, UV is the texture coordinates