![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Class implementing Metallic-Roughness physically based material definition. More...
#include <Graphic3d_PBRMaterial.hxx>
Public Member Functions | |
| Graphic3d_PBRMaterial () | |
| Creates new physically based material in Metallic-Roughness system. 'metallic' parameter is 0 by default. 'roughness' parameter is 1 by default. 'color' parameter is (0, 0, 0) by default. 'alpha' parameter is 1 by default. 'IOR' parameter is 1.5 by default. 'emission' parameter is (0, 0, 0) by default. | |
| Graphic3d_PBRMaterial (const Graphic3d_BSDF &theBSDF) | |
| Creates new physically based material in Metallic-Roughness system from Graphic3d_BSDF. | |
| float | Metallic () const |
| Returns material's metallic coefficient in [0, 1] range. 1 for metals and 0 for dielectrics. It is preferable to be exactly 0 or 1. Average values are needed for textures mixing in shader. | |
| void | SetMetallic (float theMetallic) |
| Modifies metallic coefficient of material in [0, 1] range. | |
| float | Roughness () const |
| Returns real value of roughness in [MinRoughness, 1] range for calculations. | |
| float | NormalizedRoughness () const |
| Returns roughness mapping parameter in [0, 1] range. Roughness is defined in [0, 1] for handful material settings and is mapped to [MinRoughness, 1] for calculations. | |
| void | SetRoughness (float theRoughness) |
| Modifies roughness coefficient of material in [0, 1] range. | |
| float | IOR () const |
| Returns index of refraction in [1, 3] range. | |
| void | SetIOR (float theIOR) |
| Modifies index of refraction in [1, 3] range. In practice affects only on non-metal materials reflection possibilities. | |
| const Quantity_ColorRGBA & | Color () const |
| Returns albedo color with alpha component of material. | |
| void | SetColor (const Quantity_ColorRGBA &theColor) |
| Modifies albedo color with alpha component. | |
| void | SetColor (const Quantity_Color &theColor) |
| Modifies only albedo color. | |
| float | Alpha () const |
| Returns alpha component in range [0, 1]. | |
| void | SetAlpha (float theAlpha) |
| Modifies alpha component. | |
| NCollection_Vec3< float > | Emission () const |
| Returns light intensity emitted by material. Values are greater or equal 0. | |
| void | SetEmission (const NCollection_Vec3< float > &theEmission) |
| Modifies light intensity emitted by material. | |
| void | SetBSDF (const Graphic3d_BSDF &theBSDF) |
| Generates material in Metallic-Roughness system from Graphic3d_BSDF. | |
| bool | operator== (const Graphic3d_PBRMaterial &theOther) const |
| PBR materials comparison operator. | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const |
| Dumps the content of me into the stream. | |
Static Public Member Functions | |
| static float | Roughness (float theNormalizedRoughness) |
| Maps roughness from [0, 1] to [MinRoughness, 1] for calculations. | |
| static void | GenerateEnvLUT (const occ::handle< Image_PixMap > &theLUT, unsigned int theNbIntegralSamples=1024) |
| Generates 2D look up table of scale and bias for fresnell zero coefficient. It is needed for calculation reflectance part of environment lighting. | |
| static float | RoughnessFromSpecular (const Quantity_Color &theSpecular, const double theShiness) |
| Compute material roughness from common material (specular color + shininess). | |
| static float | MetallicFromSpecular (const Quantity_Color &theSpecular) |
| Compute material metallicity from common material (specular color). | |
| static float | MinRoughness () |
| Roughness cannot be 0 in real calculations, so it returns minimal achievable level of roughness in practice. | |
| static float | SpecIBLMapSamplesFactor (float theProbability, float theRoughness) |
| Shows how much times less samples can be used in certain roughness value specular IBL map generation in compare with samples number for map with roughness of 1. Specular IBL maps with less roughness values have higher resolution but require less samples for the same quality of baking. So that reducing samples number is good strategy to improve performance of baking. The samples number for specular IBL map with roughness of 1 (the maximum possible samples number) is expected to be defined as baking parameter. Samples number for other roughness values can be calculated by multiplication origin samples number by this factor. | |
Class implementing Metallic-Roughness physically based material definition.
| Graphic3d_PBRMaterial::Graphic3d_PBRMaterial | ( | ) |
Creates new physically based material in Metallic-Roughness system. 'metallic' parameter is 0 by default. 'roughness' parameter is 1 by default. 'color' parameter is (0, 0, 0) by default. 'alpha' parameter is 1 by default. 'IOR' parameter is 1.5 by default. 'emission' parameter is (0, 0, 0) by default.
| Graphic3d_PBRMaterial::Graphic3d_PBRMaterial | ( | const Graphic3d_BSDF & | theBSDF | ) |
Creates new physically based material in Metallic-Roughness system from Graphic3d_BSDF.
|
inline |
Returns alpha component in range [0, 1].
|
inline |
Returns albedo color with alpha component of material.
| void Graphic3d_PBRMaterial::DumpJson | ( | Standard_OStream & | theOStream, |
| int | theDepth = -1 ) const |
Dumps the content of me into the stream.
|
inline |
Returns light intensity emitted by material. Values are greater or equal 0.
|
static |
Generates 2D look up table of scale and bias for fresnell zero coefficient. It is needed for calculation reflectance part of environment lighting.
| [out] | theLUT | table storage (must be Image_Format_RGF). |
| [in] | theNbIntegralSamples | number of importance samples in hemisphere integral calculation for every table item. |
|
inline |
Returns index of refraction in [1, 3] range.
|
inline |
Returns material's metallic coefficient in [0, 1] range. 1 for metals and 0 for dielectrics. It is preferable to be exactly 0 or 1. Average values are needed for textures mixing in shader.
|
inlinestatic |
Compute material metallicity from common material (specular color).
| [in] | theSpecular | specular color |
Roughness cannot be 0 in real calculations, so it returns minimal achievable level of roughness in practice.
|
inline |
Returns roughness mapping parameter in [0, 1] range. Roughness is defined in [0, 1] for handful material settings and is mapped to [MinRoughness, 1] for calculations.
|
inline |
PBR materials comparison operator.
|
inline |
Returns real value of roughness in [MinRoughness, 1] range for calculations.
Maps roughness from [0, 1] to [MinRoughness, 1] for calculations.
|
static |
Compute material roughness from common material (specular color + shininess).
| [in] | theSpecular | specular color |
| [in] | theShiness | normalized shininess coefficient within [0..1] range |
| void Graphic3d_PBRMaterial::SetBSDF | ( | const Graphic3d_BSDF & | theBSDF | ) |
Generates material in Metallic-Roughness system from Graphic3d_BSDF.
| void Graphic3d_PBRMaterial::SetColor | ( | const Quantity_Color & | theColor | ) |
Modifies only albedo color.
| void Graphic3d_PBRMaterial::SetColor | ( | const Quantity_ColorRGBA & | theColor | ) |
Modifies albedo color with alpha component.
| void Graphic3d_PBRMaterial::SetEmission | ( | const NCollection_Vec3< float > & | theEmission | ) |
Modifies light intensity emitted by material.
Modifies index of refraction in [1, 3] range. In practice affects only on non-metal materials reflection possibilities.
Modifies metallic coefficient of material in [0, 1] range.
Modifies roughness coefficient of material in [0, 1] range.
|
static |
Shows how much times less samples can be used in certain roughness value specular IBL map generation in compare with samples number for map with roughness of 1. Specular IBL maps with less roughness values have higher resolution but require less samples for the same quality of baking. So that reducing samples number is good strategy to improve performance of baking. The samples number for specular IBL map with roughness of 1 (the maximum possible samples number) is expected to be defined as baking parameter. Samples number for other roughness values can be calculated by multiplication origin samples number by this factor.
| theProbability | value from 0 to 1 controlling strength of samples reducing. Bigger values result in slower reduction to provide better quality but worse performance. Value of 1 doesn't affect at all so that 1 will be returned (it can be used to disable reduction strategy). |
| theRoughness | roughness value of current generated specular IBL map (from 0 to 1). |