Stellarium  0.17.0
Data Structures | Public Member Functions | Data Fields
S3DScene::Material Struct Reference

Extension of StelOBJ::Material which provides Scenery3d specific stuff.

#include <S3DScene.hpp>

Data Structures

struct  Traits
 

Public Member Functions

 Material (const StelOBJ::Material &stelMat)
 
void loadTexturesAsync ()
 Starts loading the textures in this material asynchronously.
 
void fixup ()
 Re-calculates the material traits, and sets invalid material fields to valid values. More...
 
bool updateFadeInfo (double currentJD)
 Re-calculates time fade info, returns true if the object should be rendered.
 

Data Fields

struct S3DScene::Material::Traits traits
 
StelTextureSP tex_Kd
 
StelTextureSP tex_Ke
 
StelTextureSP tex_bump
 
StelTextureSP tex_height
 
bool bAlphatest
 
bool bBackface
 
float fAlphaThreshold
 
Vec2d vis_fadeIn
 
Vec2d vis_fadeOut
 
float vis_fadeValue
 Updated by S3DRenderer when necessary, otherwise always 1.0.
 
- Data Fields inherited from StelOBJ::Material
enum StelOBJ::Material::Illum illum
 
QString name
 Name of the material as defined in the .mtl, default empty.
 
QVector3D Ka
 Ambient coefficient. Contains all -1 if not set by .mtl.
 
QVector3D Kd
 Diffuse coefficient. Contains all -1 if not set by .mtl.
 
QVector3D Ks
 Specular coefficient. Contains all -1 if not set by .mtl.
 
QVector3D Ke
 Emissive coefficient. Contains all -1 if not set by .mtl.
 
float Ns
 Specular shininess (exponent), should be > 0. Default 8.0.
 
float d
 Alpha value (1 means opaque). More...
 
QString map_Ka
 The ambient texture map file path.
 
QString map_Kd
 The diffuse texture map file path.
 
QString map_Ks
 The specular texture map file path.
 
QString map_Ke
 The emissive texture map file path.
 
QString map_bump
 The bump/normal texture map file path.
 
QString map_height
 The height map texture file path.
 
ParamsMap additionalParams
 Contains all other material parameters that are not recognized by this class, but can still be accessed by class users this way. More...
 

Additional Inherited Members

- Public Types inherited from StelOBJ::Material
enum  Illum {
  I_NONE =-1, I_DIFFUSE =0, I_DIFFUSE_AND_AMBIENT =1, I_SPECULAR =2,
  I_TRANSLUCENT =9
}
 MTL Illumination models, see the developer doc for info. More...
 
typedef QMap< QString, QStringList > ParamsMap
 
- Static Public Member Functions inherited from StelOBJ::Material
static QVector< MaterialloadFromFile (const QString &filename)
 Loads all materials contained in an .mtl file. More...
 
- Static Protected Member Functions inherited from StelOBJ::Material
static bool parseBool (const QStringList &params, bool &out)
 Parses a bool from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More...
 
static bool parseFloat (const QStringList &params, float &out)
 Parses a float from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More...
 
static bool parseVec2d (const QStringList &params, Vec2d &out)
 Parses a Vec2d from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More...
 

Data Structure Documentation

struct S3DScene::Material::Traits
Data Fields
bool hasBumpTexture True when tex_Ke is a valid texture.
bool hasDiffuseTexture
bool hasEmissiveTexture True when tex_Kd is a valid texture.
bool hasHeightTexture True when tex_bump is a valid texture.
bool hasSpecularity True when tex_height is a valid texture.
bool hasTimeFade True when the material exhibits "true" transparency, that is when the tex_Kd has an alpha channel or the d value is smaller than 1.
bool hasTransparency True when both Ks and Ns are non-zero.
bool isFading True when the material is (currently) completely invisible.
bool isFullyTransparent True when the material has time-dependent display.

Member Function Documentation

void S3DScene::Material::fixup ( )

This requires all textures to be fully loaded.