| 28 |
|
#ifndef PMAPDATA_H |
| 29 |
|
#define PMAPDATA_H |
| 30 |
|
|
| 31 |
< |
#ifndef NIX |
| 32 |
< |
#if defined(_WIN32) || defined(_WIN64) |
| 33 |
< |
#define NIX 0 |
| 34 |
< |
#else |
| 35 |
< |
#define NIX 1 |
| 36 |
< |
#endif |
| 37 |
< |
#endif |
| 31 |
> |
#ifndef NIX |
| 32 |
> |
#if defined(_WIN32) || defined(_WIN64) |
| 33 |
> |
#define NIX 0 |
| 34 |
> |
#else |
| 35 |
> |
#define NIX 1 |
| 36 |
> |
#endif |
| 37 |
> |
#endif |
| 38 |
|
|
| 39 |
|
#if (defined(PMAP_OOC) && !NIX) |
| 40 |
|
#error "OOC currently only supported on NIX -- tuff luck." |
| 41 |
|
#endif |
| 42 |
|
|
| 43 |
+ |
#ifdef PMAP_CBDM |
| 44 |
+ |
/* Enable photon primary hitpoints and incident directions (see struct |
| 45 |
+ |
* PhotonPrimary below). Note this will increase the size of photon |
| 46 |
+ |
* primaries 9-fold (10-fold after alignment)!!! */ |
| 47 |
+ |
#define PMAP_PRIMARYPOS |
| 48 |
+ |
#define PMAP_PRIMARYDIR |
| 49 |
+ |
#endif |
| 50 |
|
|
| 51 |
< |
#include "ray.h" |
| 51 |
> |
#include "ray.h" |
| 52 |
|
#include "pmaptype.h" |
| 53 |
|
#include "paths.h" |
| 54 |
|
#include "lookup.h" |
| 60 |
|
typedef struct { |
| 61 |
|
int16 srcIdx; /* Index of emitting light source */ |
| 62 |
|
/* !!! REDUCED FROM 32 BITS !!! */ |
| 63 |
< |
#ifdef PMAP_PRIMARYDIR |
| 63 |
> |
#ifdef PMAP_PRIMARYDIR |
| 64 |
|
int32 dir; /* Encoded ray direction */ |
| 65 |
< |
#endif |
| 66 |
< |
#ifdef PMAP_PRIMARYPOS |
| 65 |
> |
#endif |
| 66 |
> |
#ifdef PMAP_PRIMARYPOS |
| 67 |
|
float pos [3]; /* Hit point */ |
| 68 |
< |
#endif |
| 68 |
> |
#endif |
| 69 |
|
} PhotonPrimary; |
| 70 |
|
|
| 71 |
|
#define photonSrcIdx(pm, p) ((pm)->primaries[(p)->primary].srcIdx) |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
/* Photon primary ray index type and limit */ |
| 76 |
< |
typedef uint32 PhotonPrimaryIdx; |
| 76 |
> |
typedef uint32 PhotonPrimaryIdx; |
| 77 |
|
#define PMAP_MAXPRIMARY UINT32_MAX |
| 78 |
|
|
| 79 |
|
/* Macros for photon's generating subprocess field */ |
| 80 |
|
#ifdef PMAP_OOC |
| 81 |
|
#define PMAP_PROCBITS 7 |
| 82 |
< |
#else |
| 83 |
< |
#define PMAP_PROCBITS 5 |
| 82 |
> |
#else |
| 83 |
> |
#define PMAP_PROCBITS 5 |
| 84 |
|
#endif |
| 85 |
|
#define PMAP_MAXPROC (1 << PMAP_PROCBITS) |
| 86 |
|
#define PMAP_GETRAYPROC(r) ((r) -> crtype >> 8) |
| 112 |
|
}; |
| 113 |
|
|
| 114 |
|
#ifdef PMAP_FLOAT_FLUX |
| 115 |
< |
COLOR flux; |
| 115 |
> |
COLOR flux; |
| 116 |
|
#else |
| 117 |
< |
COLR flux; |
| 117 |
> |
COLR flux; |
| 118 |
|
#endif |
| 119 |
|
PhotonPrimaryIdx primary; /* Index to primary ray */ |
| 120 |
|
} Photon; |
| 134 |
|
|
| 135 |
|
|
| 136 |
|
/* Bias compensation history node */ |
| 137 |
< |
typedef struct { |
| 137 |
> |
typedef struct { |
| 138 |
|
COLOR irrad; |
| 139 |
|
float weight; |
| 140 |
|
} PhotonBiasCompNode; |
| 178 |
|
unsigned long heapBufLen, /* Current & max size of heapBuf */ |
| 179 |
|
heapBufSize; |
| 180 |
|
PhotonStorage store; /* Photon storage in space |
| 181 |
< |
subdividing data struct */ |
| 181 |
> |
subdividing data struct */ |
| 182 |
|
|
| 183 |
|
/* ================================================================ |
| 184 |
|
* PHOTON DISTRIBUTION STUFF |
| 215 |
|
|
| 216 |
|
/* ================================================================ |
| 217 |
|
* BIAS COMPENSATION STUFF |
| 218 |
< |
* ================================================================ */ |
| 218 |
> |
* ================================================================ */ |
| 219 |
|
PhotonBiasCompNode *biasCompHist; /* Bias compensation history */ |
| 220 |
|
|
| 221 |
|
|
| 222 |
|
/* ================================================================ |
| 223 |
|
* STATISTIX |
| 224 |
< |
* ================================================================ */ |
| 224 |
> |
* ================================================================ */ |
| 225 |
|
unsigned long totalGathered, /* Total photons gathered */ |
| 226 |
|
numDensity, /* Num density estimates */ |
| 227 |
|
numLookups, /* Counters for short photon lookups */ |