23 , mLightAzimuth( lightAzimuth )
24 , mLightAngle( lightAngle )
33 float* x12,
float* x22,
float* x32,
34 float* x13,
float* x23,
float* x33 )
36 float derX =
calcFirstDerX( x11, x21, x31, x12, x22, x32, x13, x23, x33 );
37 float derY =
calcFirstDerY( x11, x21, x31, x12, x22, x32, x13, x23, x33 );
45 float slope_rad = atan( sqrt( derX * derX + derY * derY ) );
48 if ( derX == 0 && derY == 0 )
50 aspect_rad = azimuth_rad / 2.0;
54 aspect_rad =
M_PI + atan2( derX, derY );
56 return qMax( 0.0, 255.0 * (( cos( zenith_rad ) * cos( slope_rad ) ) + ( sin( zenith_rad ) * sin( slope_rad ) * cos( azimuth_rad - aspect_rad ) ) ) );