// Copyright 2024 SquareBlock Inc. All Rights Reserved.
// Author: tianlei.richard@qq.com (tianlei.richard)

#pragma once

#include <filesystem>
#include <vector>

#include "common.h"
#include "lamp.h"
#include "texture.h"

// Bling-Phone Matrerial
class PhoneMaterial {
public:
  explicit PhoneMaterial(
      const std::unordered_map<Texture::TextureType, std::shared_ptr<Texture>>
          &textures);

  cv::Vec3b shade(const Vertex &shading_point, const Point3d &view_point,
                  const std::vector<std::shared_ptr<PointLamp>> &lamps) const;

private:
  static constexpr int defaultAttenuationFactor = 128;

private:
  std::unordered_map<Texture::TextureType, std::shared_ptr<Texture>> textures_;

  // Ambient Related
  float Ka;

  // Specular Related
  float Ks;
  int specular_attenuation_factor_;
};
