cgv
Loading...
Searching...
No Matches
surface_material.cxx
1#include "surface_material.h"
2
3namespace cgv {
4 namespace media {
5 namespace illum {
6
8 BrdfType _brdf_type,
9 color_type _diffuse_reflectance,
10 float _roughness,
11 float _metalness,
12 float _ambient_occlusion,
13 color_type _emission,
14 float _transparency,
15 const std::complex<float>& _propagation_slow_down,
16 float _roughness_anisotropy,
17 float _roughness_orientation,
18 color_type _specular_reflectance
19) :
20 brdf_type(_brdf_type),
21 ambient_occlusion(_ambient_occlusion),
22 diffuse_reflectance(_diffuse_reflectance),
23 specular_reflectance(_specular_reflectance),
24 emission(_emission),
25 transparency(_transparency),
26 roughness(_roughness),
27 metalness(_metalness),
28 roughness_anisotropy(_roughness_anisotropy),
29 roughness_orientation(_roughness_orientation),
30 propagation_slow_down(_propagation_slow_down)
31{}
32
33const surface_material& get_surface_material(StandardMaterial material_id)
34{
35
36 static surface_material default_materials[]{
37 { BT_COOK_TORRANCE, {0.5f,0.5f,0.5f}, 0.5f, 0.0f, 1.0f,{0.0f,0.0f,0.0f}, 0.0f, {1.3f,0.0f}, 0.0f, 0.0f, {1.0f,1.0f,1.0f} }
38 };
39 return default_materials[material_id];
40}
41
42 }
43 }
44}
simple class to hold the material properties of a phong material
surface_material(BrdfType _brdf_type=BrdfType(BT_STRAUSS_DIFFUSE+BT_STRAUSS), color_type _diffuse_reflectance=color_type(0.5f, 0.5f, 0.5f), float _roughness=0.5f, float _metalness=0.0f, float _ambient_occlusion=1.0f, color_type _emission=color_type(0, 0, 0), float _transparency=0.0f, const std::complex< float > &_propagation_slow_down=std::complex< float >(1.5f, 0.0f), float _roughness_anisotropy=0.0f, float _roughness_orientation=0.0f, color_type _specular_reflectance=color_type(1, 1, 1))
construct default material
the cgv namespace
Definition print.h:11