Description This subroutine sets the scatter ancestry level criteria from an importance sample on a surface.
Syntax ImpSampSetScatterLevel (sNode, iSamp, criteria, scatLevel )
Parameters sNode As Long Node number of the surface whose importance sample is being modified.
iSamp As Long Index (0-based) into the importance sample list of the surface. The scatter ancestry level criteria will be modified for the importance sample at this index.
criteria As String This variable contains the string form of the scatter ancestry level criteria being assigned to the importance sample. Possible values are: "greater than" "less than" "equal to" If scatter rays should always be allowed by the importance sample, the criteria string should be "greater than" and the scatLevel value should be 0. This specification is consistent with the behavior in FRED prior to version 16.41.
scatLevel As Long This variable contains the scatter ancestry level being assigned to the importance sample. In order for scatter rays to be generated at this surface, the generated rays must meet the requirement designated by the combination of the criteria variable and the scatLevel variable.
Examples The example below retrieves the scatter level ancestry criteria from the importance sample at index 1 of the specified surface, prints the current information, increments the scatter ancestry level by one and then assigns the modified criteria back to the importance sample.
Sub Main
Dim sNode As Long, iSamp As Long, scatLevel As Long Dim criteria As String
sNode = FindFullName( "Geometry.Primary.reflecting" ) iSamp = 1
ImpSampGetScatterLevel( sNode, iSamp, criteria, scatLevel ) Print "Surface: " & GetFullName( sNode ) Print "Imp. Samp: " & ImpSampGetName( sNode, iSamp ) Print "Criteria: " & criteria Print "Scat. Level: " & scatLevel scatLevel = scatLevel + 1 ImpSampSetScatterLevel( sNode, iSamp, criteria, scatLevel ) Update
End Sub
See Also
|