ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void TAG() Normal3f_single ( GLfloat  x,
GLfloat  y,
GLfloat  z 
) [static]

Definition at line 34 of file t_dd_imm_napi.h.

Referenced by init_norm().

{
   GET_CURRENT_VERTEX;
   const struct gl_light *light = ctx->Light.EnabledList.prev;
   GLfloat n_dot_h, n_dot_VP, spec, sum[3];
   GLfloat *normal = ctx->Current.Normal;
   GLfloat scale = 1.0;

   ASSIGN_3V( normal, x, y, z );
   COPY_3V( sum, BASE_COLOR );

   if ( IND & NORM_RESCALE ) {
      scale = ctx->_ModelViewInvScale;
   } else if ( IND & NORM_NORMALIZE ) {
      scale = LEN_3FV( normal );
      if ( scale != 0.0 ) scale = 1.0 / scale;
   }

   n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale;
   if ( n_dot_VP > 0.0F ) {
      ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] );
      n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale;
      if ( n_dot_h > 0.0F ) {
     GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
     ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] );
      }
   }

#ifdef LIT_COLOR_IS_FLOAT
   LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f);
   LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f);
   LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f);
#else
   UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] );
   UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] );
   UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] );
#endif
   LIT_COLOR( ACOMP ) = LIT_ALPHA;
}

Generated on Sun May 27 2012 05:00:01 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.