4 #include "surface_material.h"
5 #include "obj_material.hh"
55 const std::string& _name =
"default",
56 BrdfType _brdf_type = BrdfType(BT_STRAUSS_DIFFUSE + BT_STRAUSS),
58 float _roughness = 0.5f,
59 float _metalness = 0.0f,
60 float _ambient_occlusion = 1.0f,
62 float _transparency = 0.0f,
63 const std::complex<float>& _propagation_slow_down = std::complex<float>(1.5f, 0.0f),
64 float _roughness_anisotropy = 0.0f,
65 float _roughness_orientation = 0.0f,
67 float _bump_scale = 0.1f
74 const std::string&
get_name()
const {
return name; }
78 void set_sRGBA_textures(
bool do_set =
true);
86 int add_image_file(
const std::string& file_name);
90 void set_image_file_name(
int i, std::string image_file_name) { image_file_names[i] = image_file_name; }
96 void set_diffuse_index(
int i) { diffuse_index = i; }
97 int get_diffuse_index()
const {
return diffuse_index; }
98 int& ref_diffuse_index() {
return diffuse_index; }
100 void set_roughness_index(
int i) { roughness_index = i; }
101 int get_roughness_index()
const {
return roughness_index; }
102 int& ref_roughness_index() {
return roughness_index; }
104 void set_metalness_index(
int i) { metalness_index = i; }
105 int get_metalness_index()
const {
return metalness_index; }
106 int& ref_metalness_index() {
return metalness_index; }
108 void set_ambient_index(
int i) { ambient_index = i; }
109 int get_ambient_index()
const {
return ambient_index; }
110 int& ref_ambient_index() {
return ambient_index; }
112 void set_emission_index(
int i) { emission_index = i; }
113 int get_emission_index()
const {
return emission_index; }
114 int& ref_emission_index() {
return emission_index; }
116 void set_transparency_index(
int i) { transparency_index = i; }
117 int get_transparency_index()
const {
return transparency_index; }
118 int& ref_transparency_index() {
return transparency_index; }
120 void set_specular_index(
int i) { specular_index = i; }
121 int get_specular_index()
const {
return specular_index; }
122 int& ref_specular_index() {
return specular_index; }
124 void set_normal_index(
int i) { normal_index = i; }
125 int get_normal_index()
const {
return normal_index; }
126 int& ref_normal_index() {
return normal_index; }
128 void set_bump_index(
int i) { bump_index = i; }
129 int get_bump_index()
const {
return bump_index; }
130 int& ref_bump_index() {
return bump_index; }
145 #include <cgv/config/lib_end.h>
int diffuse_index
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:24
int metalness_index
index of image from which metalness should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:32
float get_bump_scale() const
return bump scale
Definition: textured_surface_material.h:135
int transparency_index
index of image from which transparency should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:40
bool get_sRGBA_textures() const
return whether textures are interpreted in sRGB format
Definition: textured_surface_material.h:80
int specular_index
index of image from which specular_reflectance should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:44
bool sRGBA_textures
whether textures are in sRGB format
Definition: textured_surface_material.h:20
int propagation_slow_down_index
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:42
int bump_index
index of image from which bumps should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:49
int normal_index
index of image from which normals should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:46
std::vector< std::string > image_file_names
vector of image file names
Definition: textured_surface_material.h:22
virtual size_t get_nr_textures() const
virtual method to query number of textures
Definition: textured_surface_material.h:94
float & ref_bump_scale()
return reference to bump scale
Definition: textured_surface_material.h:137
int roughness_index
index of image from which roughness should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:28
std::string get_image_file_name(int i) const
return the name of the i-th image file
Definition: textured_surface_material.h:88
const std::string & get_name() const
return name value
Definition: textured_surface_material.h:74
int emission_index
index of image from which emission should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:37
float bump_scale
scaling factor for bump map
Definition: textured_surface_material.h:51
unsigned get_nr_image_files() const
return number of image files
Definition: textured_surface_material.h:84
void set_image_file_name(int i, std::string image_file_name)
set the image file name of i-th image file
Definition: textured_surface_material.h:90
std::string & ref_image_file_name(int i)
return reference to image file name of i-th image file
Definition: textured_surface_material.h:92
void set_bump_scale(float bs)
set scale of bumps
Definition: textured_surface_material.h:133
void set_name(std::string o)
set the name of the material
Definition: textured_surface_material.h:72
simple class to hold the material properties of a phong material
Definition: textured_surface_material.h:15
bool & ref_sRGBA_textures()
return reference to whether textures are interpreted in sRGB format
Definition: textured_surface_material.h:82
the cgv namespace
Definition: vr_calib.cxx:9
int ambient_index
index of image from which ambient_occlusion should be mapped, -1 corresponds to no mapping
Definition: textured_surface_material.h:35
std::string & ref_name()
return reference to name value
Definition: textured_surface_material.h:76
std::string name
name of material
Definition: textured_surface_material.h:18