home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / raytrace / rayshade / src / surface.h < prev    next >
C/C++ Source or Header  |  1991-07-18  |  2KB  |  69 lines

  1. /*
  2.  * surface.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: surface.h,v 4.0 91/07/17 14:41:02 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    surface.h,v $
  19.  * Revision 4.0  91/07/17  14:41:02  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef SURFACE_H
  24. #define SURFACE_H
  25.  
  26. #define DEFAULT_INDEX        1.0    /* Default index of refraction */
  27. #define DEFAULT_PHONGPOW    15.0    /* Default specular highlight exp */
  28.  
  29. /*
  30.  * Surface definition.
  31.  */
  32. typedef struct Surface {
  33.     char    *name;            /* Name */
  34.     struct Color    amb,        /* Ambient 'curve' */
  35.             diff,        /* Diffuse reflection 'curve' */
  36.             spec,        /* Specular reflection 'curve' */
  37.             translu,    /* Diffuse transmission 'curve' */
  38.             body;        /* Specular transmission 'curve' */
  39.     Float    srexp,            /* Specular reflection exponent */
  40.         stexp,            /* Specular transmission exponent */
  41.         statten,        /* Specular transmission attenuation */
  42.         index,            /* Index of refraction */
  43.         reflect,        /* Specular reflectivity */
  44.         transp,            /* Specular transmittance */
  45.         translucency;        /* Diffuse transmittance */ 
  46.     char    noshadow;        /* No shadowing? */
  47.     struct Surface *next;        /* Next surface in list (if any) */
  48. } Surface;
  49.  
  50. /*
  51.  * Linked list of (linked list of) surfaces.
  52.  */
  53. typedef struct SurfList {
  54.     Surface *surf;
  55.     struct SurfList *next;
  56. } SurfList;
  57.  
  58. extern Surface    *SurfaceCreate(),
  59.         *GetShadingSurf(),    /* application-provided */
  60.         *SurfaceCopy();
  61.  
  62. extern SurfList    *SurfPop(), *SurfPush();
  63.  
  64. extern void    SurfaceBlend(), ColorBlend();
  65.  
  66. extern int    ComputeSurfProps();
  67.  
  68. #endif /* SURFACE_H */
  69.