MinusculeRender/src/phone_material.h

37 lines
871 B
C
Raw Normal View History

2024-03-22 20:12:09 +08:00
// Copyright 2024 SquareBlock Inc. All Rights Reserved.
// Author: tianlei.richard@qq.com (tianlei.richard)
#pragma once
#include <filesystem>
#include <opencv2/core/core.hpp>
#include <vector>
#include "common.h"
2024-03-27 18:31:10 +08:00
#include "texture.h"
2024-03-22 20:12:09 +08:00
// Bling-Phone Matrerial
class PhoneMaterial {
public:
2024-03-27 18:31:10 +08:00
PhoneMaterial(const std::unordered_map<Texture::TextureType,
std::shared_ptr<Texture>> &textures,
const std::shared_ptr<Lamp> &lamp);
2024-03-22 20:12:09 +08:00
2024-03-27 18:31:10 +08:00
cv::Vec3b shade(const Vertex &shading_point, const Point3d &view_point);
2024-03-22 20:12:09 +08:00
2024-03-27 18:31:10 +08:00
private:
static constexpr int defaultAttenuationFactor = 16;
2024-03-22 20:12:09 +08:00
private:
2024-03-27 18:31:10 +08:00
std::shared_ptr<Lamp> point_lamp_;
std::unordered_map<Texture::TextureType, std::shared_ptr<Texture>> textures_;
// Ambient Related
cv::Vec3b Ka;
2024-03-22 20:12:09 +08:00
2024-03-27 18:31:10 +08:00
// Specular Related
cv::Vec3b Ks;
int specular_attenuation_factor_;
2024-03-22 20:12:09 +08:00
};