Skip to content

Commit

Permalink
zhxx patch
Browse files Browse the repository at this point in the history
  • Loading branch information
iaomw committed Sep 26, 2024
1 parent 1f3d4e3 commit 8a13efe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 5 additions & 3 deletions zenovis/xinxinoptix/DisneyBRDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions zenovis/xinxinoptix/PTKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a13efe

Please sign in to comment.