Navigation: Scripting Reference Manual > Data Structures > T_SCATTERSCRIPTEX

 

T_SCATTERSCRIPTEX

 

Contact Us: fredsupport@photonengr.com

 

Description

This data structure is used to specify scattering in the Extended Scripted scatter model.  Please see the Extended Scripted scatter model help page for a description of its use.

 

Definition

Type T_SCATTERSCRIPTEX

g_Ainc_i_p As Double

g_Ainc_i_s As Double

g_Ainc_r_p As Double

g_Ainc_r_s As Double

g_Ascat_i_p As Double

g_Ascat_i_s As Double

g_Ascat_r_p As Double

g_Ascat_i_s As Double

g_BSDF As Double

g_frac As Double

g_K0 As Double

g_K1 As Double

g_N0 As Double

g_N1 As Double

g_numA As Long

g_numB As Long

g_ran0 As Double

g_ran1 As Double

g_ran2 As Double

g_ran3 As Double

g_TISrequest As Boolean

g_w As Double

g_Xinc As Double

g_Xinc_s As Double

g_Xnrml As Double

g_Xpos As Double

g_Xscat As Double

g_Xscat_s As Double

g_Xspec As Double

g_Xspec_s As Double

g_Yinc As Double

g_Yinc_s As Double

g_Ynrml As Double

g_Ypos As Double

g_Yscat As Double

g_Yscat_s As Double

g_Yspec As Double

g_Yspec_s As Double

g_Zinc As Double

g_Zinc_s As Double

g_Znrml As Double

g_Zpos As Double

g_Zscat As Double

g_Zscat_s As Double

g_Zspec As Double

g_Zspec_s As Double

 

Members

g_Ainc_i_p As Double

Input value that specifies the imaginary component of the incident ray along the axis defining the p-polarization state.  Value cannot be changed.

 

g_Ainc_i_s As Double

Input value that specifies the imaginary component of the incident ray along the axis defining the s-polarization state.  Value cannot be changed.

 

g_Ainc_r_p As Double

Input value that specifies the real component of the incident ray along the axis defining the p-polarization state.  Value cannot be changed.

 

g_Ainc_r_s As Double

Input value that specifies the real component of the incident ray along the axis defining the s-polarization state.  Value cannot be changed.

 

g_Ascat_i_p As Double

Input value that specifies the imaginary component of the scattered ray along the axis defining the p-polarization state.  If Ascat_i_p2 + Ascat_r_p2 = 0 and Ascat_i_s2 + Ascat_r_s2 = 0, then the scattered ray is not polarized.  If As and Ap are not normalized, the power of the ray will be scaled.

 

g_Ascat_i_s As Double

Input value that specifies the imaginary component of the scattered ray along the axis defining the s-polarization state.  If Ascat_i_p2 + Ascat_r_p2 = 0 and Ascat_i_s2 + Ascat_r_s2 = 0, then the scattered ray is not polarized.  If As and Ap are not normalized, the power of the ray will be scaled.

 

g_Ascat_r_p As Double

Input value that specifies the real component of the scattered ray along the axis defining the p-polarization state.  If Ascat_i_p2 + Ascat_r_p2 = 0 and Ascat_i_s2 + Ascat_r_s2 = 0, then the scattered ray is not polarized.  If As and Ap are not normalized, the power of the ray will be scaled.

 

g_Ascat_i_s As Double

Input value that specifies the imaginary component of the scattered ray along the axis defining the s-polarization state.  If Ascat_i_p2 + Ascat_r_p2 = 0 and Ascat_i_s2 + Ascat_r_s2 = 0, then the scattered ray is not polarized.  If As and Ap are not normalized, the power of the ray will be scaled.

 

g_BSDF As Double

Output value of the BSDF in the direction of the scattered ray.

 

g_frac As Double

Output value defining the fraction of the reference TIS for a given wavelength and position on the scattering surface.  The reference point is x,y = 0,0 on the scattering surface.

 

g_K0 As Double

Input value defining the imaginary refractive index component of the material that the incident ray is immersed in.

 

g_K1 As Double

Input value defining the imaginary refractive index component of the material that the incident ray would transmit into across the surface interface.

 

g_N0 As Double

Input value defining the real refractive index component of the material that the incident ray is immersed in.

 

g_N1 As Double

Input value defining the real refractive index component of the material that the incident ray would transmit into across the surface interface.

 

g_numA As Long

Output value defining the number of samples in the 'X' direction when performing TIS calculations.

 

g_numB As Long

Output value defining the number of samples in the 'Y' direction when performing TIS calculations.

 

g_ran0 As Double

Input high quality random number.

 

g_ran1 As Double

Input high quality random number.

 

g_ran2 As Double

Input high quality random number.

 

g_ran3 As Double

Input high quality random number.

 

g_TISrequest As Boolean

Input value.  When True, a request for the parameters used in the TIS calculation is being made and the g_Xpos, g_Ypos, g_Zpos, g_frac, g_w, g_numA and g_numB parameters are returned.  When False, the BSDF is being calculated and the g_bsdf, g_frac, and g_w parameters are returned.

 

g_w As Double

On input, this defines the wavelength of the incident ray.  On output, this defines the wavelength of the scattered ray.  The user can modify g_w so that the scattered ray's wavelength is different from the incident ray's wavelength.

 

g_Xinc As Double

Input X direction component of the incident ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xinc_s As Double

Input X direction component of the incident ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xnrml As Double

Input X direction component of the surface normal vector at the position of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xpos As Double

Input X position of the of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xscat As Double

Input X direction component of the scattered ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xscat_s As Double

Output X direction component of the scattered ray's s-polarization vector in the local coordinate system of the scattering surface.  If |sscat| = 0, then the scattered ray is unpolarized.

 

g_Xspec As Double

Input X direction component of the specular ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Xspec_s As Double

Input X direction component of the specular ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Yinc As Double

Input Y direction component of the incident ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Yinc_s As Double

Input Y direction component of the incident ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Ynrml As Double

Input Y direction component of the surface normal vector at the position of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Ypos As Double

Input Y position of the of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Yscat As Double

Input Y direction component of the scattered ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Yscat_s As Double

Output Y direction component of the specular ray's s-polarization vector in the local coordinate system of the scattering surface.  If |sscat| = 0, then the scattered ray is unpolarized.

 

g_Yspec As Double

Input Y direction component of the specular ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Yspec_s As Double

Input Y direction component of the specular ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zinc As Double

Input Z direction component of the incident ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zinc_s As Double

Input Z direction component of the incident ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Znrml As Double

Input Z direction component of the surface normal vector at the position of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zpos As Double

Input Z position of the of the incident ray intersection in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zscat As Double

Input Z direction component of the scattered ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zscat_s As Double

Output Z direction component of the specular ray's s-polarization vector in the local coordinate system of the scattering surface.  If |sscat| = 0, then the scattered ray is unpolarized.

 

g_Zspec As Double

Input Z direction component of the specular ray's direction vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

g_Zspec_s As Double

Input Z direction component of the specular ray's s-polarization vector in the local coordinate system of the scattering surface.  This value cannot be modified.

 

 

Example

The following example shows the Main subroutine for an Extended Scripted scatter model that implements a Lambertian scatter function with the scatter rays being completely s-polarized and the s-polarization axis being aligned to the local Y-axis of the scattering surface.

 

Sub EvalScatter( ByRef t As T_SCATTERSCRIPTEX )

 

  Const refl = 1.0

 

  If Not t.g_TISrequest Then

    t.g_Xscat_s   = 0.0

    t.g_Yscat_s   = 1.0

    t.g_Zscat_s   = 0.0

    t.g_Ascat_r_s = 1.0

    t.g_Ascat_i_s = 0.0

    t.g_Ascat_r_p = 0.0

    t.g_Ascat_i_p = 0.0

    t.g_BSDF      = refl / PI()

  Else

    t.g_Xpos=0 : t.g_Ypos=0 : t.g_Zpos=0 : t.g_frac=1 : t.g_w=0.5875618

    t.g_numA=101 : t.g_numB=101

  End If

 

End Sub

 

See Also

Extended Scripted (BSDF given by user-script)

 

 

 

 

 

Copyright © Photon Engineering, LLC