function moveTechniqueRenderStates(gltf) {
  const blendingForTechnique = {};
  const materialPropertiesForTechnique = {};
  const techniquesLegacy = gltf.techniques;
  if (!defined(techniquesLegacy)) {
    return gltf;
  }

  ForEach.technique(gltf, function (techniqueLegacy, techniqueIndex) {
    const renderStates = techniqueLegacy.states;
    if (defined(renderStates)) {
      const materialProperties = (materialPropertiesForTechnique[
        techniqueIndex
      ] = {});

      // If BLEND is enabled, the material should have alpha mode BLEND
      if (isStateEnabled(renderStates, WebGLConstants.BLEND)) {
        materialProperties.alphaMode = "BLEND";

        const blendFunctions = renderStates.functions;
        if (
          defined(blendFunctions) &&
          (defined(blendFunctions.blendEquationSeparate) ||
            defined(blendFunctions.blendFuncSeparate))
        ) {
          blendingForTechnique[techniqueIndex] = {
            blendEquation:
              blendFunctions.blendEquationSeparate ?? defaultBlendEquation,
            blendFactors: getSupportedBlendFactors(
              blendFunctions.blendFuncSeparate,
              defaultBlendFactors
            ),
          };
        }
      }

      // If CULL_FACE is not enabled, the material should be doubleSided
      if (!isStateEnabled(renderStates, WebGLConstants.CULL_FACE)) {
        materialProperties.doubleSided = true;
      }

      delete techniqueLegacy.states;
    }
  });

  if (Object.keys(blendingForTechnique).length > 0) {
    if (!defined(gltf.extensions)) {
      gltf.extensions = {};
    }

    addExtensionsUsed(gltf, "KHR_blend");
  }

  ForEach.material(gltf, function (material) {
    if (defined(material.technique)) {
      const materialProperties =
        materialPropertiesForTechnique[material.technique];
      ForEach.objectLegacy(materialProperties, function (value, property) {
        material[property] = value;
      });

      const blending = blendingForTechnique[material.technique];
      if (defined(blending)) {
        if (!defined(material.extensions)) {
          material.extensions = {};
        }

        material.extensions.KHR_blend = blending;
      }
    }
  });

  return gltf;
}
Move glTF 1.0 technique render states to glTF 2.0 materials properties and KHR_blend extension.

@param {object} gltf A javascript object containing a glTF asset.
@returns {object} The updated glTF asset.

@private