106 |
|
{ |
107 |
|
rayorigin(rayOut, rayOutType, rayIn, NULL); |
108 |
|
|
109 |
< |
/* Transfer flux */ |
110 |
< |
copycolor(rayOut -> rcol, rayIn -> rcol); |
111 |
< |
|
112 |
< |
/* Copy caustic flag & direction for transferred rays */ |
113 |
< |
if (rayOutType == PMAP_XFER) { |
114 |
< |
/* rayOut -> rtype |= rayIn -> rtype & SPECULAR; */ |
115 |
< |
rayOut -> rtype |= rayIn -> rtype; |
116 |
< |
VCOPY(rayOut -> rdir, rayIn -> rdir); |
117 |
< |
} |
118 |
< |
else if (fluxAtten) { |
119 |
< |
/* Attenuate and normalise flux for scattered rays */ |
120 |
< |
multcolor(rayOut -> rcol, fluxAtten); |
121 |
< |
colorNorm(rayOut -> rcol); |
122 |
< |
} |
109 |
> |
if (rayIn) { |
110 |
> |
/* Transfer flux */ |
111 |
> |
copycolor(rayOut -> rcol, rayIn -> rcol); |
112 |
> |
|
113 |
> |
/* Copy caustic flag & direction for transferred rays */ |
114 |
> |
if (rayOutType == PMAP_XFER) { |
115 |
> |
/* rayOut -> rtype |= rayIn -> rtype & SPECULAR; */ |
116 |
> |
rayOut -> rtype |= rayIn -> rtype; |
117 |
> |
VCOPY(rayOut -> rdir, rayIn -> rdir); |
118 |
> |
} |
119 |
> |
else if (fluxAtten) { |
120 |
> |
/* Attenuate and normalise flux for scattered rays */ |
121 |
> |
multcolor(rayOut -> rcol, fluxAtten); |
122 |
> |
colorNorm(rayOut -> rcol); |
123 |
> |
} |
124 |
|
|
125 |
< |
/* Propagate index of emitting light source */ |
126 |
< |
rayOut -> rsrc = rayIn -> rsrc; |
125 |
> |
/* Propagate index of emitting light source */ |
126 |
> |
rayOut -> rsrc = rayIn -> rsrc; |
127 |
> |
|
128 |
> |
/* Update maximum photon path distance */ |
129 |
> |
rayOut -> rmax = rayIn -> rmax - rayIn -> rot; |
130 |
> |
} |
131 |
|
} |
132 |
|
|
133 |
|
|
137 |
|
{ |
138 |
|
if (!r -> rlvl) |
139 |
|
/* Add direct photon map at primary hitpoint */ |
140 |
< |
addPhoton(directPmap, r); |
140 |
> |
newPhoton(directPmap, r); |
141 |
|
else { |
142 |
|
/* Add global or precomputed photon map at indirect hitpoint */ |
143 |
< |
addPhoton(preCompPmap ? preCompPmap : globalPmap, r); |
143 |
> |
newPhoton(preCompPmap ? preCompPmap : globalPmap, r); |
144 |
|
|
145 |
|
/* Store caustic photon if specular flag set */ |
146 |
|
if (PMAP_CAUSTICRAY(r)) |
147 |
< |
addPhoton(causticPmap, r); |
147 |
> |
newPhoton(causticPmap, r); |
148 |
|
|
149 |
|
/* Store in contribution photon map */ |
150 |
< |
addPhoton(contribPmap, r); |
150 |
> |
newPhoton(contribPmap, r); |
151 |
|
} |
152 |
|
} |
153 |
|
|
984 |
|
/* Straight replacement? */ |
985 |
|
if (!mat -> oargs.nsargs) { |
986 |
|
/* Skip void modifier! */ |
987 |
< |
if (mat -> omod != OVOID) { |
987 |
> |
if (mat -> omod != OVOID) { |
988 |
|
mat = objptr(mat -> omod); |
989 |
|
photonScatter [mat -> otype] (mat, rayIn); |
990 |
|
} |
1667 |
|
|
1668 |
|
|
1669 |
|
static int lightPhotonScatter (OBJREC* mat, RAY* ray) |
1670 |
< |
/* Light sources doan' reflect */ |
1670 |
> |
/* Light sources doan' reflect, mang */ |
1671 |
|
{ |
1672 |
|
return 0; |
1673 |
|
} |