# Changeset View

Changeset View

# Standalone View

Standalone View

# intern/cycles/kernel/kernel_path.h

Context not available. | |||||

float3 throughput, | float3 throughput, | ||||

int num_samples, | int num_samples, | ||||

PathState *state, | PathState *state, | ||||

PathRadiance *L) | PathRadiance *L, | ||||

unsigned int light_linking) | |||||

{ | { | ||||

/* path iteration */ | /* path iteration */ | ||||

for(;;) { | for(;;) { | ||||

Context not available. | |||||

visibility, | visibility, | ||||

&isect, | &isect, | ||||

NULL, | NULL, | ||||

0.0f, 0.0f); | 0.0f, 0.0f, | ||||

0x00000000); | |||||

#ifdef __LAMP_MIS__ | #ifdef __LAMP_MIS__ | ||||

if(kernel_data.integrator.use_lamp_mis && !(state->flag & PATH_RAY_CAMERA)) { | if(kernel_data.integrator.use_lamp_mis && !(state->flag & PATH_RAY_CAMERA)) { | ||||

Context not available. | |||||

/* intersect with lamp */ | /* intersect with lamp */ | ||||

float3 emission; | float3 emission; | ||||

if(indirect_lamp_emission(kg, state, &light_ray, &emission)) { | if(indirect_lamp_emission(kg, state, &light_ray, &emission, light_linking)) { | ||||

path_radiance_accum_emission(L, | path_radiance_accum_emission(L, | ||||

throughput, | throughput, | ||||

emission, | emission, | ||||

Context not available. | |||||

if(volume_segment.closure_flag & SD_SCATTER) { | if(volume_segment.closure_flag & SD_SCATTER) { | ||||

int all = kernel_data.integrator.sample_all_lights_indirect; | int all = kernel_data.integrator.sample_all_lights_indirect; | ||||

unsigned int light_linking = object_light_linking(kg, volume_sd.object); | |||||

unsigned int shadow_linking = object_shadow_linking(kg, volume_sd.object); | |||||

/* direct light sampling */ | /* direct light sampling */ | ||||

kernel_branched_path_volume_connect_light(kg, | kernel_branched_path_volume_connect_light(kg, | ||||

Context not available. | |||||

L, | L, | ||||

all, | all, | ||||

&volume_ray, | &volume_ray, | ||||

&volume_segment); | &volume_segment, | ||||

light_linking, | |||||

shadow_linking); | |||||

/* indirect sample. if we use distance sampling and take just | /* indirect sample. if we use distance sampling and take just | ||||

* one sample for direct and indirect light, we could share | * one sample for direct and indirect light, we could share | ||||

Context not available. | |||||

#ifdef __VOLUME_SCATTER__ | #ifdef __VOLUME_SCATTER__ | ||||

if(result == VOLUME_PATH_SCATTERED) { | if(result == VOLUME_PATH_SCATTERED) { | ||||

/* direct lighting */ | /* direct lighting */ | ||||

unsigned int light_linking = object_light_linking(kg, volume_sd.object); | |||||

unsigned int shadow_linking = object_shadow_linking(kg, volume_sd.object); | |||||

kernel_path_volume_connect_light(kg, | kernel_path_volume_connect_light(kg, | ||||

rng, | rng, | ||||

&volume_sd, | &volume_sd, | ||||

throughput, | throughput, | ||||

state, | state, | ||||

L); | L, | ||||

light_linking, | |||||

shadow_linking); | |||||

/* indirect light bounce */ | /* indirect light bounce */ | ||||

if(kernel_path_volume_bounce(kg, | if(kernel_path_volume_bounce(kg, | ||||

Context not available. | |||||

light_ray.dP = sd.dP; | light_ray.dP = sd.dP; | ||||

light_ray.dD = differential3_zero(); | light_ray.dD = differential3_zero(); | ||||

if(!shadow_blocked(kg, state, &light_ray, &ao_shadow)) { | unsigned int shadow_linking = object_shadow_linking(kg, sd.object); | ||||

if(!shadow_blocked(kg, state, &light_ray, &ao_shadow, shadow_linking)) { | |||||

path_radiance_accum_ao(L, | path_radiance_accum_ao(L, | ||||

throughput, | throughput, | ||||

ao_alpha, | ao_alpha, | ||||

Context not available. | |||||

#if defined(__EMISSION__) && defined(__BRANCHED_PATH__) | #if defined(__EMISSION__) && defined(__BRANCHED_PATH__) | ||||

if(kernel_data.integrator.use_direct_light) { | if(kernel_data.integrator.use_direct_light) { | ||||

int all = kernel_data.integrator.sample_all_lights_indirect; | int all = kernel_data.integrator.sample_all_lights_indirect; | ||||

unsigned int light_linking = object_light_linking(kg, sd.object); | |||||

unsigned int shadow_linking = object_shadow_linking(kg, sd.object); | |||||

kernel_branched_path_surface_connect_light(kg, | kernel_branched_path_surface_connect_light(kg, | ||||

rng, | rng, | ||||

&sd, | &sd, | ||||

Context not available. | |||||

throughput, | throughput, | ||||

1.0f, | 1.0f, | ||||

L, | L, | ||||

all); | all, | ||||

light_linking, | |||||

shadow_linking); | |||||

} | } | ||||

#endif | #endif | ||||

Context not available. | |||||

light_ray.dP = ccl_fetch(sd, dP); | light_ray.dP = ccl_fetch(sd, dP); | ||||

light_ray.dD = differential3_zero(); | light_ray.dD = differential3_zero(); | ||||

if(!shadow_blocked(kg, state, &light_ray, &ao_shadow)) | unsigned int shadow_linking = object_shadow_linking(kg, sd->object); | ||||

if(!shadow_blocked(kg, state, &light_ray, &ao_shadow, shadow_linking)) | |||||

path_radiance_accum_ao(L, throughput, ao_alpha, ao_bsdf, ao_shadow, state->bounce); | path_radiance_accum_ao(L, throughput, ao_alpha, ao_bsdf, ao_shadow, state->bounce); | ||||

} | } | ||||

} | } | ||||

Context not available. | |||||

hit_L->direct_throughput = L->direct_throughput; | hit_L->direct_throughput = L->direct_throughput; | ||||

path_radiance_copy_indirect(hit_L, L); | path_radiance_copy_indirect(hit_L, L); | ||||

kernel_path_surface_connect_light(kg, rng, sd, *hit_tp, state, hit_L); | unsigned int light_linking = object_light_linking(kg, sd->object); | ||||

unsigned int shadow_linking = object_shadow_linking(kg, sd->object); | |||||

kernel_path_surface_connect_light(kg, rng, sd, *hit_tp, state, hit_L, light_linking, shadow_linking); | |||||

if(kernel_path_surface_bounce(kg, | if(kernel_path_surface_bounce(kg, | ||||

rng, | rng, | ||||

Context not available. | |||||

lcg_state = lcg_state_init(rng, &state, 0x51633e2d); | lcg_state = lcg_state_init(rng, &state, 0x51633e2d); | ||||

} | } | ||||

bool hit = scene_intersect(kg, &ray, visibility, &isect, &lcg_state, difl, extmax); | bool hit = scene_intersect(kg, &ray, visibility, &isect, &lcg_state, difl, extmax, 0x00000000/*TODO:What goes here*/); | ||||

#else | #else | ||||

bool hit = scene_intersect(kg, &ray, visibility, &isect, NULL, 0.0f, 0.0f); | bool hit = scene_intersect(kg, &ray, visibility, &isect, NULL, 0.0f, 0.0f, 0x00000000/*TODO:What goes here*/); | ||||

#endif | #endif | ||||

#ifdef __KERNEL_DEBUG__ | #ifdef __KERNEL_DEBUG__ | ||||

Context not available. | |||||

/* intersect with lamp */ | /* intersect with lamp */ | ||||

float3 emission; | float3 emission; | ||||

if(indirect_lamp_emission(kg, &state, &light_ray, &emission)) | if(indirect_lamp_emission(kg, &state, &light_ray, &emission, 0x00000000/*TODO:What goes here*/)) | ||||

path_radiance_accum_emission(&L, throughput, emission, state.bounce); | path_radiance_accum_emission(&L, throughput, emission, state.bounce); | ||||

} | } | ||||

#endif | #endif | ||||

Context not available. | |||||

if(volume_segment.closure_flag & SD_SCATTER) { | if(volume_segment.closure_flag & SD_SCATTER) { | ||||

int all = false; | int all = false; | ||||

unsigned int light_linking = object_light_linking(kg, volume_sd.object); | |||||

unsigned int shadow_linking = object_shadow_linking(kg, volume_sd.object); | |||||

/* direct light sampling */ | /* direct light sampling */ | ||||

kernel_branched_path_volume_connect_light(kg, rng, &volume_sd, | kernel_branched_path_volume_connect_light(kg, rng, &volume_sd, | ||||

throughput, &state, &L, all, &volume_ray, &volume_segment); | throughput, &state, &L, all, &volume_ray, &volume_segment, light_linking, shadow_linking); | ||||

/* indirect sample. if we use distance sampling and take just | /* indirect sample. if we use distance sampling and take just | ||||

* one sample for direct and indirect light, we could share | * one sample for direct and indirect light, we could share | ||||

Context not available. | |||||

#ifdef __VOLUME_SCATTER__ | #ifdef __VOLUME_SCATTER__ | ||||

if(result == VOLUME_PATH_SCATTERED) { | if(result == VOLUME_PATH_SCATTERED) { | ||||

/* direct lighting */ | /* direct lighting */ | ||||

kernel_path_volume_connect_light(kg, rng, &volume_sd, throughput, &state, &L); | unsigned int light_linking = object_light_linking(kg, volume_sd.object); | ||||

unsigned int shadow_linking = object_shadow_linking(kg, volume_sd.object); | |||||

kernel_path_volume_connect_light(kg, rng, &volume_sd, throughput, &state, &L, light_linking, shadow_linking); | |||||

/* indirect light bounce */ | /* indirect light bounce */ | ||||

if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, &L, &ray)) | if(kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, &L, &ray)) | ||||

Context not available. | |||||

#endif /* __SUBSURFACE__ */ | #endif /* __SUBSURFACE__ */ | ||||

/* direct lighting */ | /* direct lighting */ | ||||

kernel_path_surface_connect_light(kg, rng, &sd, throughput, &state, &L); | unsigned int light_linking = object_light_linking(kg, sd.object); | ||||

unsigned int shadow_linking = object_shadow_linking(kg, sd.object); | |||||

kernel_path_surface_connect_light(kg, rng, &sd, throughput, &state, &L, light_linking, shadow_linking); | |||||

/* compute direct lighting and next bounce */ | /* compute direct lighting and next bounce */ | ||||

if(!kernel_path_surface_bounce(kg, rng, &sd, &throughput, &state, &L, &ray)) | if(!kernel_path_surface_bounce(kg, rng, &sd, &throughput, &state, &L, &ray)) | ||||

Context not available. |