cgv
Loading...
Searching...
No Matches
textured_surface_material.h
1#pragma once
2
3#include <vector>
4#include "surface_material.h"
5#include "obj_material.h"
6
7#include "lib_begin.h"
8
9namespace cgv {
10 namespace media {
11 namespace illum {
12
15{
16public:
18 std::string name = "default";
20 bool sRGBA_textures = false;
22 int diffuse_index = -1;
24
26 int roughness_index = -1;
28
30 int metalness_index = -1;
32
33 int ambient_index = -1;
35 int emission_index = -1;
37
38 int transparency_index = -1;
40 int propagation_slow_down_index = -1;
42 int specular_index = -1;
44 int normal_index = -1;
46
47 int bump_index = -1;
49 float bump_scale = 0.1f;
50
55
57 unsigned get_nr_image_files() const { return unsigned(image_file_names.size()); }
59 int add_image_file(const std::string& file_name);
61 std::string get_image_file_name(int i) const { return image_file_names[i]; }
63 void set_image_file_name(int i, std::string image_file_name) { image_file_names[i] = image_file_name; }
65 std::string& ref_image_file_name(int i) { return image_file_names[i]; }
67 virtual size_t get_nr_textures() const { return get_nr_image_files(); }
68
69protected:
71 std::vector<std::string> image_file_names;
72};
73 }
74 }
75}
76
77#include <cgv/config/lib_end.h>
Stores properties of a surface material with support for texturing.
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
virtual size_t get_nr_textures() const
virtual method to query number of textures
unsigned get_nr_image_files() const
return number of image files
std::string & ref_image_file_name(int i)
return reference to image file name of i-th image file
textured_surface_material()
construct using default values
std::string get_image_file_name(int i) const
return the name of the i-th image file
the cgv namespace
Definition print.h:11
Extension of a phong material with support for texture-mapped color channels.
Stores properties of a surface material.