cgv
cgv::media::illum::textured_surface_material Class Reference

simple class to hold the material properties of a phong material More...

#include <textured_surface_material.h>

Inheritance diagram for cgv::media::illum::textured_surface_material:
cgv::media::illum::surface_material cgv::render::textured_material

Public Types

typedef color< float, RGB > color_type
 used color type
 

Public Member Functions

 textured_surface_material (const std::string &_name="default", BrdfType _brdf_type=BrdfType(BT_STRAUSS_DIFFUSE+BT_STRAUSS), color_type _diffuse_reflectance=0.5f, float _roughness=0.5f, float _metalness=0.0f, float _ambient_occlusion=1.0f, color_type _emission=color_type(0, 0, 0), float _transparency=0.0f, const std::complex< float > &_propagation_slow_down=std::complex< float >(1.5f, 0.0f), float _roughness_anisotropy=0.0f, float _roughness_orientation=0.0f, color_type _specular_reflectance=color_type(1, 1, 1), float _bump_scale=0.1f)
 define default material
 
 textured_surface_material (const obj_material &obj_mat)
 convert obj material
 
void set_name (std::string o)
 set the name of the material
 
const std::string & get_name () const
 return name value
 
std::string & ref_name ()
 return reference to name value
 
void set_sRGBA_textures (bool do_set=true)
 set whether textures are interpreted in sRGB format
 
bool get_sRGBA_textures () const
 return whether textures are interpreted in sRGB format
 
bool & ref_sRGBA_textures ()
 return reference to whether textures are interpreted in sRGB format
 
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
 
void set_bump_scale (float bs)
 set scale of bumps
 
float get_bump_scale () const
 return bump scale
 
float & ref_bump_scale ()
 return reference to bump scale
 

Protected Attributes

std::string name
 name of material
 
bool sRGBA_textures
 whether textures are in sRGB format
 
std::vector< std::string > image_file_names
 vector of image file names
 
int diffuse_index
 index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
 
int roughness_index
 index of image from which roughness should be mapped, -1 corresponds to no mapping More...
 
int metalness_index
 index of image from which metalness should be mapped, -1 corresponds to no mapping More...
 
int ambient_index
 index of image from which ambient_occlusion should be mapped, -1 corresponds to no mapping More...
 
int emission_index
 index of image from which emission should be mapped, -1 corresponds to no mapping
 
int transparency_index
 index of image from which transparency should be mapped, -1 corresponds to no mapping More...
 
int propagation_slow_down_index
 index of image from which diffuse_reflectance should be mapped, -1 corresponds to no mapping
 
int specular_index
 index of image from which specular_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
 
int bump_index
 index of image from which bumps should be mapped, -1 corresponds to no mapping More...
 
float bump_scale
 scaling factor for bump map
 
BrdfType brdf_type
 store brdf type, defaults to BT_COOK_TORRANCE
 
color_type diffuse_reflectance
 diffuse reflectance of surface, defaults to 0.5,0.5,0.5
 
float roughness
 surface roughness in the range 0,1, defaults to 0.5
 
float metalness
 metalness of surface
 
float ambient_occlusion
 scalar factor to down scale ambient light, defaults to 1
 
color_type emission
 emissive color component, defaults to 0,0,0
 
float transparency
 modulation for transparency, defaults to 0
 
std::complex< float > propagation_slow_down
 complex fraction of complex interior over real exterior index of refraction, defaults to 1.5,0
 
float roughness_anisotropy
 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
 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
 specular color used to modulate specular reflection component, should be 1,1,1
 

Detailed Description

simple class to hold the material properties of a phong material

Member Data Documentation

◆ ambient_index

int cgv::media::illum::textured_surface_material::ambient_index
protected

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.

◆ bump_index

int cgv::media::illum::textured_surface_material::bump_index
protected

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.

◆ metalness_index

int cgv::media::illum::textured_surface_material::metalness_index
protected

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.

◆ roughness_index

int cgv::media::illum::textured_surface_material::roughness_index
protected

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.

◆ transparency_index

int cgv::media::illum::textured_surface_material::transparency_index
protected

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.


The documentation for this class was generated from the following files: