Description This function queries an importance sample specification of a surface for the type of directional sampling being used. Return values are either “uniform” or “montecarlo”.
Syntax dirType = ImpSampGetDirectionSampleType( sNode, iSamp )
Parameters dirType (String) Return value indicating the type of directional sampling being used. Options are: uniform – indicates that the subtended angular range of the importance sample is uniformly sampled by scattered rays with fluxes proportional to the BSDF function. montecarlo – indicates that the subtended angular range of the importance sample is non-uniformly sampled, with ray densities proportional to the BSDF function, but the rays have equal flux weighting.
sNode As Long Node number of the surface whose importance sample is being queried.
iSamp As Long Index (0-based) of the importance sample on sNode whose direction sample type specification is being retrieved.
Example The script below loops over all surfaces in a model and for each surface that has at least one importance sample specification, the name and direction sampling type is reported to the output window.
Sub Main
Dim curEnt As Long, iSamp As Long, iCount As Long For curEnt = 0 To GetEntityCount()-1 If IsSurface( curEnt ) Then iCount = ImpSampGetCount( curEnt ) If iCount > 0 Then
'For the surface, report the direction sampling mode for each importance sample Print GetFullName( curEnt ) For iSamp = 0 To iCount-1 Print Chr(9) & ImpSampGetName( curEnt, iSamp ) & Chr(9) & ImpSampGetDirectionSampleType( curEnt, iSamp ) Next
End If End If Next
End Sub
See Also Importance Samples Script Commands
|