17#include <optix_world.h>
18#include <optixu/optixu_math_namespace.h>
19#include <optixu/optixu_matrix_namespace.h>
21#include "RayTracing.cuh"
26rtDeclareVariable(optix::Ray, ray, rtCurrentRay, );
27rtDeclareVariable(
float, t_hit, rtIntersectionDistance, );
28rtDeclareVariable(PerRayData, prd, rtPayload, );
30rtDeclareVariable(
unsigned int, UUID, attribute UUID, );
32RT_PROGRAM
void closest_hit_direct() {
34 uint hit_position = primitive_positions[UUID];
37 if (hit_position == UINT_MAX) {
41 if ((periodic_flag.x == 1 || periodic_flag.y == 1) && primitive_type[hit_position] == 5) {
43 prd.hit_periodic_boundary =
true;
45 float3 ray_origin = ray.origin + t_hit * ray.direction;
49 float2 xbounds = make_float2(bbox_vertices[
make_uint2(0, 0)].x, bbox_vertices[
make_uint2(1, 1)].x);
50 float2 ybounds = make_float2(bbox_vertices[
make_uint2(0, 0)].y, bbox_vertices[
make_uint2(1, 1)].y);
52 float width_x = xbounds.y - xbounds.x;
53 float width_y = ybounds.y - ybounds.x;
55 prd.periodic_hit = ray_origin;
56 if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.x) <= eps) {
57 prd.periodic_hit.x += +width_x - eps;
58 }
else if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.y) <= eps) {
59 prd.periodic_hit.x += -width_x + eps;
60 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.x) <= eps) {
61 prd.periodic_hit.y += +width_y - eps;
62 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.y) <= eps) {
63 prd.periodic_hit.y += -width_y + eps;
68RT_PROGRAM
void closest_hit_diffuse() {
71 uint origin_UUID = prd.origin_UUID;
72 uint origin_position = primitive_positions[origin_UUID];
73 uint hit_position = primitive_positions[UUID];
76 if (origin_position == UINT_MAX || hit_position == UINT_MAX) {
85 if ((periodic_flag.x == 1 || periodic_flag.y == 1) && primitive_type[hit_position] == 5) {
87 prd.hit_periodic_boundary =
true;
89 float3 ray_origin = ray.origin + t_hit * ray.direction;
93 float2 xbounds = make_float2(bbox_vertices[
make_uint2(0, 0)].x, bbox_vertices[
make_uint2(1, 1)].x);
94 float2 ybounds = make_float2(bbox_vertices[
make_uint2(0, 0)].y, bbox_vertices[
make_uint2(1, 1)].y);
96 float width_x = xbounds.y - xbounds.x;
97 float width_y = ybounds.y - ybounds.x;
99 prd.periodic_hit = ray_origin;
100 if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.x) <= eps) {
101 prd.periodic_hit.x += +width_x - eps;
102 }
else if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.y) <= eps) {
103 prd.periodic_hit.x += -width_x + eps;
104 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.x) <= eps) {
105 prd.periodic_hit.y += +width_y - eps;
106 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.y) <= eps) {
107 prd.periodic_hit.y += -width_y + eps;
118 for (
uint i = 0; i < 16; i++) {
119 m[i] = transform_matrix[optix::make_uint2(i, hit_position)];
122 if (primitive_type[hit_position] == 0 || primitive_type[hit_position] == 3) {
123 float3 s0 = make_float3(0, 0, 0);
124 float3 s1 = make_float3(1, 0, 0);
125 float3 s2 = make_float3(0, 1, 0);
126 d_transformPoint(m, s0);
127 d_transformPoint(m, s1);
128 d_transformPoint(m, s2);
129 normal =
cross(s1 - s0, s2 - s0);
130 }
else if (primitive_type[hit_position] == 1) {
131 float3 v0 = make_float3(0, 0, 0);
132 d_transformPoint(m, v0);
133 float3 v1 = make_float3(0, 1, 0);
134 d_transformPoint(m, v1);
135 float3 v2 = make_float3(1, 1, 0);
136 d_transformPoint(m, v2);
137 normal =
cross(v1 - v0, v2 - v0);
138 }
else if (primitive_type[hit_position] == 2) {
139 float3 v0 = make_float3(0, 0, 0);
140 d_transformPoint(m, v0);
141 float3 v1 = make_float3(1, 0, 0);
142 d_transformPoint(m, v1);
143 float3 v2 = make_float3(0, 1, 0);
144 d_transformPoint(m, v2);
145 normal =
cross(v1 - v0, v2 - v0);
146 }
else if (primitive_type[hit_position] == 4) {
147 float3 vmin = make_float3(-0.5, -0.5, -0.5);
148 d_transformPoint(m, vmin);
149 float3 vmax = make_float3(0.5, 0.5, 0.5);
150 d_transformPoint(m, vmax);
152 normal = normalize(normal);
154 bool face = dot(normal, ray.direction) < 0;
157 for (
int b_global = 0; b_global < Nbands_global; b_global++) {
159 if (band_launch_flag[b_global] == 0) {
167 size_t ind_origin = rad_indexer(origin_position, b);
168 size_t ind_hit = rad_indexer(hit_position, b);
171 if (face || primitive_type[hit_position] == 4) {
172 strength = radiation_out_top[ind_hit] * prd.strength;
174 strength = radiation_out_bottom[ind_hit] * prd.strength;
182 size_t radprop_ind_global = mat_indexer(prd.source_ID, origin_position, b_global);
183 float t_rho = rho[radprop_ind_global];
184 float t_tau = tau[radprop_ind_global];
187 if (primitive_type[origin_position] == 4) {
202 float absorption_factor = 1.f - t_rho - t_tau;
203 float contribution = strength * absorption_factor;
207 if (absorption_factor < -1e-5f) {
208 printf(
"ERROR: Negative absorption! rho=%.6f, tau=%.6f, origin_UUID=%u\n", t_rho, t_tau, origin_UUID);
209 absorption_factor = 0.f;
212 atomicAdd(&radiation_in[ind_origin], contribution);
214 if ((t_rho > 0 || t_tau > 0) && strength > 0) {
216 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_rho);
217 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_tau);
219 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_rho);
220 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_tau);
225 size_t indc = cam_mat_indexer(prd.source_ID, origin_position, b_global, camera_ID);
226 float t_rho_cam = rho_cam[indc];
227 float t_tau_cam = tau_cam[indc];
228 if ((t_rho_cam > 0 || t_tau_cam > 0) && strength > 0) {
230 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_rho_cam);
231 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_tau_cam);
233 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_rho_cam);
234 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_tau_cam);
253RT_PROGRAM
void closest_hit_camera() {
256 uint hit_position = primitive_positions[UUID];
259 if (hit_position == UINT_MAX) {
264 uint pixel_index = prd.origin_UUID;
265 size_t Npixels = camera_resolution_full.x * camera_resolution_full.y;
272 if ((periodic_flag.x == 1 || periodic_flag.y == 1) && primitive_type[hit_position] == 5) {
274 prd.hit_periodic_boundary =
true;
276 float3 ray_origin = ray.origin + t_hit * ray.direction;
280 float2 xbounds = make_float2(bbox_vertices[
make_uint2(0, 0)].x, bbox_vertices[
make_uint2(1, 1)].x);
281 float2 ybounds = make_float2(bbox_vertices[
make_uint2(0, 0)].y, bbox_vertices[
make_uint2(1, 1)].y);
283 float width_x = xbounds.y - xbounds.x;
284 float width_y = ybounds.y - ybounds.x;
286 prd.periodic_hit = ray_origin;
287 if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.x) <= eps) {
288 prd.periodic_hit.x += +width_x - eps;
289 }
else if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.y) <= eps) {
290 prd.periodic_hit.x += -width_x + eps;
291 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.x) <= eps) {
292 prd.periodic_hit.y += +width_y - eps;
293 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.y) <= eps) {
294 prd.periodic_hit.y += -width_y + eps;
305 for (
uint i = 0; i < 16; i++) {
306 m[i] = transform_matrix[optix::make_uint2(i, hit_position)];
309 if (primitive_type[hit_position] == 0 || primitive_type[hit_position] == 3) {
310 float3 s0 = make_float3(0, 0, 0);
311 float3 s1 = make_float3(1, 0, 0);
312 float3 s2 = make_float3(0, 1, 0);
313 d_transformPoint(m, s0);
314 d_transformPoint(m, s1);
315 d_transformPoint(m, s2);
316 normal =
cross(s1 - s0, s2 - s0);
317 }
else if (primitive_type[hit_position] == 1) {
318 float3 v0 = make_float3(0, 0, 0);
319 d_transformPoint(m, v0);
320 float3 v1 = make_float3(0, 1, 0);
321 d_transformPoint(m, v1);
322 float3 v2 = make_float3(1, 1, 0);
323 d_transformPoint(m, v2);
324 normal =
cross(v1 - v0, v2 - v0);
325 }
else if (primitive_type[hit_position] == 2) {
326 float3 v0 = make_float3(0, 0, 0);
327 d_transformPoint(m, v0);
328 float3 v1 = make_float3(1, 0, 0);
329 d_transformPoint(m, v1);
330 float3 v2 = make_float3(0, 1, 0);
331 d_transformPoint(m, v2);
332 normal =
cross(v1 - v0, v2 - v0);
333 }
else if (primitive_type[hit_position] == 4) {
334 float3 vmin = make_float3(-0.5, -0.5, -0.5);
335 d_transformPoint(m, vmin);
336 float3 vmax = make_float3(0.5, 0.5, 0.5);
337 d_transformPoint(m, vmax);
339 normal = normalize(normal);
341 bool face = dot(normal, ray.direction) < 0;
344 float3 camera_normal = d_rotatePoint(make_float3(0, 0, 1), -0.5 *
M_PI + camera_direction.x, 0.5f *
M_PI - camera_direction.y);
347 for (
size_t b = 0; b < Nbands_launch; b++) {
350 float source_radiance = 0.0f;
351 for (
uint s = 0; s < Nsources; s++) {
352 float flux = source_fluxes[s * Nbands_launch + b];
356 uint source_type = source_types[s];
358 if (source_type == 1) {
360 float radius = source_widths[s].x * 0.5f;
361 float3 oc = ray.origin - source_positions[s];
362 float b = dot(oc, ray.direction);
363 float c = dot(oc, oc) - radius * radius;
364 float discriminant = b * b - c;
366 if (discriminant >= 0.0f) {
367 float t_sphere = -b - sqrtf(discriminant);
368 if (t_sphere > 0.0f && t_sphere < t_hit) {
369 float area = 4.0f *
M_PI * radius * radius;
370 source_radiance += (flux / area) /
M_PI;
373 }
else if (source_type == 3) {
376 d_makeTransformMatrix(source_rotations[s], transform);
377 float3 normal = make_float3(transform[2], transform[6], transform[10]);
379 float denom = dot(ray.direction, normal);
380 if (denom < -1e-6f) {
381 float3 oc = source_positions[s] - ray.origin;
382 float t_rect = dot(oc, normal) / denom;
384 if (t_rect > 0.0f && t_rect < t_hit) {
385 float3 hit_point = ray.origin + t_rect * ray.direction;
386 float3 local_hit = hit_point - source_positions[s];
387 float inv_transform[16];
388 d_invertMatrix(transform, inv_transform);
389 d_transformPoint(inv_transform, local_hit);
391 if (fabsf(local_hit.x) <= source_widths[s].x * 0.5f && fabsf(local_hit.y) <= source_widths[s].y * 0.5f) {
392 float area = source_widths[s].x * source_widths[s].y;
393 float cos_angle = -denom;
394 source_radiance += (flux / area) * cos_angle /
M_PI;
398 }
else if (source_type == 4) {
401 d_makeTransformMatrix(source_rotations[s], transform);
402 float3 normal = make_float3(transform[2], transform[6], transform[10]);
404 float denom = dot(ray.direction, normal);
405 if (denom < -1e-6f) {
406 float3 oc = source_positions[s] - ray.origin;
407 float t_disk = dot(oc, normal) / denom;
409 if (t_disk > 0.0f && t_disk < t_hit) {
410 float3 hit_point = ray.origin + t_disk * ray.direction;
411 float3 offset = hit_point - source_positions[s];
412 float dist_sq = dot(offset, offset);
414 float radius = source_widths[s].x;
415 if (dist_sq <= radius * radius) {
416 float area =
M_PI * radius * radius;
417 float cos_angle = -denom;
418 source_radiance += (flux / area) * cos_angle /
M_PI;
426 size_t ind_hit = rad_indexer(hit_position, b);
428 if (face || primitive_type[hit_position] == 4) {
429 strength = radiation_out_top[ind_hit] * prd.strength;
431 strength = radiation_out_bottom[ind_hit] * prd.strength;
434 if (source_radiance > 0.0f) {
435 strength += source_radiance * prd.strength;
442 double strength_spec = 0;
443 if (specular_reflection_enabled > 0 && specular_exponent[hit_position] > 0.f && scattering_iteration == 0) {
446 for (
int rr = 0; rr < Nsources; rr++) {
451 size_t ind_specular = spec_indexer(rr, camera_ID, hit_position, b);
452 float spec = radiation_specular[ind_specular];
460 float3 light_direction;
461 if (source_types[rr] == 0 || source_types[rr] == 2) {
463 light_direction = normalize(source_positions[rr]);
466 float3 hit_point = ray.origin + t_hit * ray.direction;
467 light_direction = normalize(source_positions[rr] - hit_point);
471 float3 specular_direction = normalize(light_direction - ray.direction);
473 float exponent = specular_exponent[hit_position];
474 double scale_coefficient = 1.0;
475 if (specular_reflection_enabled == 2) {
476 scale_coefficient = specular_scale[hit_position];
479 strength_spec += spec * scale_coefficient * pow(
max(0.f, dot(specular_direction, normal)), exponent) * (exponent + 2.f) /
480 (
double(launch_dim.x) * 2.f *
M_PI);
488 size_t ind_camera = rad_indexer(pixel_index, b);
490 atomicAdd(&radiation_in_camera[ind_camera],
491 (strength + strength_spec) /
M_PI);
496RT_PROGRAM
void closest_hit_pixel_label() {
498 uint origin_UUID = prd.origin_UUID;
500 uint hit_position = primitive_positions[UUID];
502 if ((periodic_flag.x == 1 || periodic_flag.y == 1) && primitive_type[hit_position] == 5) {
504 prd.hit_periodic_boundary =
true;
506 float3 ray_origin = ray.origin + t_hit * ray.direction;
510 float2 xbounds = make_float2(bbox_vertices[
make_uint2(0, 0)].x, bbox_vertices[
make_uint2(1, 1)].x);
511 float2 ybounds = make_float2(bbox_vertices[
make_uint2(0, 0)].y, bbox_vertices[
make_uint2(1, 1)].y);
513 float width_x = xbounds.y - xbounds.x;
514 float width_y = ybounds.y - ybounds.x;
516 prd.periodic_hit = ray_origin;
517 if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.x) <= eps) {
518 prd.periodic_hit.x += +width_x - eps;
519 }
else if (periodic_flag.x == 1 && fabs(ray_origin.x - xbounds.y) <= eps) {
520 prd.periodic_hit.x += -width_x + eps;
521 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.x) <= eps) {
522 prd.periodic_hit.y += +width_y - eps;
523 }
else if (periodic_flag.y == 1 && fabs(ray_origin.y - ybounds.y) <= eps) {
524 prd.periodic_hit.y += -width_y + eps;
531 camera_pixel_label[origin_UUID] = UUID + 1;
533 float depth = prd.strength + t_hit;
534 float3 camera_direction3 = d_rotatePoint(make_float3(1, 0, 0), -0.5 *
M_PI + camera_direction.x, 0.5f *
M_PI - camera_direction.y);
535 camera_pixel_depth[origin_UUID] = abs(dot(camera_direction3, ray.direction)) * depth;
539RT_PROGRAM
void miss_direct() {
542 uint origin_position = primitive_positions[prd.origin_UUID];
553 for (
int b_global = 0; b_global < Nbands_global; b_global++) {
555 if (band_launch_flag[b_global] == 0) {
561 size_t ind_origin = rad_indexer(origin_position, b);
564 size_t radprop_ind_global = mat_indexer(prd.source_ID, origin_position, b_global);
565 float t_rho = rho[radprop_ind_global];
566 float t_tau = tau[radprop_ind_global];
569 size_t flux_idx = source_flux_indexer(prd.source_ID, b);
570 float source_flux = source_fluxes[flux_idx];
571 double strength = prd.strength * source_flux;
572 float absorption = strength * (1.f - t_rho - t_tau);
575 atomicAdd(&radiation_in[ind_origin], absorption);
577 if (t_rho > 0 || t_tau > 0) {
579 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_rho);
580 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_tau);
582 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_rho);
583 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_tau);
588 size_t indc = cam_mat_indexer(prd.source_ID, origin_position, b_global, camera_ID);
589 float t_rho_cam = rho_cam[indc];
590 float t_tau_cam = tau_cam[indc];
591 if ((t_rho_cam > 0 || t_tau_cam > 0) && strength > 0) {
593 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_rho_cam);
594 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_tau_cam);
596 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_rho_cam);
597 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_tau_cam);
604 size_t weight_ind = source_cam_flux_indexer(prd.source_ID, b, camera_ID);
605 float camera_weight = source_fluxes_cam[weight_ind];
607 size_t ind_specular = spec_indexer(prd.source_ID, camera_ID, origin_position, b);
608 atomicFloatAdd(&radiation_specular[ind_specular], strength * camera_weight);
619__device__
float evaluateDiffuseAngularDistribution(
const float3 &ray_dir,
const float3 &peak_dir,
float power_law_K,
float power_law_norm,
const float4 &prague_params) {
622 if (power_law_K > 0.0f) {
623 float psi =
acos_safe(dot(peak_dir, ray_dir));
624 psi = fmaxf(psi,
M_PI / 180.0f);
625 return powf(psi, -power_law_K) * power_law_norm;
629 if (prague_params.w > 0.0f) {
631 float gamma =
acos_safe(dot(ray_dir, peak_dir)) * 180.0f / float(
M_PI);
634 float cos_theta = fmaxf(ray_dir.z, 0.0f);
638 float pattern = (1.0f + prague_params.x * expf(-gamma / prague_params.y)) * (1.0f + (prague_params.z - 1.0f) * (1.0f - cos_theta));
642 return pattern * prague_params.w *
M_PI;
651RT_PROGRAM
void miss_diffuse() {
654 uint origin_position = primitive_positions[prd.origin_UUID];
662 for (
size_t b_global = 0; b_global < Nbands_global; b_global++) {
664 if (band_launch_flag[b_global] == 0) {
669 if (diffuse_flux[b] > 0.f) {
672 size_t ind_origin = rad_indexer(origin_position, b);
675 size_t radprop_ind_global = mat_indexer(prd.source_ID, origin_position, b_global);
676 float t_rho = rho[radprop_ind_global];
677 float t_tau = tau[radprop_ind_global];
680 if (primitive_type[origin_position] == 4) {
683 float sigma_s = t_tau;
684 float beta = kappa + sigma_s;
687 atomicAdd(&radiation_in[ind_origin], diffuse_flux[b] * prd.strength * kappa / beta);
690 atomicAdd(&scatter_buff_top[ind_origin], diffuse_flux[b] * prd.strength * sigma_s / beta);
695 float fd = evaluateDiffuseAngularDistribution(ray.direction, diffuse_peak_dir[b], diffuse_extinction[b], diffuse_dist_norm[b], sky_radiance_params[b]);
697 float strength = fd * diffuse_flux[b] * prd.strength;
700 atomicAdd(&radiation_in[ind_origin], strength * (1.f - t_rho - t_tau));
702 if (t_rho > 0 || t_tau > 0) {
704 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_rho);
705 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_tau);
707 atomicFloatAdd(&scatter_buff_bottom[ind_origin], strength * t_rho);
708 atomicFloatAdd(&scatter_buff_top[ind_origin], strength * t_tau);
713 size_t indc = cam_mat_indexer(prd.source_ID, origin_position, b_global, camera_ID);
714 float t_rho_cam = rho_cam[indc];
715 float t_tau_cam = tau_cam[indc];
716 if ((t_rho_cam > 0 || t_tau_cam > 0) && prd.strength > 0) {
718 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_rho_cam);
719 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_tau_cam);
721 atomicFloatAdd(&scatter_buff_bottom_cam[ind_origin], strength * t_rho_cam);
722 atomicFloatAdd(&scatter_buff_top_cam[ind_origin], strength * t_tau_cam);
733RT_PROGRAM
void miss_camera() {
736 uint pixel_index = prd.origin_UUID;
737 size_t Npixels = camera_resolution_full.x * camera_resolution_full.y;
742 for (
size_t b = 0; b < Nbands_launch; b++) {
744 float radiance = 0.0f;
747 for (
uint s = 0; s < Nsources; s++) {
748 float flux = source_fluxes[s * Nbands_launch + b];
752 uint source_type = source_types[s];
754 if (source_type == 0 || source_type == 2) {
756 float cos_sun_angle = dot(ray.direction, sun_direction);
757 if (cos_sun_angle >= solar_disk_cos_angle && solar_disk_radiance[b] > 0.0f) {
758 radiance += solar_disk_radiance[b];
760 }
else if (source_type == 1) {
762 float radius = source_widths[s].x * 0.5f;
763 if (d_raySphereIntersect(ray.origin, ray.direction, source_positions[s], radius)) {
764 float area = 4.0f *
M_PI * radius * radius;
765 radiance += (flux / area) /
M_PI;
767 }
else if (source_type == 3) {
770 if (d_rayRectangleIntersect(ray.origin, ray.direction, source_positions[s], source_widths[s].x, source_widths[s].y, source_rotations[s], cos_angle)) {
771 float area = source_widths[s].x * source_widths[s].y;
772 radiance += (flux / area) * cos_angle /
M_PI;
774 }
else if (source_type == 4) {
777 float radius = source_widths[s].x;
778 if (d_rayDiskIntersect(ray.origin, ray.direction, source_positions[s], radius, source_rotations[s], cos_angle)) {
779 float area =
M_PI * radius * radius;
780 radiance += (flux / area) * cos_angle /
M_PI;
786 if (radiance <= 0.0f && camera_sky_radiance[b] > 0.f) {
790 float angular_weight = evaluateDiffuseAngularDistribution(ray.direction, sun_direction,
793 sky_radiance_params[b]);
795 radiance = camera_sky_radiance[b] * angular_weight;
798 if (radiance > 0.0f) {
803 size_t ind_camera = rad_indexer(pixel_index, b);
804 atomicAdd(&radiation_in_camera[ind_camera], radiance * prd.strength);
809RT_PROGRAM
void miss_pixel_label() {
811 camera_pixel_depth[prd.origin_UUID] = -1;