Niagara Texture Sampling Interpolation

I’m looking to set a specific texture SamplerState filter for a texture I’m sampling. I’ve looked into the VM code and found:


    if (DefinitionFunctionName == SampleTexture2DName)
    {
        FString HLSLTextureName = TextureName + ParamInfo.DataInterfaceHLSLSymbol;
        FString HLSLSamplerName = SamplerName + ParamInfo.DataInterfaceHLSLSymbol;
        OutHLSL += TEXT("void ") + InstanceFunctionName + TEXT("(in float2 In_UV, out float4 Out_Value) 
{
");
        OutHLSL += TEXT("	 Out_Value = ") + HLSLTextureName + TEXT(".SampleLevel(") + HLSLSamplerName + TEXT(", In_UV, 0);
");
        OutHLSL += TEXT("
}
");
        return true;
    }

In my generated “Particle GPUCompute Script”, I see this for the actual sample code:


Out_Value = Texture_MaskTex.SampleLevel(Sampler_MaskTex, In_UV, 0);

And this for the SamplerState it is using:


SamplerState Sampler_MaskTex;

So it looks like it is using the defaults for the sampler, with no obvious way to customize it. Is there a hidden Niagara “inject your own custom code” feature that I don’t know about and can use?

I’m trying to figure out a way to do something clever with the HLSL expression fields. Like override a regular Niagara property with an expression that evaluates to a value and also sets up a SamplerState in parenthesis or something. As long as it compiles, right? :slight_smile: