home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / illum.lha / illum_mod.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-13  |  3.9 KB  |  90 lines

  1. /* ****************************************************************
  2.  *                         illum_mod.h
  3.  * ****************************************************************
  4.  * include file for the illumination models
  5.  */
  6. #ifndef ILLUM_H
  7. #define ILLUM_H
  8. #include "geo.h"
  9.  
  10. /* The material structure maintains the description of a material
  11.  *  interface.  An interface between a conductor or dielectric and
  12.  *  air is characterized by loading the properties of the material
  13.  *  and an index of refraction of 1 for the outside material.  An
  14.  *  interface between two materials is characterized by generating
  15.  *  a pseudo-material as described in appendix III.5.1, Approxima-
  16.  *  tion Methodology.
  17.  *
  18.  * In filling the material structure, the reflected direction is
  19.  *  the 'outside' of the material.  That is, for an interface
  20.  *  between air and glass, for example, the the reflected direction
  21.  *  or 'outside' is air (Ar_spectral = NULL, nr=1.0), and the
  22.  *  transmitted direction is glass (nt=1.5, etc.)
  23.  *
  24.  * Individual spectral components of the material are characterized
  25.  *  by the sampled spectral values and a multiplier to scale these
  26.  *  values (as discussed in appendix II.1.5, Selecting Ka, Ka, Ks,
  27.  *  Ft and Fr)
  28.  */
  29.  
  30. typedef struct {
  31.     double  Ka_scale;       /* ambient multiplier */
  32.     double  *Ka_spectral;   /* sampled ambient spectral curve */
  33.     double  Kd_scale;       /* diffuse multiplier */
  34.     double  *Kd_spectral;   /* sampled diffuse spectral curve */
  35.     double  Ks_scale;       /* specular multiplier */
  36.     double  *Ks_spectral;   /* sampled specular spectral curve */
  37.     double  Kt_scale;       /* transmitted multiplier            */
  38.     double  *Kt_spectral;   /* sampled specular transmitted      */
  39.                 /*  curve.  The Kt_ properties are   */
  40.                 /* used for the Whitted model only   */
  41.     double  *Ar_spectral;   /* sampled filter spectral curve.    */
  42.     double  *At_spectral;   /* sampled filter spectral curve     */
  43.                 /*  These are used in the Hall model */
  44.                 /*  only.  Filter attenuation is     */
  45.                 /*  ignored is a NULL pointer is     */
  46.                 /*  specified.                       */
  47.     double  beta;           /* roughness indicator */
  48.     double  (*D)();         /* microfacet distribution */
  49.     double  D_coeff;        /* the coefficient for the           */
  50.                 /*  microfacet distribution function */
  51.                 /*  computed from by microfacet      */
  52.                 /*  distribution init function       */
  53.     double  (*G)();         /* geometric attenuation function */
  54.     double  G_coeff;        /* the coefficient for the geometric */
  55.                 /*  attenuation function (m_2 for    */
  56.                 /*  the Sancer function, unused for  */
  57.                 /*  the Torrance-Sparrow function)   */
  58.     double  Ro;             /* average reflectance */
  59.     double  nr;             /* index of refraction (incident) */
  60.     double  nt;             /* index of refraction (transmitted) */
  61.     double  k;              /* absorption coefficient */
  62.     int     conductor;      /* flags the specular material as a  */
  63.                 /*  conductor */
  64.     int     transparent;    /* flags whether the material is     */
  65.                 /*  transparent --- note, composite  */
  66.                 /*  materials have a dielectric      */
  67.                 /*  specular component but may not   */
  68.                 /*  be transparent                   */
  69.     int     r_is_air;       /* flags that the 'outside' or       */
  70.                 /*  reflect side of the interface is */
  71.                 /*  air                              */
  72. } ILLUM_MATL;
  73.  
  74. typedef struct {
  75.     double  I_scale;        /* illumination multiplier */
  76.     double  *I_spectral;    /* sampled source spectral curve */
  77.     POINT3  center;         /* center of the light source */
  78. } ILLUM_LGT;
  79.  
  80. int     IM_init();
  81. double  *IM_bouknight();
  82. double  *IM_phong();
  83. double  *IM_blinn();
  84. double  *IM_whitted();
  85. double  *IM_hall();
  86. int     IM_exit();
  87.  
  88. #endif CLR_H
  89. /* ************************************************************* */
  90.