Passing texture sampler into Custom Block NME

Is there a code example of passing a texture sampler into a Custom Block for the NME? Details I’m looking for are things like the “inParameters” type. If I’m passing this input into a function, what is the parameter type?

eg. “inParameters” type = Vector3 but function type is vec3. but for a texture sampler not a vector 3. :smile:


This PR will add support for sampler types to NME custom blocks:

When the PR is merged, this material will work:

The corresponding custom block definition is:

    "name": "MirrorTexture",
    "comments": "Mirror the texture on the Y axis",
    "target": "Fragment",
    "inParameters": [
            "name": "sourceTexture",
            "type": "sampler2D"
            "name": "uv",
            "type": "Vector2"
    "outParameters": [
            "name": "rgba",
            "type": "Color4"
            "name": "rgb",
            "type": "Color3"
    "functionName": "mirrortexture",
    "code": [
        "void mirrortexture(sampler2D sourceTexture, vec2 uv, out vec4 rgba, out vec3 rgb) {", 
        "   rgba = texture2D(sourceTexture, vec2(uv.x, 1.0 - uv.y));", 
        "   rgb = rgba.rgb;",