NiVO / BY TECHNOGISGermany · Indonesia
Material channel tutorial

glTF Metallic-Roughness Channels: Trace Green and Blue Inputs in a Drone Model Review

Inspect green-channel roughness and blue-channel metalness with their factors on constructed linear samples, keeping material inputs separate from rendered appearance.

glTF Metallic-Roughness Channels: Trace Green and Blue Inputs in a Drone Model Review

Inspect the material input before judging a shiny surface

A model delivered with drone imagery may look unusually shiny or rough in a viewer. Before changing an image, identify which material property the viewer is actually using. A packed texture can carry different meanings in different channels, so its ordinary color preview is a poor substitute for tracing the material connection. This tutorial calculates two metallic-roughness inputs from invented linear samples. It does not open a customer model, diagnose a NiVO export or establish what a real surface is made of. The goal is a precise material observation that another reviewer can reproduce.

Keep the original model package and record the material, texture reference and viewer used for the observation. A screenshot alone cannot identify the sampled channel or the factor applied to it. The arithmetic below begins after the intended texture sample has already been obtained. Selecting the texture, resolving coordinates and sampling an image remain separate prerequisites. If any of those relationships is uncertain, preserve that uncertainty in the review note rather than choosing a plausible pixel and treating a matching number as evidence that the material has been correctly interpreted.

Follow the green and blue paths independently

The Khronos glTF specification assigns roughness to the green channel and metalness to the blue channel of metallicRoughnessTexture. These sampled values use a linear transfer function. The corresponding factors are linear multipliers, each bounded from zero to one and defaulting to one. Red and alpha, when present, are ignored for these two calculations. If the texture is absent, its green and blue inputs are treated as one. These rules define the two input paths; they do not define a final screen color or prove a physical material classification.

For the constructed sample, green is one quarter and blue is three quarters. Setting both factors to one half gives roughness one eighth and metalness three eighths. Using the same factor makes the channel difference easy to see without hiding it behind different multiplier choices. The two outputs must retain separate names. Averaging the channels or swapping them would answer a different question. Likewise, the treatment of a packed texture here should not be copied to a base-color image without checking that image role and its own transfer-function requirements.

Restored NiVO VTOL V3 product image from the supplied brochure
Restored NiVO VTOL V3 product image from the supplied brochure.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Calculate a small scalar report from known linear samples

Run this Python function on a supplied RGB or RGBA sequence of normalized, already linear values. The helper checks finite values and bounds, then keeps the original sample beside the two calculated inputs. In this deliberately narrow interface, None means that the caller has confirmed the texture is absent. It does not mean that a texture exists but its sample could not be read. That latter condition needs an unresolved observation outside this function. Treating an unavailable sample as an absent texture would conceal the dependency that the review still needs to establish.

The factor defaults match the core property defaults, while the explicit example passes one half for each factor. No image decoder, color conversion, filtering, model parser or rendering engine runs here. The helper also does not inspect glTF extensions. If an extension changes the relevant material behavior, read its specification before applying a core-property calculation to the asset. These boundaries make the example suitable for checking a known scalar path, while preventing a successful multiplication from being mistaken for a complete validation of a model package or its visual quality.

import math


def material_inputs(sample=None, metallic_factor=1.0, roughness_factor=1.0):
    def normalized(value):
        return type(value) in (int, float) and math.isfinite(value) and 0 <= value <= 1
    if not normalized(metallic_factor) or not normalized(roughness_factor):
        raise ValueError("expected normalized finite factors")
    if sample is None:
        green, blue = 1.0, 1.0
        raw = None
        source = "confirmed_absent_texture"
    else:
        if (not isinstance(sample, (list, tuple)) or len(sample) not in (3, 4)
                or not all(normalized(value) for value in sample)):
            raise ValueError("expected normalized linear RGB or RGBA sample")
        raw = tuple(sample)
        green, blue = float(sample[1]), float(sample[2])
        source = "supplied_linear_sample"
    return {"source": source, "raw_sample": raw,
            "green_roughness_sample": green, "blue_metalness_sample": blue,
            "roughness_input": green * float(roughness_factor),
            "metalness_input": blue * float(metallic_factor)}

print(material_inputs((0.9, 0.25, 0.75, 0.4), 0.5, 0.5))
print(material_inputs(None, 0.5, 0.5))

Use controlled changes to check the selected channel

The first output reports roughness_input zero point one two five and metalness_input zero point three seven five. It also retains the raw tuple and the selected green and blue samples. Change only red or alpha while leaving green, blue and both factors fixed: these two calculated inputs should stay unchanged. That test is useful when reviewing a channel-selection implementation because an accidental red-channel read can otherwise appear convincing on a grayscale sample where several channels happen to have equal values. Choose unequal samples to make the dependency visible.

Now change only green. The roughness input changes, while the metalness input remains fixed. Change only blue to exercise the other path. A factor of zero makes its own product zero, and a factor of one retains its selected sample. Those checks isolate the multiplication from channel selection. They do not predict how much brighter, smoother or more reflective a rendered object will appear. Lighting, viewing direction and the rest of the material still matter to a visual result, and none of them is evaluated by this scalar report.

Build a fixture that exposes a channel swap

A useful diagnostic fixture keeps green and blue unequal and assigns different factors in a second run. With green one quarter, blue three quarters, roughness factor one and metallic factor zero, the expected pair is roughness one quarter and metalness zero. Swapping the two factors would produce a visibly different pair. This test complements the equal-factor example, which isolates channel selection but cannot by itself detect every factor-assignment mistake. Keep the expected values written independently from the implementation so an incorrect helper does not define its own success criterion.

Use fractional samples such as quarters and halves for a first arithmetic check, then exercise other normalized values with an appropriate numerical comparison. Do not pass an eight-bit value such as one hundred twenty-eight directly into this normalized interface. It is outside the accepted range and should be rejected. Any conversion from encoded image storage belongs to the documented sampling stage, where the texture role and transfer function are known. Keeping that boundary explicit makes a failing input easier to investigate than silently accepting several incompatible representations in one function.

Distinguish an absent texture from an all-zero sample

The second printed report uses a confirmed absent texture and explicit half factors. Its two sampled inputs are one, so both products are one half. A present texture sample with green and blue both zero instead yields zero products. These are different source conditions even if a particular factor choice can make their final numbers coincide. Keep the source label and original sample with the outputs. A lone calculated zero cannot reveal whether it came from a zero sample, a zero factor or a different material relationship altogether.

For a model handoff, record the asset revision, material index, texture role, coordinate set, sampling context, linear sample and factors. Preserve the original files and place any proposed change in a separate review copy. The NiVO catalogue photograph supplies aircraft context only; it is not the model being inspected or evidence of measured roughness or metal content. This tutorial leaves the reviewer with two explicitly named material inputs and their provenance. That is enough to discuss a suspected channel mistake clearly while keeping rendering, geometry and project acceptance decisions grounded in their own evidence.

Technical references

  1. Khronos glTF 2.0: metallic-roughness factors and texture channels ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team