src/components/material.js
function (oldData) {
    var data = this.data;
    var material = this.material;
    var oldDataHasKeys;

    // Base material properties.
    material.alphaTest = data.alphaTest;
    material.depthTest = data.depthTest !== false;
    material.depthWrite = data.depthWrite !== false;
    material.opacity = data.opacity;
    material.flatShading = data.flatShading;
    material.side = parseSide(data.side);
    material.transparent = data.transparent !== false || data.opacity < 1.0;
    material.vertexColors = parseVertexColors(data.vertexColors);
    material.visible = data.visible;
    material.blending = parseBlending(data.blending);

    // Check if material needs update.
    for (oldDataHasKeys in oldData) { break; }
    if (oldDataHasKeys &&
        (oldData.alphaTest !== data.alphaTest ||
         oldData.side !== data.side ||
         oldData.vertexColors !== data.vertexColors)) {
      material.needsUpdate = true;
    }
  }
function (oldData) {
    var data = this.data;
    var material = this.material;
    var oldDataHasKeys;

    // Base material properties.
    material.alphaTest = data.alphaTest;
    material.depthTest = data.depthTest !== false;
    material.depthWrite = data.depthWrite !== false;
    material.opacity = data.opacity;
    material.flatShading = data.flatShading;
    material.side = parseSide(data.side);
    material.transparent = data.transparent !== false || data.opacity < 1.0;
    material.vertexColors = parseVertexColors(data.vertexColors);
    material.visible = data.visible;
    material.blending = parseBlending(data.blending);

    // Check if material needs update.
    for (oldDataHasKeys in oldData) { break; }
    if (oldDataHasKeys &&
        (oldData.alphaTest !== data.alphaTest ||
         oldData.side !== data.side ||
         oldData.vertexColors !== data.vertexColors)) {
      material.needsUpdate = true;
    }
  }
function ( oldData ) { var data = this . data ; var material = this . material ; var oldDataHasKeys ; // Base material properties. material . alphaTest = data . alphaTest ; material . depthTest = data . depthTest !== false ; material . depthWrite = data . depthWrite !== false ; material . opacity = data . opacity ; material . flatShading = data . flatShading ; material . side = parseSide ( data . side ) ; material . transparent = data . transparent !== false || data . opacity < 1.0 ; material . vertexColors = parseVertexColors ( data . vertexColors ) ; material . visible = data . visible ; material . blending = parseBlending ( data . blending ) ; // Check if material needs update. for ( oldDataHasKeys in oldData ) { break ; } if ( oldDataHasKeys && ( oldData . alphaTest !== data . alphaTest || oldData . side !== data . side || oldData . vertexColors !== data . vertexColors ) ) { material . needsUpdate = true ; } }
Set and update base material properties.
Set `needsUpdate` when needed.
Set and update base material properties . Set needsUpdate when needed .