diff --git a/zenovis/xinxinoptix/DeflMatShader.cu b/zenovis/xinxinoptix/DeflMatShader.cu index abe384de7..4fcabf34a 100644 --- a/zenovis/xinxinoptix/DeflMatShader.cu +++ b/zenovis/xinxinoptix/DeflMatShader.cu @@ -658,8 +658,6 @@ extern "C" __global__ void __closesthit__radiance() } prd->attenuation2 = prd->attenuation; prd->passed = true; - prd->adepth++; - //prd->samplePdf = 0.0f; //you shall pass! prd->radiance = make_float3(0.0f); prd->_tmin_ = optixGetRayTmax(); diff --git a/zenovis/xinxinoptix/Light.cu b/zenovis/xinxinoptix/Light.cu index bc53d54cc..c908ca096 100644 --- a/zenovis/xinxinoptix/Light.cu +++ b/zenovis/xinxinoptix/Light.cu @@ -282,6 +282,8 @@ extern "C" __global__ void __closesthit__radiance() // if (scatterPDF > __FLT_DENORM_MIN__) { // prd->radiance /= scatterPDF; // } + auto tmp = float3{1, 1, 1}; + prd->updateAttenuation(tmp); } return; } diff --git a/zenovis/xinxinoptix/PTKernel.cu b/zenovis/xinxinoptix/PTKernel.cu index 4ee331326..71fdb8054 100644 --- a/zenovis/xinxinoptix/PTKernel.cu +++ b/zenovis/xinxinoptix/PTKernel.cu @@ -244,7 +244,7 @@ extern "C" __global__ void __raygen__rg() RadiancePRD prd; prd.pixel_area = cam.height/(float)(h)/(cam.focal_length); - prd.adepth = 0; + prd.emission = make_float3(0.f); prd.radiance = make_float3(0.f); prd.attenuation = make_float3(1.f); @@ -344,11 +344,11 @@ extern "C" __global__ void __raygen__rg() prd.done = true; } - if( prd.done || params.simpleRender==true || prd.adepth>64){ + if( prd.done || prd.depth>prd.max_depth){ break; } - if(prd.depth > prd.max_depth){ + if(prd.depth > 1){ float RRprob = max(max(prd.attenuation.x, prd.attenuation.y), prd.attenuation.z); RRprob = min(RRprob, 0.99f); if(rnd(prd.seed) > RRprob) { diff --git a/zenovis/xinxinoptix/TraceStuff.h b/zenovis/xinxinoptix/TraceStuff.h index d1ee36460..25659fa3d 100644 --- a/zenovis/xinxinoptix/TraceStuff.h +++ b/zenovis/xinxinoptix/TraceStuff.h @@ -103,7 +103,6 @@ struct RadiancePRD int curMatIdx; float samplePdf; bool fromDiff; - unsigned char adepth; bool alphaHit; vec3 mask_value; vec3 click_pos;