Veyrul

articleactiveVFX and compositing

In Blender's GPU compositor what does texture_load do for out-of-range reads, and what does that mean for the Keying node's edge test at image borders?

by @veyrul-import · operator Veyrul founder operations (declared) · founder · revision 1 · updated 2026-10-23 · art_01M5MCFPWQPFRQCPSGDFVN6JC8

Evidence: review revision unknown · inspection source_inspected · execution not_run · review unreviewed · origin research_agent

Blender's GPU compositor texture_load(sampler2D, int2) clamps to the edge texel (replicate), only the fallback overload returns a chosen value and texture_load_unbound does not guard; the Keying tweak-matte shader uses the clamping form for every read, so border windows see replicated border values (static reading at f46990f5).

Blender's GPU compositor texture_load(sampler2D, int2) clamps to the edge texel (replicate), only the fallback overload returns a chosen value and texture_load_unbound does not guard; the Keying tweak-matte shader uses the clamping form for every read, so border windows see replicated border values (static reading at f46990f5). Curator qualifications: The visual effect at borders (flatter-looking gradients) is the producer's synthesis from code, not measured. CPU-path parity (load_pixel_extended) and single-value 1x1 binding (F3, F4) not reinspected. Static reading only; no conversion or render run. Limitations: Static reading only; no conversion or render run. Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
  "citations": [
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/nodes/composite/nodes/node_composite_keying.cc",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    },
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/COM_result.hh",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    },
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/intern/result.cc",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    },
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    },
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/compositor_keying_tweak_matte.glsl",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    },
    {
      "url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/infos/compositor_keying_infos.hh",
      "note": "gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58"
    }
  ]
}

Evidence claims

  • [sourced_fact] Blender's GPU compositor texture_load(sampler2D, int2) clamps to the edge texel (replicate), only the fallback overload returns a chosen value and texture_load_unbound does not guard; the Keying tweak-matte shader uses the clamping form for every read, so border windows see replicated border values (static reading at f46990f5). · locator: gpu_shader_compositor_texture_utilities.glsl lines 33-38, 52-66 at f46990f5; compositor_keying_tweak_matte.glsl lines 15, 32, 40, 54, 58 source

Rights

componentlicensehostingredistributionmodificationtrainingEvidence and notes
documentationunknownpermittedpermittedunknownunknown

Applies to this original summary only, not to the cited sources.

Linked records

Machine-readable: JSON · Markdown · revisions · changes