|
virtual const WStringVector & | getBlindDataKeys () const =0 |
|
virtual ShaderPtr | getShader () const =0 |
|
virtual TexturePtr | getTexture (const std::wstring &key) const =0 |
|
virtual const TexturePtrVector & | getTextureArray (const std::wstring &key) const =0 |
|
virtual TexturePtr | getTextureArrayItem (const std::wstring &key, size_t index) const =0 |
|
|
virtual const WStringVector & | getKeys () const =0 |
|
virtual bool | hasKey (const std::wstring &key) const =0 |
|
virtual PrimitiveType | getType (const std::wstring &key) const =0 |
|
virtual Bool | getBool (const std::wstring &key) const =0 |
|
virtual int32_t | getInt (const std::wstring &key) const =0 |
|
virtual double | getFloat (const std::wstring &key) const =0 |
|
virtual const std::wstring & | getString (const std::wstring &key) const =0 |
|
virtual const BoolVector & | getBoolArray (const std::wstring &key) const =0 |
|
virtual const Int32Vector & | getIntArray (const std::wstring &key) const =0 |
|
virtual const DoubleVector & | getFloatArray (const std::wstring &key) const =0 |
|
virtual const WStringVector & | getStringArray (const std::wstring &key) const =0 |
|
virtual void * | getBlindData (const std::wstring &key) const =0 |
|
virtual bool | compare (const ComparableContent &rhs) const =0 |
|
virtual bool | operator!= (const ComparableContent &rhs) const =0 |
|
virtual bool | operator< (const ComparableContent &rhs) const =0 |
|
virtual bool | operator== (const ComparableContent &rhs) const =0 |
|
| Content (const Content &)=delete |
|
Content & | operator= (const Content &)=delete |
|
virtual double | ambient_b () const =0 |
|
virtual double | ambient_g () const =0 |
|
virtual double | ambient_r () const =0 |
|
virtual const std::vector< double > & | ambientColor () const =0 |
|
virtual const std::wstring & | bumpmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | bumpMap () const =0 |
|
virtual double | bumpmap_rw () const =0 |
|
virtual double | bumpmap_su () const =0 |
|
virtual double | bumpmap_sv () const =0 |
|
virtual double | bumpmap_tu () const =0 |
|
virtual double | bumpmap_tv () const =0 |
|
virtual double | bumpValue () const =0 |
|
virtual double | color_b () const =0 |
|
virtual double | color_g () const =0 |
|
virtual double | color_r () const =0 |
|
virtual const std::wstring & | colormap () const =0 |
|
virtual double | colormap_rw () const =0 |
|
virtual double | colormap_su () const =0 |
|
virtual double | colormap_sv () const =0 |
|
virtual double | colormap_tu () const =0 |
|
virtual double | colormap_tv () const =0 |
|
virtual const std::vector< double > & | diffuseColor () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | diffuseMap () const =0 |
|
virtual const std::wstring & | dirtmap () const =0 |
|
virtual double | dirtmap_rw () const =0 |
|
virtual double | dirtmap_su () const =0 |
|
virtual double | dirtmap_sv () const =0 |
|
virtual double | dirtmap_tu () const =0 |
|
virtual double | dirtmap_tv () const =0 |
|
virtual bool | doubleSided () const =0 |
|
virtual double | emissive_b () const =0 |
|
virtual double | emissive_g () const =0 |
|
virtual double | emissive_r () const =0 |
|
virtual const std::vector< double > & | emissiveColor () const =0 |
|
virtual const std::wstring & | emissivemap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | emissiveMap () const =0 |
|
virtual double | emissivemap_rw () const =0 |
|
virtual double | emissivemap_su () const =0 |
|
virtual double | emissivemap_sv () const =0 |
|
virtual double | emissivemap_tu () const =0 |
|
virtual double | emissivemap_tv () const =0 |
|
virtual double | metallic () const =0 |
|
virtual const std::wstring & | metallicmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | metallicMap () const =0 |
|
virtual double | metallicmap_rw () const =0 |
|
virtual double | metallicmap_su () const =0 |
|
virtual double | metallicmap_sv () const =0 |
|
virtual double | metallicmap_tu () const =0 |
|
virtual double | metallicmap_tv () const =0 |
|
virtual const std::wstring & | name () const =0 |
|
virtual const std::wstring & | normalmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | normalMap () const =0 |
|
virtual double | normalmap_rw () const =0 |
|
virtual double | normalmap_su () const =0 |
|
virtual double | normalmap_sv () const =0 |
|
virtual double | normalmap_tu () const =0 |
|
virtual double | normalmap_tv () const =0 |
|
virtual const std::wstring & | occlusionmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | occlusionMap () const =0 |
|
virtual double | occlusionmap_rw () const =0 |
|
virtual double | occlusionmap_su () const =0 |
|
virtual double | occlusionmap_sv () const =0 |
|
virtual double | occlusionmap_tu () const =0 |
|
virtual double | occlusionmap_tv () const =0 |
|
virtual double | opacity () const =0 |
|
virtual const std::wstring & | opacitymap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | opacityMap () const =0 |
|
virtual double | opacitymap_cutoff () const =0 |
|
virtual const std::wstring & | opacitymap_mode () const =0 |
|
virtual double | opacitymap_rw () const =0 |
|
virtual double | opacitymap_su () const =0 |
|
virtual double | opacitymap_sv () const =0 |
|
virtual double | opacitymap_tu () const =0 |
|
virtual double | opacitymap_tv () const =0 |
|
virtual double | reflectivity () const =0 |
|
virtual double | roughness () const =0 |
|
virtual const std::wstring & | roughnessmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | roughnessMap () const =0 |
|
virtual double | roughnessmap_rw () const =0 |
|
virtual double | roughnessmap_su () const =0 |
|
virtual double | roughnessmap_sv () const =0 |
|
virtual double | roughnessmap_tu () const =0 |
|
virtual double | roughnessmap_tv () const =0 |
|
virtual const std::wstring & | shader () const =0 |
|
virtual double | shininess () const =0 |
|
virtual double | specular_b () const =0 |
|
virtual double | specular_g () const =0 |
|
virtual double | specular_r () const =0 |
|
virtual const std::vector< double > & | specularColor () const =0 |
|
virtual const std::wstring & | specularmap () const =0 |
|
virtual const std::vector< prtx::TexturePtr > & | specularMap () const =0 |
|
virtual double | specularmap_rw () const =0 |
|
virtual double | specularmap_su () const =0 |
|
virtual double | specularmap_sv () const =0 |
|
virtual double | specularmap_tu () const =0 |
|
virtual double | specularmap_tv () const =0 |
|
|
static constexpr PrimitiveType | PT_COUNT = prtx::Attributable::PT_COUNT + 2 |
|
static constexpr PrimitiveType | PT_TEXTURE = PT_BLIND_DATA_ARRAY + 1 |
|
static constexpr PrimitiveType | PT_TEXTURE_ARRAY = PT_TEXTURE + 1 |
|
static constexpr PrimitiveType | PT_BLIND_DATA = prt::Attributable::PT_BLIND_DATA |
|
static constexpr PrimitiveType | PT_BLIND_DATA_ARRAY = prt::Attributable::PT_BLIND_DATA_ARRAY |
|
static constexpr PrimitiveType | PT_BOOL = prt::Attributable::PT_BOOL |
|
static constexpr PrimitiveType | PT_BOOL_ARRAY = prt::Attributable::PT_BOOL_ARRAY |
|
static constexpr PrimitiveType | PT_COUNT = prt::Attributable::PT_COUNT |
|
static constexpr PrimitiveType | PT_FLOAT = prt::Attributable::PT_FLOAT |
|
static constexpr PrimitiveType | PT_FLOAT_ARRAY = prt::Attributable::PT_FLOAT_ARRAY |
|
static constexpr PrimitiveType | PT_INT = prt::Attributable::PT_INT |
|
static constexpr PrimitiveType | PT_INT_ARRAY = prt::Attributable::PT_INT_ARRAY |
|
static constexpr PrimitiveType | PT_STRING = prt::Attributable::PT_STRING |
|
static constexpr PrimitiveType | PT_STRING_ARRAY = prt::Attributable::PT_STRING_ARRAY |
|
static constexpr PrimitiveType | PT_UNDEFINED = prt::Attributable::PT_UNDEFINED |
|
The read-only Material class stores values for the keys defined by CGA material shape attributes on the one hand and by the attached Shader on the other. The values can be accessed via the Attributable interface or via the BuiltinMaterialAttributes interface. While the former is a generic standard interface, the later is a set of named functions and significantly faster in most cases. For example, getting the red color component can be done in a few ways:
CGA code: material.color.r
Attributable interface: mat.getFloat("color.r")
BuiltinMaterialAttributes: mat.color_r()
mat.diffuseColor()[0]
The Attributable interface is extended with getters for the Texture type.
Colors (i.e. rgb tuples) are in (non-linear) sRGB space, as well as the matching rgb textures. See also below.
Below is a list of all supported keys. Please note that the two key sets are two different views on the same values. The CGA keys correspond 1:1 to the material attributes in CGA while the shader keys are designed for ease of use in conjunction with he typical formats encountered in decoder/encoder programming.
Valid keys:
- CGA, float type:
- ambient.b
- ambient.g
- ambient.r
- bumpValue
- bumpmap.rw
- bumpmap.su
- bumpmap.sv
- bumpmap.tu
- bumpmap.tv
- color.a
- color.b
- color.g
- color.r
- colormap.rw
- colormap.su
- colormap.sv
- colormap.tu
- colormap.tv
- dirtmap.rw
- dirtmap.su
- dirtmap.sv
- dirtmap.tu
- dirtmap.tv
- emissive.b
- emissive.g
- emissive.r
- emissivemap.rw
- emissivemap.su
- emissivemap.sv
- emissivemap.tu
- emissivemap.tv
- metallic
- metallicmap.rw
- metallicmap.su
- metallicmap.sv
- metallicmap.tu
- metallicmap.tv
- normalmap.rw
- normalmap.su
- normalmap.sv
- normalmap.tu
- normalmap.tv
- occlusionmap.rw
- occlusionmap.su
- occlusionmap.sv
- occlusionmap.tu
- occlusionmap.tv
- opacity
- opacitymap.cutoff
- opacitymap.rw
- opacitymap.su
- opacitymap.sv
- opacitymap.tu
- opacitymap.tv
- reflectivity
- roughness
- roughnessmap.rw
- roughnessmap.su
- roughnessmap.sv
- roughnessmap.tu
- roughnessmap.tv
- shininess
- specular.b
- specular.g
- specular.r
- specularmap.rw
- specularmap.su
- specularmap.sv
- specularmap.tu
- specularmap.tv
- CGA, bool type:
- CGA, string type:
- bumpmap
- colormap
- dirtmap
- emissivemap
- metallicmap
- name
- normalmap
- occlusionmap
- opacitymap
- opacitymap.mode
- roughnessmap
- shader
- specularmap
- Default shader, float type:
- bumpValue (identical to CGA key: bumpValue)
- metallic (identical to CGA key: metallic)
- opacity (identical to CGA key: opacity)
- reflectivity (identical to CGA key: reflectivity)
- roughness (identical to CGA key: roughness)
- shininess (identical to CGA key: shininess)
- opacityMap.cutoff (identical to CGA key: opacitymap.cutoff)
- Default shader, boolean type:
- doubleSided (identical to CGA key: doubleSided)
- Default shader, string type:
- name (identical to CGA key: name)
- opacityMap.mode (identical to CGA key: opacity.mode)
- Default shader, float array type:
- ambientColor (identical to CGA keys: { ambient.r, ambient.g, ambient.b } )
- bumpmapTrafo (identical to CGA keys: { bumpmap.su, bumpmap.sv, bumpmap.tu, bumpmap.tv, bumpmap.rw } )
- colormapTrafo (identical to CGA keys: { colormap.su, colormap.sv, colormap.tu, colormap.tv, colormap.rw } )
- diffuseColor (identical to CGA keys: { color.r, color.g, color.b } )
- dirtmapTrafo (identical to CGA keys: { dirtmap.su, dirtmap.sv, dirtmap.tu, dirtmap.tv, dirtmap.rw } )
- emissiveColor (identical to CGA keys: { emissive.r, emissive.g, emissive.b } )
- emissivemapTrafo (identical to CGA keys: { emissivemap.su, emissivemap.sv, emissivemap.tu, emissivemap.tv, emissivemap.rw } )
- metallicmapTrafo (identical to CGA keys: { metallicmap.su, metallicmap.sv, metallicmap.tu, metallicmap.tv, metallicmap.rw } )
- normalmapTrafo (identical to CGA keys: { normalmap.su, normalmap.sv, normalmap.tu, normalmap.tv, normalmap.rw } )
- occlusionmapTrafo (identical to CGA keys: { occlusionmap.su, occlusionmap.sv, occlusionmap.tu, occlusionmap.tv, occlusionmap.rw } )
- opacitymapTrafo (identical to CGA keys: { opacitymap.su, opacitymap.sv, opacitymap.tu, opacitymap.tv, opacitymap.rw } )
- roughnessmapTrafo (identical to CGA keys: { roughnessmap.su, roughnessmap.sv, roughnessmap.tu, roughnessmap.tv, roughnessmap.rw } )
- specularColor (identical to CGA keys: { specular.r, specular.g, specular.b } )
- specularmapTrafo (identical to CGA keys: { specularmap.su, specularmap.sv, specularmap.tu, specularmap.tv, specularmap.rw } )
- Default shader, Texture or Texture array type:
- bumpMap Texture linear (identical to CGA key: { resolved bumpmap } )
- diffuseMap Texture array non-linear sRGB (identical to CGA keys: { resolved colormap, resolved dirtmap } )
- emissiveMap Texture non-linear sRGB (identical to CGA key: { resolved emissivemap } )
- metallicMap Texture linear (identical to CGA key: { resolved metallicmap } )
- normalMap Texture linear (identical to CGA key: { resolved normalmap } )
- occlusionMap Texture linear (identical to CGA key: { resolved occlusionmap } )
- opacityMap Texture linear (identical to CGA key: { resolved opacitymap } )
- roughnessMap Texture linear (identical to CGA key: { resolved roughnessmap } )
- specularMap Texture non-linear sRGB (identical to CGA key: { resolved specularmap } )
- See also
- CGA material shape attributes, MaterialBuilder