|
cgv
|
Stores properties of a surface material with support for texturing. More...
#include <textured_surface_material.h>
Public Member Functions | |
| textured_surface_material () | |
| construct using default values | |
| textured_surface_material (const obj_material &obj_mat) | |
| construct from obj material | |
| unsigned | get_nr_image_files () const |
| return number of image files | |
| int | add_image_file (const std::string &file_name) |
| add a new image and return its index | |
| std::string | get_image_file_name (int i) const |
| return the name of the i-th image file | |
| void | set_image_file_name (int i, std::string image_file_name) |
| set the image file name of i-th image file | |
| std::string & | ref_image_file_name (int i) |
| return reference to image file name of i-th image file | |
| virtual size_t | get_nr_textures () const |
| virtual method to query number of textures | |
Public Attributes | |
| std::string | name = "default" |
| name of material | |
| bool | sRGBA_textures = false |
| whether textures are in sRGB format | |
| int | diffuse_index = -1 |
| index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping | |
| int | roughness_index = -1 |
| index of image from which roughness should be mapped, -1 corresponds to no mapping | |
| int | metalness_index = -1 |
| index of image from which metalness should be mapped, -1 corresponds to no mapping | |
| int | ambient_index = -1 |
| index of image from which ambient_occlusion should be mapped, -1 corresponds to no mapping | |
| int | emission_index = -1 |
| index of image from which emission should be mapped, -1 corresponds to no mapping | |
| int | transparency_index = -1 |
| index of image from which transparency should be mapped, -1 corresponds to no mapping | |
| int | propagation_slow_down_index = -1 |
| index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping | |
| int | specular_index = -1 |
| index of image from which specular_reflectance should be mapped, -1 corresponds to no mapping | |
| int | normal_index = -1 |
| index of image from which normals should be mapped, -1 corresponds to no mapping | |
| int | bump_index = -1 |
| index of image from which bumps should be mapped, -1 corresponds to no mapping | |
| float | bump_scale = 0.1f |
| scaling factor for bump map | |
Public Attributes inherited from cgv::media::illum::surface_material | |
| BrdfType | brdf_type = BrdfType(BT_STRAUSS_DIFFUSE + BT_STRAUSS) |
| store brdf type, defaults to BT_STRAUSS_DIFFUSE + BT_STRAUSS | |
| color_type | diffuse_reflectance = { 0.5f } |
| diffuse reflectance of surface, defaults to 0.5,0.5,0.5 | |
| float | roughness = 0.5f |
| surface roughness in the range [0,1] (1/2 trace of symmetric 2x2 matrix for anisotropic case where directional roughness is represented in the uv-coordinate system of texcoords), defaults to 0.5 | |
| float | metalness = 0.0f |
| metalness of surface, defaults to 0 | |
| float | ambient_occlusion = 1.0f |
| scalar factor to down scale ambient light, defaults to 1 | |
| color_type | emission = { 0.0f } |
| emissive color component, defaults to 0,0,0 | |
| float | transparency = 0.0f |
| modulation for transparency, defaults to 0 | |
| std::complex< float > | propagation_slow_down = { 1.5f, 0.0f } |
| complex fraction of complex interior over real exterior index of refraction, defaults to 1.5,0 | |
| float | roughness_anisotropy = 0.0f |
difference of roughness matrix eigenvalues in range [0,1] relative to roughness, i.e. lambda_1 - lambda_2 = roughness_anisotropy*roughness, defaults to 0 | |
| float | roughness_orientation = 0.0f |
| orientation of roughness in range [0,1], where 0 corresponds to u-direction and 0.5 to v direction, defaults to 0 | |
| color_type | specular_reflectance = { 1.0f } |
| specular color used to modulate specular reflection component, should be 1,1,1 | |
Protected Attributes | |
| std::vector< std::string > | image_file_names |
| vector of image file names | |
Additional Inherited Members | |
Public Types inherited from cgv::media::illum::surface_material | |
| using | color_type = cgv::rgb |
Stores properties of a surface material with support for texturing.
Definition at line 14 of file textured_surface_material.h.
|
inline |
construct using default values
Definition at line 52 of file textured_surface_material.h.
| cgv::media::illum::textured_surface_material::textured_surface_material | ( | const obj_material & | obj_mat | ) |
construct from obj material
Definition at line 9 of file textured_surface_material.cxx.
References add_image_file(), cgv::media::illum::phong_material::ambient, ambient_index, cgv::media::illum::surface_material::ambient_occlusion, cgv::media::illum::obj_material::ambient_texture_name, cgv::media::illum::surface_material::brdf_type, bump_index, cgv::media::illum::obj_material::bump_scale, bump_scale, cgv::media::illum::obj_material::bump_texture_name, cgv::media::illum::phong_material::diffuse, diffuse_index, cgv::media::illum::surface_material::diffuse_reflectance, cgv::media::illum::obj_material::diffuse_texture_name, cgv::media::illum::phong_material::emission, cgv::media::illum::surface_material::emission, emission_index, cgv::media::illum::obj_material::emission_texture_name, cgv::media::illum::obj_material::name, name, cgv::media::illum::obj_material::opacity, cgv::media::illum::obj_material::opacity_texture_name, cgv::media::illum::surface_material::roughness, cgv::media::illum::phong_material::shininess, cgv::media::illum::phong_material::specular, specular_index, cgv::media::illum::surface_material::specular_reflectance, cgv::media::illum::obj_material::specular_texture_name, cgv::media::illum::surface_material::transparency, and transparency_index.
| int cgv::media::illum::textured_surface_material::add_image_file | ( | const std::string & | file_name | ) |
add a new image and return its index
Definition at line 44 of file textured_surface_material.cxx.
References image_file_names.
Referenced by textured_surface_material().
|
inline |
return the name of the i-th image file
Definition at line 61 of file textured_surface_material.h.
|
inline |
return number of image files
Definition at line 57 of file textured_surface_material.h.
|
inlinevirtual |
virtual method to query number of textures
Reimplemented in cgv::render::textured_material.
Definition at line 67 of file textured_surface_material.h.
|
inline |
return reference to image file name of i-th image file
Definition at line 65 of file textured_surface_material.h.
|
inline |
set the image file name of i-th image file
Definition at line 63 of file textured_surface_material.h.
| int cgv::media::illum::textured_surface_material::ambient_index = -1 |
index of image from which ambient_occlusion should be mapped, -1 corresponds to no mapping
In case of 4 component textures ambient_occlusion is mapped from the w component.
Definition at line 33 of file textured_surface_material.h.
Referenced by cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().
| int cgv::media::illum::textured_surface_material::bump_index = -1 |
index of image from which bumps should be mapped, -1 corresponds to no mapping
If no normal mapping is applies, bump map is also used for normal mapping.
Definition at line 47 of file textured_surface_material.h.
Referenced by cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().
| float cgv::media::illum::textured_surface_material::bump_scale = 0.1f |
scaling factor for bump map
Definition at line 49 of file textured_surface_material.h.
Referenced by textured_surface_material().
| int cgv::media::illum::textured_surface_material::diffuse_index = -1 |
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
Definition at line 22 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().
| int cgv::media::illum::textured_surface_material::emission_index = -1 |
index of image from which emission should be mapped, -1 corresponds to no mapping
Definition at line 35 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().
|
protected |
vector of image file names
Definition at line 71 of file textured_surface_material.h.
Referenced by add_image_file(), cgv::render::textured_material::add_texture_reference(), and cgv::render::textured_material::ensure_textures().
| int cgv::media::illum::textured_surface_material::metalness_index = -1 |
index of image from which metalness should be mapped, -1 corresponds to no mapping
In case of 4 component textures metalness is mapped from the w component. For 2 component textures, metalness is mapped from the x-component.
Definition at line 30 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), and cgv::render::shader_program::set_textured_material_uniform().
| std::string cgv::media::illum::textured_surface_material::name = "default" |
name of material
Definition at line 18 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), cgv::render::extract_mesh(), and textured_surface_material().
| int cgv::media::illum::textured_surface_material::normal_index = -1 |
index of image from which normals should be mapped, -1 corresponds to no mapping
Definition at line 44 of file textured_surface_material.h.
| int cgv::media::illum::textured_surface_material::propagation_slow_down_index = -1 |
index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
Definition at line 40 of file textured_surface_material.h.
| int cgv::media::illum::textured_surface_material::roughness_index = -1 |
index of image from which roughness should be mapped, -1 corresponds to no mapping
In case of 3 or 4 component textures roughness is mapped anisotropically from the xyz components. For 2 component textures, roughness is mapped from the y-component.
Definition at line 26 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), and cgv::render::shader_program::set_textured_material_uniform().
| int cgv::media::illum::textured_surface_material::specular_index = -1 |
index of image from which specular_reflectance should be mapped, -1 corresponds to no mapping
Definition at line 42 of file textured_surface_material.h.
Referenced by cgv::render::build_render_info(), cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().
| bool cgv::media::illum::textured_surface_material::sRGBA_textures = false |
whether textures are in sRGB format
Definition at line 20 of file textured_surface_material.h.
Referenced by cgv::render::shader_program::set_textured_material_uniform().
| int cgv::media::illum::textured_surface_material::transparency_index = -1 |
index of image from which transparency should be mapped, -1 corresponds to no mapping
In case of 4 component textures transparency is mapped from the w component.
Definition at line 38 of file textured_surface_material.h.
Referenced by cgv::render::shader_program::set_textured_material_uniform(), and textured_surface_material().