Skip to content

Commit

Permalink
Merge pull request #1342 from zenustech/fixSSS
Browse files Browse the repository at this point in the history
Fix sss
  • Loading branch information
zhxx1987 authored Aug 2, 2023
2 parents ce75daf + 666a5d1 commit 1cee428
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion zenovis/xinxinoptix/DeflMatShader.cu
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ extern "C" __global__ void __closesthit__radiance()
prd->channelPDF = vec3(1.0f/3.0f);
if (isTrans) {
vec3 channelPDF = vec3(1.0f/3.0f);
prd->maxDistance = scatterStep>0.5f? DisneyBSDF::SampleDistance2(prd->seed, prd->sigma_t, prd->sigma_t, channelPDF) : 1e16f;
prd->maxDistance = scatterStep>0.5f? DisneyBSDF::SampleDistance2(prd->seed, extinction, extinction, channelPDF) : 1e16f;
prd->pushMat(extinction);
} else {

Expand Down
10 changes: 5 additions & 5 deletions zenovis/xinxinoptix/DisneyBSDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ namespace DisneyBSDF{
float schlickWt = BRDFBasics::SchlickWeight(abs(dot(wo, wm)));
float psss = subsurface/(1.0f + subsurface);
//event probability
float diffPr = dielectricWt ;
float sssPr = dielectricWt * subsurface;
float diffPr = dielectricWt * (1.0f - psss);
float sssPr = dielectricWt * psss;
float dielectricPr = dielectricWt * Luminance(mix(Cspec0, vec3(1.0), schlickWt));
float metalPr = metalWt * Luminance(mix(baseColor, vec3(1.0), schlickWt));
float glassPr = glassWt;
Expand Down Expand Up @@ -652,7 +652,7 @@ namespace DisneyBSDF{
if(diffPr > 0.0 && reflect)
{

vec3 d = BRDFBasics::EvalDisneyDiffuse(mix(baseColor,sssColor,subsurface)*(1.0f - psss), subsurface, roughness, sheen,
vec3 d = BRDFBasics::EvalDisneyDiffuse(mix(baseColor,sssColor,subsurface), subsurface, roughness, sheen,
Csheen, wo, wi, wm, tmpPdf) * dielectricWt * illum;
dterm = dterm + d;
f = f + d;
Expand Down Expand Up @@ -1723,8 +1723,8 @@ namespace DisneyBSDF{
//dielectricWt *= 1.0f - psub;

//event probability
float diffPr = dielectricWt;
float sssPr = dielectricWt * subsurface;
float diffPr = dielectricWt * (1.0f - psss);
float sssPr = dielectricWt * psss;
float dielectricPr = dielectricWt * Luminance(mix(Cspec0, vec3(1.0), schlickWt));
float metalPr = metalWt * Luminance(mix(baseColor, vec3(1.0), schlickWt));
float glassPr = glassWt;
Expand Down

0 comments on commit 1cee428

Please sign in to comment.