Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mis last modify #1168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions zenovis/xinxinoptix/DeflMatShader.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ extern "C" __global__ void __closesthit__radiance()
}
} else {
float env_weight_sum = 1e-8f;
int NSamples = prd->depth<=2?1:1;//16 / pow(4.0f, (float)prd->depth-1);
int NSamples = prd->depth==1?5:1;//16 / pow(4.0f, (float)prd->depth-1);
for(int samples=0;samples<NSamples;samples++) {
float3 lbrdf{};
bool inside = false;
Expand Down Expand Up @@ -1142,7 +1142,10 @@ extern "C" __global__ void __closesthit__radiance()
}
float misWeight = BRDFBasics::PowerHeuristic(envpdf, ffPdf);
misWeight = misWeight>0.0f?misWeight:0.0f;
prd->radiance += 1.0f / (float)NSamples *
misWeight = ffPdf>1e-5f?misWeight:1.0f;
misWeight = (ffPdf<0.1||envpdf<0.1)?misWeight:1.0f;
float add = ffPdf>1e-5f?1.0f:0.0f;
prd->radiance += add * misWeight * 1.0f / (float)NSamples *
light_attenuation / envpdf * 2.0f * (thin > 0.5f ? float3(mat2.reflectance) : lbrdf);
}
prd->radiance = float3(clamp(vec3(prd->radiance), vec3(0.0f), vec3(100.0f)));
Expand Down
6 changes: 4 additions & 2 deletions zenovis/xinxinoptix/PTKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,14 @@ extern "C" __global__ void __miss__radiance()
params.elapsedTime,
envPdf,
upperBound,
1.0
0.0

);
float misWeight = BRDFBasics::PowerHeuristic(prd->samplePdf,envPdf);
misWeight = misWeight>0.0f?misWeight:0.0f;
prd->radiance = skysample ;
misWeight = prd->depth>=1?misWeight:1.0f;
misWeight = (prd->samplePdf<0.25f||envPdf<0.25f)?misWeight:1.0f;
prd->radiance = misWeight * skysample ;
prd->done = true;
return;
}
Expand Down