Sampler parameter must come from a literal expression

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

1 Like

Hello,
Did you figure something out for this problem, I am facing the same issue

Unfortunately, I could not find a solution. Maybe because I tried to sample 3D textures and UE does not support 3D textures. I tried to implement a simple liquid simulator, but it turned out that it can be done without custom node