cgv
Loading...
Searching...
No Matches
obj_material.h
1#pragma once
2
3#include <cgv/media/illum/phong_material.h> //@<
4#include "lib_begin.h" //@<
5
6namespace cgv { //@<
7 namespace media { //@<
8 namespace illum { //@<
9
11class CGV_API obj_material : public phong_material
12{
13protected: //@<
15 std::string name;
17 float opacity;
31 std::string bump_texture_name;
32public: //@<
35 TT_AMBIENT_TEXTURE = 1,
36 TT_DIFFUSE_TEXTURE = 2,
37 TT_OPACITY_TEXTURE = 4,
38 TT_SPECULAR_TEXTURE = 8,
39 TT_EMISSION_TEXTURE = 16,
40 TT_BUMP_TEXTURE = 32,
41 TT_ALL_TEXTURES = 63
42 };
44 obj_material() : name("default"), opacity(1), bump_scale(1) {}
46 void set_opacity(float o) { opacity = o; }
48 float get_opacity() const { return opacity; }
50 float& ref_opacity() { return opacity; }
52 void set_name(std::string o) { name = o; }
54 const std::string& get_name() const { return name; }
56 std::string& ref_name() { return name; }
58 virtual void set_ambient_texture_name(std::string o) { ambient_texture_name = o; }
60 const std::string& get_ambient_texture_name() const { return ambient_texture_name; }
62 std::string& ref_ambient_texture_name() { return ambient_texture_name; }
64 virtual void set_diffuse_texture_name(std::string o) { diffuse_texture_name = o; }
66 const std::string& get_diffuse_texture_name() const { return diffuse_texture_name; }
68 std::string& ref_diffuse_texture_name() { return diffuse_texture_name; }
70 virtual void set_opacity_texture_name(std::string o) { opacity_texture_name = o; }
72 const std::string& get_opacity_texture_name() const { return opacity_texture_name; }
74 std::string& ref_opacity_texture_name() { return opacity_texture_name; }
76 virtual void set_specular_texture_name(std::string o) { specular_texture_name = o; }
78 const std::string& get_specular_texture_name() const { return specular_texture_name; }
80 std::string& ref_specular_texture_name() { return specular_texture_name; }
82 virtual void set_emission_texture_name(std::string o) { emission_texture_name = o; }
84 const std::string& get_emission_texture_name() const { return emission_texture_name; }
86 std::string& ref_emission_texture_name() { return emission_texture_name; }
88 virtual void set_bump_texture_name(std::string b) { bump_texture_name = b; }
90 const std::string& get_bump_texture_name() const { return bump_texture_name; }
92 std::string& ref_bump_texture_name() { return bump_texture_name; }
94 void set_bump_scale(float bs) { bump_scale = bs; }
96 float get_bump_scale() const { return bump_scale; }
98 float& ref_bump_scale() { return bump_scale; }
99};
100
101 }
102 }
103}
104
105#include <cgv/config/lib_end.h> //@<
>extension of a phong material with support for texture mapped color channels
const std::string & get_name() const
return name value
float bump_scale
> scaling factor for bump map
virtual void set_emission_texture_name(std::string o)
set emission_texture_name value
void set_bump_scale(float bs)
set scale of bumps
float get_bump_scale() const
return bump scale
void set_opacity(float o)
set opacity value
const std::string & get_emission_texture_name() const
return emission_texture_name value
virtual void set_specular_texture_name(std::string o)
set specular_texture_name value
float opacity
> opacity value
const std::string & get_specular_texture_name() const
return specular_texture_name value
virtual void set_bump_texture_name(std::string b)
set bump_texture_name value
std::string & ref_ambient_texture_name()
return reference to ambient_texture_name value
float & ref_opacity()
return reference to opacity value
std::string & ref_name()
return reference to name value
float get_opacity() const
return opacity value
std::string & ref_bump_texture_name()
return reference to bump_texture_name value
std::string emission_texture_name
> file name of emission texture
std::string & ref_diffuse_texture_name()
return reference to diffuse_texture_name value
std::string bump_texture_name
> file name of bump map texture
std::string & ref_specular_texture_name()
return reference to specular_texture_name value
std::string diffuse_texture_name
> file name of diffuse texture
std::string specular_texture_name
> file name of specular texture
virtual void set_ambient_texture_name(std::string o)
set ambient_texture_name value
std::string & ref_opacity_texture_name()
return reference to opacity_texture_name value
std::string ambient_texture_name
> file name of ambient texture
void set_name(std::string o)
set name value
const std::string & get_ambient_texture_name() const
return ambient_texture_name value
const std::string & get_bump_texture_name() const
return bump_texture_name value
std::string & ref_emission_texture_name()
return reference to emission_texture_name value
float & ref_bump_scale()
return reference to bump scale
std::string name
> name of material
TextureType
> different types of textures
const std::string & get_opacity_texture_name() const
return opacity_texture_name value
std::string opacity_texture_name
> file name of opacity texture
const std::string & get_diffuse_texture_name() const
return diffuse_texture_name value
obj_material()
define default material
virtual void set_opacity_texture_name(std::string o)
set opacity_texture_name value
virtual void set_diffuse_texture_name(std::string o)
set diffuse_texture_name value
>simple class to hold the material properties of a phong material
the cgv namespace
Definition print.h:11