|
| Specification () |
|
| Specification (const Any &any) |
|
Construct a UniversalMaterial::Specification from an Any, typically loaded by parsing a file. More...
|
|
| Specification (const Color4 &lambertian) |
|
AlphaFilter | alphaFilter () const |
|
uint8 | flags () const |
|
size_t | hashCode () const |
|
Any | inferAmbientOcclusionAtTransparentPixels () const |
|
void | load (const String &filename) |
| Load from a file created by save(). More...
|
|
bool | operator!= (const Specification &s) const |
|
bool | operator== (const Specification &s) const |
|
void | removeBump () |
|
void | removeEmissive () |
|
void | removeGlossy () |
|
void | removeLambertian () |
| Makes the surface opaque black. More...
|
|
void | removeTransmissive () |
|
const Sampler & | sampler () const |
|
void | setAlphaHint (const AlphaFilter &a) |
|
void | setBump (const String &filename, const BumpMap::Settings &settings=BumpMap::Settings(), float normalMapWhiteHeightInPixels=4.0f, bool invertPrecomputedNormalYAxis=false) |
| The image is assumed to be in linear (R) space. More...
|
|
void | setBump (const BumpMap::Specification &bump) |
|
void | setConstant (const String &name, float c) |
|
void | setConstant (const String &name, int c) |
|
void | setConstant (const String &name, bool c) |
|
void | setCustomShaderPrefix (const String &s) |
|
void | setEmissive (const Texture::Specification &spec) |
|
void | setEmissive (const shared_ptr< Texture > &tex) |
|
void | setEta (float etaTransmit, float etaReflect) |
| Set the index of refraction. More...
|
|
void | setExtinction (const Color3 &extinctionTransmit, const Color3 &extinctionReflect) |
|
void | setFlags (uint8 f) |
|
void | setGlossy (const Texture::Specification &spec) |
| Mirror reflection or glossy reflection. More...
|
|
void | setGlossy (const shared_ptr< Texture > &tex) |
|
void | setinferAmbientOcclusionAtTransparentPixels (Any b) |
| boolean or "auto" More...
|
|
void | setLambertian (const Texture::Specification &spec) |
| Filename of Lambertian ("diffuse") term, empty if none. More...
|
|
void | setLambertian (const shared_ptr< Texture > &tex) |
|
void | setLightMaps (const shared_ptr< Texture > &lightMap) |
| Sets the diffuse light map for this surface. More...
|
|
void | setLightMaps (const shared_ptr< Texture > lightMap[3]) |
| Sets the radiosity normal map for this material specification. More...
|
|
void | setLightMaps (const shared_ptr< UniversalMaterial > &otherMaterial) |
| Sets the radiosity normal map for this material specification from the other material. More...
|
|
void | setMirrorHint (MirrorQuality q) |
| Defaults to G3D::MirrorQuality::STATIC_PROBE. More...
|
|
void | setRefractionHint (RefractionHint q) |
| Defaults to G3D::RefractionHint::DYNAMIC_FLAT. More...
|
|
void | setSampler (const Sampler &sampler) |
|
void | setTransmissive (const Texture::Specification &spec) |
| This is an approximation of attenuation due to extinction while traveling through a translucent material. More...
|
|
void | setTransmissive (const shared_ptr< Texture > &tex) |
|
Any | toAny () const |
|
Specification of a material; used for loading.
Can be written to a file or constructed from a series of calls.
The following terminology for photon scattering is used in the G3D::UniversalMaterial::Specification and G3D::UniversalBSDF classes and their documentation:
G3D::UniversalMaterial::Specification::Specification |
( |
const Any & |
any | ) |
|
Construct a UniversalMaterial::Specification from an Any, typically loaded by parsing a file.
Some simple examples follow.
All fields as texture maps:
UniversalMaterial::Specification {
lambertian = "diffusemap.png";
glossy = "specmap.png";
transmissive = "transmap.png";
etaTransmit = 1.0;
extinctionTransmit =
Color3(1,1,1);
etaReflect = 1.0;
extinctionReflect =
Color3(1,1,1);
maxMipMap = 4;
};
constantTable = {
ANISO = 1;
HEIGHT = 3.7;
ITERATIONS = 1;
};
}
Diffuse yellow (any Color3 automatically coerces to a pure Lambertian surface):
Simple diffuse texture (any string coerces to a filename for the Lambertian texture):
Mirror:
UniversalMaterial::Specification {
}
Red plastic:
UniversalMaterial::Specification {
lambertian =
Color3(0.95, 0.2, 0.05);
}
Green glass:
UniversalMaterial::Specification {
lambertian =
Color3(0.01, 0.1, 0.05);
transmissive =
Color3(0.01, 0.9, 0.01);
}
Any component can be a Texture::Specification, Color3/Color4, or table of {texture = ...; constant = ...}
.
- See also
- G3D::RefractionHint,
-
G3D::MirrorQuality,
-
G3D::BumpMapSpecification
Mirror reflection or glossy reflection.
This actually specifies the term, which is the minimum reflectivity of the surface. At glancing angles it will increase towards white.
The alpha channel specifies the smoothness of the surface on [0, 1]. Smoother materials have sharp, bright highlights. Setting this to zero disables glossy reflection.
Filename of Lambertian ("diffuse") term, empty if none.
The alpha channel is a mask that will be applied to all maps for coverage. That is, alpha = 0 indicates holes in the surface. Alpha is for partial coverage. Do not use alpha for transparency; set transmissiveFilename instead.
The image file is assumed to be in the sRGB color space. The constant is multiplied in "linear" space, after sRGB->RGB conversion.