Accessing Hair Rendering Information 

 

Rendering Information 

When rendering Ornatrix hair extra information such as it's thickness at various points is required. Ornatrix SDK contains a set of interfaces designed to bring you this additional information.

 

IHairRenderingPropertiesContainer 

IHairRenderingPropertiesContainer is an interface (found in IHairRenderingPropertiesContainer.h) which provides rendering properties for a hair object per-group. Because a hair object can have strands in different groups (for example, if propagation modifier is used "stem" strands can be on group 0 while "branch" strands can be in group "1") it is important to access these properties by their group.

To access this interface use:

auto props = static_cast<IHairRenderingPropertiesContainer*>( hairObject->GetInterface( IHairRenderingPropertiesContainerInterfaceID ) );

You can then use HairRenderingProperties(...) method to access rendering properties on per-group level. If an invalid index (or default parameter) is passed you will get the default render properties (applicable to all groups).

 

IHairRenderingProperties 

Each IHairRenderingProperties interface allows you to access render properties of hair strands such as thickness of strands. To get the final width for a strand you need to pre-multiply the global width value with value extracted from Texmap, and value extracted from ICurve along the strand length.

Missing Something? Let us know if this page needs more information about the topic.