Announcement

Collapse
No announcement yet.

Niagara Texture Sampling Interpolation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    Code:
        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) \n{\n");
            OutHLSL += TEXT("\t Out_Value = ") + HLSLTextureName + TEXT(".SampleLevel(") + HLSLSamplerName + TEXT(", In_UV, 0);\n");
            OutHLSL += TEXT("\n}\n");
            return true;
        }
    In my generated "Particle GPUCompute Script", I see this for the actual sample code:

    Code:
    Out_Value = Texture_MaskTex.SampleLevel(Sampler_MaskTex, In_UV, 0);
    And this for the SamplerState it is using:

    Code:
    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?

    #2
    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?

    Comment

    Working...
    X