Support Forum       G3D Web Page     
Classes | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
G3D::ParseMTL::Material Class Reference

Loaded from the MTL file. More...

Inherits G3D::ReferenceCountedObject.

Classes

class  Field
 

Static Public Member Functions

static shared_ptr< Materialcreate ()
 We default Ks to 0.8f if there is no map_Ks. More...
 

Public Attributes

String basePath
 Path relative to which filenames should be resolved. More...
 
Field bump
 Bump map. More...
 
float d
 Opacity (alpha) level, on the range 0-1, where 1 = opaque (default). More...
 
int illum
 Illumination model enumeration on the range 0-10: More...
 
String interpolateMode
 
Field Ka
 Ambient color of the material, on the range 0-1. More...
 
Field Kd
 Diffuse color of the material, on the range 0-1. More...
 
Field Ke
 Emissive. More...
 
Field Ks
 Specular color of the material, on the range 0-1. More...
 
String lightMap
 (non-standard extension), for lightMaps More...
 
String map_d
 
String name
 
float Ni
 Index of refraction. More...
 
float Ns
 Shininess of the material, on the range 0-1000. More...
 
Color3 Tf
 1 - Transmission, as processed by 3DS Max (http://casual-effects.blogspot.com/2012/01/translucency-in-obj-mtl-files.html). More...
 

Protected Member Functions

 Material ()
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

Loaded from the MTL file.

Constructor & Destructor Documentation

◆ Material()

G3D::ParseMTL::Material::Material ( )
inlineprotected

Member Function Documentation

◆ create()

static shared_ptr<Material> G3D::ParseMTL::Material::create ( )
inlinestatic

We default Ks to 0.8f if there is no map_Ks.

This is non-standard but matches G3D's lighting model better. The specification default(and what we default to when there is a map_Ks) is 1.0f. Note that we raise Ks to the 9th power when loading into an Articulated Model.

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

Member Data Documentation

◆ basePath

String G3D::ParseMTL::Material::basePath

Path relative to which filenames should be resolved.

◆ bump

Field G3D::ParseMTL::Material::bump

Bump map.

◆ d

float G3D::ParseMTL::Material::d

Opacity (alpha) level, on the range 0-1, where 1 = opaque (default).

Some non-standard MTL files (e.g., produced by MeshLab) write Tr = 1 - d instead. If ParseMTL encounters Tr, it sets d = 1 - Tr.

◆ illum

int G3D::ParseMTL::Material::illum

Illumination model enumeration on the range 0-10:

model Property Editor
0 Color on and Ambient off
1 Color on and Ambient on
2 Highlight on
3 Reflection on and Ray trace on
4 Transparency: Glass on; Reflection: Ray trace on
5 Reflection: Fresnel on and Ray trace on
6 Transparency: Refraction on; Reflection: Fresnel off and Ray trace on
7 Transparency: Refraction on; Reflection: Fresnel on and Ray trace on
8 Reflection on and Ray trace off
9 Transparency: Glass on; Reflection: Ray trace off
10 Casts shadows onto invisible surfaces

3-7 force mirror glossiness. 2 is probably what you want.

Referenced Code: http://paulbourke.net/dataformats/mtl/

◆ interpolateMode

String G3D::ParseMTL::Material::interpolateMode

◆ Ka

Field G3D::ParseMTL::Material::Ka

Ambient color of the material, on the range 0-1.

◆ Kd

Field G3D::ParseMTL::Material::Kd

Diffuse color of the material, on the range 0-1.

◆ Ke

Field G3D::ParseMTL::Material::Ke

Emissive.

◆ Ks

Field G3D::ParseMTL::Material::Ks

Specular color of the material, on the range 0-1.

◆ lightMap

String G3D::ParseMTL::Material::lightMap

(non-standard extension), for lightMaps

◆ map_d

String G3D::ParseMTL::Material::map_d

◆ name

String G3D::ParseMTL::Material::name

◆ Ni

float G3D::ParseMTL::Material::Ni

Index of refraction.

◆ Ns

float G3D::ParseMTL::Material::Ns

Shininess of the material, on the range 0-1000.

◆ Tf

Color3 G3D::ParseMTL::Material::Tf

1 - Transmission, as processed by 3DS Max (http://casual-effects.blogspot.com/2012/01/translucency-in-obj-mtl-files.html).

Other specification documents say that it is transmission (e.g, http://paulbourke.net/dataformats/mtl/) but I haven't found software that implements it that way.


documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15