#include <lib_hair.h>
Contains information about hair materials. Cannot be allocated.
Public Member Functions | |
Int32 | GetCount () |
Int32 | GetGuideMaterial (Int32 i, Int32 prev=NOTOK) |
BaseTag * | GetMaterialTag (Int32 i) |
Bool | ApplyMaterial (Int32 i, HairGuides *guides, VolumeData *vd=nullptr, Int32 vindex=0) |
Bool | ApplyMaterials (HairGuides *guides, VolumeData *vd=nullptr, Int32 vindex=0) |
Float | GetThickness (Int32 guide, Float t, Int32 i=NOTOK) |
Vector | GetColor (Int32 guide, Float t, const Vector &r, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Int32 i=NOTOK) |
Vector | GetBackColor (Int32 guide, Float t, const Vector &col, const Vector &r, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Int32 i=NOTOK) |
Bool | GetSpecularColor (Int32 guide, Float t, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Vector &speccol, Vector &ispeccol) |
Float | GetTransparency (Int32 guide, Float t, const Vector &p, const Vector &n, VolumeData *vd, Int32 i=NOTOK) |
Bool | GetTagSelection (Int32 i, BaseSelect *bs) |
Bool | GetMaterialData (Int32 guide, Float &shadows, Float &selfshadows, Float &backshadows, Float &transparency, Float &diffuse, Float &reflect, Float &transmit, Bool &roughenable, Float &roughvar, Float &roughness, Bool &specularenable, Float &specular, Float &specularpower, Float &specularback, Bool &ispecularenable, Bool &ispecularshader, Float &ispecular, Float &ispecularpower, Float &ispecularmix, Float &ispecularblend) |
Bool | GetGIData (Int32 guide, Bool &receive, Float &strength) |
Bool | AdjustHUV (Int32 guide, Vector &huv, Float tline) |
Private Member Functions | |
HairMaterialData () | |
~HairMaterialData () | |
|
private |
|
private |
Int32 GetCount | ( | ) |
Gets the number of hair material tags.
Gets the material index for the specified hair index i, optionally looking for more materials by specifying prev.
[in] | i | The hair index. |
[in] | prev | The index of the previous material of the hair. |
Gets the material tag corresponding to the specified hair index i.
[in] | i | The hair index. |
Bool ApplyMaterial | ( | Int32 | i, |
HairGuides * | guides, | ||
VolumeData * | vd = nullptr , |
||
Int32 | vindex = 0 |
||
) |
Applies a single material to the specified hair index i.
[in] | i | The hair index. |
[in] | guides | The hair guide data. |
[in] | vd | The optional volume data. |
[in] | vindex | The material index. |
Bool ApplyMaterials | ( | HairGuides * | guides, |
VolumeData * | vd = nullptr , |
||
Int32 | vindex = 0 |
||
) |
Applies a material to all hairs.
[in] | guides | The hair guide data. |
[in] | vd | The optional volume data. |
[in] | vindex | The material index. |
Gets the thickness at position t along the specified guide.
[in] | guide | The guide/hair index. |
[in] | t | The position along guide/hair: 0 <= t <= 1 |
[in] | i | Pass NOTOK to use all materials, or a specific material index. |
Vector GetColor | ( | Int32 | guide, |
Float | t, | ||
const Vector & | r, | ||
const Vector & | wp, | ||
const Vector & | p, | ||
const Vector & | n, | ||
VolumeData * | vd, | ||
const RayHitID & | plyid, | ||
Int32 | i = NOTOK |
||
) |
Gets the color at position t along the specified guide.
[in] | guide | The guide/hair index. |
[in] | t | The position along guide/hair: 0 <= t <= 1 |
[in] | r | The root world coordinate. |
[in] | wp | The world coordinate of the sampling point. |
[in] | p | The UV coordinate. |
[in] | n | The surface normal at the root. |
[in] | vd | The volume data. Can be nullptr. |
[in] | plyid | The global RayHitID for the root. |
[in] | i | Pass NOTOK to use all materials, or a specific material index. |
Vector GetBackColor | ( | Int32 | guide, |
Float | t, | ||
const Vector & | col, | ||
const Vector & | r, | ||
const Vector & | wp, | ||
const Vector & | p, | ||
const Vector & | n, | ||
VolumeData * | vd, | ||
const RayHitID & | plyid, | ||
Int32 | i = NOTOK |
||
) |
Gets the back color at position t along the specified guide.
[in] | guide | The guide/hair index. |
[in] | t | The position along guide/hair: 0 <= t <= 1 |
[in] | col | The color. |
[in] | r | The root world coordinate. |
[in] | wp | The world coordinate of the sampling point. |
[in] | p | The UV coordinate. |
[in] | n | The surface normal at the root. |
[in] | vd | The volume data. Can be nullptr. |
[in] | plyid | The global RayHitID for the root. |
[in] | i | Pass NOTOK to use all materials, or a specific material index. |
Bool GetSpecularColor | ( | Int32 | guide, |
Float | t, | ||
const Vector & | wp, | ||
const Vector & | p, | ||
const Vector & | n, | ||
VolumeData * | vd, | ||
const RayHitID & | plyid, | ||
Vector & | speccol, | ||
Vector & | ispeccol | ||
) |
Gets the specular color at position t along the specified guide.
[in] | guide | The guide/hair index. |
[in] | t | The position along guide/hair: 0 <= t <= 1 |
[in] | wp | The world coordinate of the sampling point. |
[in] | p | The UV coordinate. |
[in] | n | The surface normal at the root. |
[in] | vd | The volume data. Can be nullptr. |
[in] | plyid | The global RayHitID for the root. |
[out] | speccol | Assigned the primary specular color. |
[out] | ispeccol | Assigned the secondary specular color. |
Float GetTransparency | ( | Int32 | guide, |
Float | t, | ||
const Vector & | p, | ||
const Vector & | n, | ||
VolumeData * | vd, | ||
Int32 | i = NOTOK |
||
) |
Gets the transparency at position t along the specified guide.
[in] | guide | The guide/hair index. |
[in] | t | The position along guide/hair: 0 <= t <= 1 |
[in] | p | The UV coordinate. |
[in] | n | The surface normal at the root. |
[in] | vd | The volume data. Can be nullptr. |
[in] | i | Pass NOTOK to use all materials, or a specific material index. |
Bool GetTagSelection | ( | Int32 | i, |
BaseSelect * | bs | ||
) |
Finds out which guides the specified material index i is applied to.
[in] | i | The material index. |
[out] | bs | Filled with the guide indices the material is applied to. |
Bool GetMaterialData | ( | Int32 | guide, |
Float & | shadows, | ||
Float & | selfshadows, | ||
Float & | backshadows, | ||
Float & | transparency, | ||
Float & | diffuse, | ||
Float & | reflect, | ||
Float & | transmit, | ||
Bool & | roughenable, | ||
Float & | roughvar, | ||
Float & | roughness, | ||
Bool & | specularenable, | ||
Float & | specular, | ||
Float & | specularpower, | ||
Float & | specularback, | ||
Bool & | ispecularenable, | ||
Bool & | ispecularshader, | ||
Float & | ispecular, | ||
Float & | ispecularpower, | ||
Float & | ispecularmix, | ||
Float & | ispecularblend | ||
) |
Gets the settings of the hair material.
[in] | guide | The guide/hair index. |
[out] | shadows | Assigned the shadows strength. |
[out] | selfshadows | Assigned the self shadows strength. |
[out] | backshadows | Assigned the back shadows strength. |
[out] | transparency | Assigned the transparency strength. |
[out] | diffuse | Assigned the diffuse value. |
[out] | reflect | Assigned the reflectiveness strength. |
[out] | transmit | Assigned the translucence strength. |
[out] | roughenable | Assigned roughness on/off state. |
[out] | roughvar | Assigned the roughness variation strength. |
[out] | roughness | Assigned the roughness strength. |
[out] | specularenable | Assigned the primary specular on/off state. |
[out] | specular | Assigned the primary specular strength. |
[out] | specularpower | Assigned the primary specular sharpness strength. |
[out] | specularback | Assigned the back specular strength. |
[out] | ispecularenable | Assigned the secondary specular on/off state. |
[out] | ispecularshader | Assigned the secondary specular shader on/off state. |
[out] | ispecular | Assigned the secondary specular strength. |
[out] | ispecularpower | Assigned the secondary specular sharpness strength. |
[out] | ispecularmix | Assigned the secondary specular mix strength. |
[out] | ispecularblend | Assigned the secondary specular blend strength. |
Gets the Global Illumination (GI) settings of the hair material.
[in] | guide | The guide/hair index. |
[out] | receive | Assigned the receive GI on/off state. |
[out] | strength | Assigned the receive GI strength. |
Gets the hair UVs for a specified Hair guide and position along the guide.
[in] | guide | The guide/hair index. |
[out] | huv | Assigned the Hair UV coordinates. |
[in] | tline | The position along the hair: 0 <= tline <= 1. |