4#include "surface_material.h"
5#include "obj_material.h"
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>
simple class to hold the material properties of a phong material
int metalness_index
index of image from which metalness should be mapped, -1 corresponds to no mapping
const std::string & get_name() const
return name value
void set_image_file_name(int i, std::string image_file_name)
set the image file name of i-th image file
std::vector< std::string > image_file_names
vector of image file names
int propagation_slow_down_index
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
void set_name(std::string o)
set the name of the material
std::string name
name of material
int transparency_index
index of image from which transparency should be mapped, -1 corresponds to no mapping
float get_bump_scale() const
return bump scale
bool sRGBA_textures
whether textures are in sRGB format
virtual size_t get_nr_textures() const
virtual method to query number of textures
void set_bump_scale(float bs)
set scale of bumps
int roughness_index
index of image from which roughness should be mapped, -1 corresponds to no mapping
bool & ref_sRGBA_textures()
return reference to whether textures are interpreted in sRGB format
std::string & ref_name()
return reference to name value
unsigned get_nr_image_files() const
return number of image files
bool get_sRGBA_textures() const
return whether textures are interpreted in sRGB format
int specular_index
index of image from which specular_reflectance should be mapped, -1 corresponds to no mapping
float & ref_bump_scale()
return reference to bump scale
int ambient_index
index of image from which ambient_occlusion should be mapped, -1 corresponds to no mapping
std::string & ref_image_file_name(int i)
return reference to image file name of i-th image file
int emission_index
index of image from which emission should be mapped, -1 corresponds to no mapping
int bump_index
index of image from which bumps should be mapped, -1 corresponds to no mapping
std::string get_image_file_name(int i) const
return the name of the i-th image file
int diffuse_index
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
int normal_index
index of image from which normals should be mapped, -1 corresponds to no mapping
float bump_scale
scaling factor for bump map