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 virtual ~textured_surface_material() noexcept = default;
56
58 unsigned get_nr_image_files() const { return unsigned(image_file_names.size()); }
60 int add_image_file(const std::string& file_name);
62 std::string get_image_file_name(int i) const { return image_file_names[i]; }
64 void set_image_file_name(int i, std::string image_file_name) { image_file_names[i] = image_file_name; }
66 std::string& ref_image_file_name(int i) { return image_file_names[i]; }
68 virtual size_t get_nr_textures() const { return get_nr_image_files(); }
69
70protected:
72 std::vector<std::string> image_file_names;
73};
74 }
75 }
76}
77
78#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
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
this header is dependency free
Definition print.h:11
Extension of a phong material with support for texture-mapped color channels.
Stores properties of a surface material.