BRDFSlices.DisplayForm.LookupBRDF C# (CSharp) Method

LookupBRDF() public static method

Given a pair of incoming/outgoing angles, look up the BRDF.
public static LookupBRDF ( Vector3 _BRDF, double _ThetaIn, double _PhiIn, double _ThetaOut, double _PhiOut, Vector3 &_Result ) : void
_BRDF Vector3
_ThetaIn double
_PhiIn double
_ThetaOut double
_PhiOut double
_Result Vector3
return void
        public static void LookupBRDF( Vector3[,,] _BRDF, double _ThetaIn, double _PhiIn, double _ThetaOut, double _PhiOut, ref Vector3 _Result )
        {
            // Convert to half angle / difference angle coordinates
            double ThetaHalf, PhiHalf, ThetaDiff, PhiDiff;
            std_coords_to_half_diff_coords(	_ThetaIn, _PhiIn, _ThetaOut, _PhiOut,
                                            out ThetaHalf, out PhiHalf, out ThetaDiff, out PhiDiff );

            // (note that PhiHalf is ignored, since isotropic BRDFs are assumed)
            Vector3	r;
            int PhiDiffIndex = PhiDiff_index( PhiDiff, out r.z );
            int	ThetaDiffIndex = ThetaDiff_index( ThetaDiff, out r.y );
            int	ThetaHalfIndex = ThetaHalf_index( ThetaHalf, out r.x );

            _Result = _BRDF[ThetaHalfIndex,ThetaDiffIndex,PhiDiffIndex];
        }