diff --git a/zenovis/xinxinoptix/DisneyBRDF.h b/zenovis/xinxinoptix/DisneyBRDF.h index 107b78539e..eabde964d8 100644 --- a/zenovis/xinxinoptix/DisneyBRDF.h +++ b/zenovis/xinxinoptix/DisneyBRDF.h @@ -5,10 +5,12 @@ namespace BRDFBasics{ static __inline__ __device__ -float PowerHeuristic(float a, float b) +float PowerHeuristic(float a, float b, float beta = 2.0f) { - //float t = a * a; - return b>10.0f*a?(a/(a + b + 1e-6)) : (a*a/(a*a + b*b + 1e-6)); + float t = pow(a,beta); + float t2 = pow(b, beta); + return t / (t2 + t + 1e-6); + } static __inline__ __device__ float fresnel(float cosT){ float v = clamp(1-cosT,0.0f,1.0f); diff --git a/zenovis/xinxinoptix/PTKernel.cu b/zenovis/xinxinoptix/PTKernel.cu index d07135a268..8141e41c5b 100644 --- a/zenovis/xinxinoptix/PTKernel.cu +++ b/zenovis/xinxinoptix/PTKernel.cu @@ -348,8 +348,6 @@ extern "C" __global__ void __raygen__rg() break; } - //if(prd.depth>prd.max_depth) { - if(prd.depth > prd.max_depth){ float RRprob = max(max(prd.attenuation.x, prd.attenuation.y), prd.attenuation.z); RRprob = min(RRprob, 0.99f); @@ -478,7 +476,7 @@ extern "C" __global__ void __miss__radiance() ); - float misWeight = BRDFBasics::PowerHeuristic(prd->samplePdf,envPdf); + float misWeight = BRDFBasics::PowerHeuristic(prd->samplePdf,envPdf, 1.0f); misWeight = misWeight>0.0f?misWeight:0.0f; misWeight = envPdf>0.0f?misWeight:1.0f;