# Niagara Texture Sampling Interpolation

**URL:** <https://forums.unrealengine.com/t/niagara-texture-sampling-interpolation/130782>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [September 6, 2019, 4:17pm UTC](https://forums.unrealengine.com/t/niagara-texture-sampling-interpolation/130782 "2019-09-06T16:17:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amoffat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@amoffat](https://forums.unrealengine.com/u/amoffat)\
**Post date:** [September 6, 2019, 4:17pm UTC](https://forums.unrealengine.com/t/niagara-texture-sampling-interpolation/130782/1 "2019-09-06T16:17:25Z")

</div>

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:

```auto

    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:

```auto

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

```

And this for the SamplerState it is using:

```auto

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?

---

<div class="post-metadata">

**Author:** ![amoffat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@amoffat](https://forums.unrealengine.com/u/amoffat)\
**Post date:** [September 6, 2019, 10:20pm UTC](https://forums.unrealengine.com/t/niagara-texture-sampling-interpolation/130782/2 "2019-09-06T22:20:09Z")

</div>

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? 🙂
