This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2024CG-project-render/include/blinn_phong_shading.h
github-classroom[bot] 6eef377959
Initial commit
2024-10-11 10:27:35 +00:00

31 lines
965 B
C++

#ifndef BLINN_PHONG_SHADING_H
#define BLINN_PHONG_SHADING_H
#include "Ray.h"
#include "Light.h"
#include "Object.h"
#include <Eigen/Core>
#include <vector>
#include <memory>
// Given a ray and its hit in the scene, return the Blinn-Phong shading
// contribution over all _visible_ light sources (e.g., take into account
// shadows). Use a hard-coded value of ia=0.1 for ambient light.
//
// Inputs:
// ray incoming ray
// hit_id index into objects of the object just hit by ray
// t _parametric_ distance along ray to hit
// n unit surface normal at hit
// objects list of objects in the scene
// lights list of lights in the scene
// Returns shaded color collected by this ray as rgb 3-vector
Eigen::Vector3d blinn_phong_shading(
const Ray & ray,
const int & hit_id,
const double & t,
const Eigen::Vector3d & n,
const std::vector< std::shared_ptr<Object> > & objects,
const std::vector<std::shared_ptr<Light> > & lights);
#endif