refreshMaterialUniforms method

void refreshMaterialUniforms(
  1. Map<String, dynamic> uniforms,
  2. Material material,
  3. double pixelRatio,
  4. double height,
  5. RenderTarget? transmissionRenderTarget,
)

Implementation

void refreshMaterialUniforms(Map<String, dynamic> uniforms, Material material, double pixelRatio, double height, RenderTarget? transmissionRenderTarget) {
  if (material is MeshBasicMaterial) {
    refreshUniformsCommon(uniforms, material);
  } else if (material is MeshLambertMaterial) {
    refreshUniformsCommon(uniforms, material);
  } else if (material is MeshToonMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsToon(uniforms, material);
  } else if (material is MeshPhongMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsPhong(uniforms, material);
  } else if (material is MeshStandardMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsStandard(uniforms, material);
  } else if (material is MeshPhysicalMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsStandard(uniforms, material);
    refreshUniformsPhysical(uniforms, material, transmissionRenderTarget);
  }else if (material is MeshMatcapMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsMatcap(uniforms, material);
  } else if (material is MeshDepthMaterial) {
    refreshUniformsCommon(uniforms, material);
  } else if (material is MeshDistanceMaterial) {
    refreshUniformsCommon(uniforms, material);
    refreshUniformsDistance(uniforms, material);
  } else if (material is MeshNormalMaterial) {
    refreshUniformsCommon(uniforms, material);
  } else if (material is LineBasicMaterial) {
    refreshUniformsLine(uniforms, material);
  }else if (material is LineDashedMaterial) {
    refreshUniformsLine(uniforms, material);
    refreshUniformsDash(uniforms, material);
  }else if (material is PointsMaterial) {
    refreshUniformsPoints(uniforms, material, pixelRatio, height);
  } else if (material is SpriteMaterial) {
    refreshUniformsSprites(uniforms, material);
  } else if (material is ShadowMaterial) {
    uniforms["color"]["value"].setFrom(material.color);
    uniforms["opacity"]["value"] = material.opacity;
  } else if (material is ShaderMaterial) {
    material.uniformsNeedUpdate = false; // #15581
  }
}