RADIOSIT.H 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /****************************************************************************
  2. * radiosit.h
  3. *
  4. * Include file for radiosit.c, Radiosity calculation routies.
  5. *
  6. * Implemented by and (c) 1994 Jim McElhiney, mcelhiney@acm.org or 71201,1326
  7. * All standard POV distribution rights granted. All other rights reserved.
  8. *
  9. * from Persistence of Vision(tm) Ray Tracer
  10. * Copyright 1996,1999 Persistence of Vision Team
  11. *---------------------------------------------------------------------------
  12. * NOTICE: This source code file is provided so that users may experiment
  13. * with enhancements to POV-Ray and to port the software to platforms other
  14. * than those supported by the POV-Ray Team. There are strict rules under
  15. * which you are permitted to use this file. The rules are in the file
  16. * named POVLEGAL.DOC which should be distributed with this file.
  17. * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  18. * Team Coordinator by email to team-coord@povray.org or visit us on the web at
  19. * http://www.povray.org. The latest version of POV-Ray may be found at this site.
  20. *
  21. * This program is based on the popular DKB raytracer version 2.12.
  22. * DKBTrace was originally written by David K. Buck.
  23. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  24. *
  25. *************************************************************************/
  26. #ifndef RADIOSIT_H
  27. #define RADIOSIT_H
  28. #define RADIOSITY_CACHE_EXTENSION ".rca"
  29. /*****************************************************************************
  30. * Global preprocessor defines
  31. ******************************************************************************/
  32. /* #define RADDEBUG 1 */
  33. #define MAX_NEAREST_COUNT 10
  34. /*****************************************************************************
  35. * Global typedefs
  36. ******************************************************************************/
  37. typedef struct wt_avg_struct WT_AVG;
  38. /* quickie structure used to gather weighted average during tree traversal */
  39. struct wt_avg_struct
  40. {
  41. COLOUR Weights_Times_Illuminances; /* Aggregates during traversal */
  42. DBL Weights; /* Aggregates during traversal */
  43. long Weights_Count; /* Count of points used, aggregates during trav */
  44. long Good_Count; /* Count of points used, aggregates during trav */
  45. VECTOR P, N; /* Point and Normal: input to traverse */
  46. DBL Current_Error_Bound; /* see Radiosity_Error_Bound */
  47. COLOUR Weight_Times_Illuminance[MAX_NEAREST_COUNT];
  48. DBL Weight[MAX_NEAREST_COUNT];
  49. DBL Distance[MAX_NEAREST_COUNT];
  50. long Close_Count;
  51. };
  52. typedef struct byte_xyz BYTE_XYZ;
  53. struct byte_xyz {
  54. unsigned char x, y, z;
  55. };
  56. /*****************************************************************************
  57. * Global variables
  58. ******************************************************************************/
  59. extern long ra_reuse_count;
  60. extern long ra_gather_count;
  61. extern OT_NODE *ot_root;
  62. extern FILE *ot_fd;
  63. extern COLOUR Radiosity_Gather_Total;
  64. extern long Radiosity_Gather_Total_Count;
  65. extern int Radiosity_Trace_Level;
  66. extern BYTE_XYZ rad_samples[];
  67. /*****************************************************************************
  68. * Global functions
  69. ******************************************************************************/
  70. int Compute_Ambient (VECTOR IPoint, VECTOR Normal, COLOUR Ambient_Colour, DBL Weight);
  71. long Initialize_Radiosity_Code (void);
  72. long Deinitialize_Radiosity_Code (void);
  73. #endif