-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.h
24 lines (20 loc) · 916 Bytes
/
Material.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include "Ray.h"
#include "BSDF.h"
#include "smallFuncs.h"
#include "SceneObject.h"
#include "EXT/rapidxml/rapidxml.hpp"
#include "xmlHelper.h"
using namespace rapidxml;
class ConfigManager;
class Material
{
public:
virtual float getOriginSampleProbDensity(const Ray& inRay, const Ray& outRay) { return 1; }
virtual Ray scatter(const SceneObject* object, const Ray& inRay, const bool russian = true) const { return Ray(); }
virtual float getDirectionSampleProbDensity(const Ray& inRay, const Ray& outRay) const{ return 1; }
virtual float getContinueProbability(const Ray &inRay, const Ray &outRay) const { return 1; }
virtual vec3f getBSDF(const Ray& inRay, const Ray& outRay) const { return vec3f(0, 0, 0); }
virtual vec3f getRadianceDecay(const Ray& inRay, const float& dist) const { return vec3f(1, 1, 1); }
virtual void loadMaterialFromXML(const ConfigManager* cm, xml_node<>* node){}
};