Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhxx1987 committed Jan 3, 2024
1 parent ec6ffe1 commit f6bca99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions zenovis/xinxinoptix/DisneyBSDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ namespace DisneyBSDF{
{

vec3 d = BRDFBasics::EvalDisneyDiffuse(thin? mat.basecolor:mix(mat.basecolor,mat.sssColor,mat.subsurface), mat.subsurface, mat.roughness, mat.sheen,
Csheen, wo, wi, wm, tmpPdf) * dielectricWt * illum;
Csheen, wo, wi, wm, tmpPdf) * dielectricWt;
dterm = dterm + d;
f = f + d;
fPdf += tmpPdf * diffPr ;
Expand All @@ -403,7 +403,7 @@ namespace DisneyBSDF{
float ax, ay;
BRDFBasics::CalculateAnisotropicParams(mat.roughness,mat.anisotropic,ax,ay);
vec3 s = BRDFBasics::EvalMicrofacetReflection(ax, ay, wo, wi, wm,
mix(Cspec0, vec3(1.0f), F) * mat.specular, tmpPdf) * dielectricWt * illum;
mix(Cspec0, vec3(1.0f), F) * mat.specular, tmpPdf) * dielectricWt;
sterm = sterm + s;
f = f + s;
fPdf += tmpPdf * dielectricPr;
Expand All @@ -413,7 +413,7 @@ namespace DisneyBSDF{
vec3 F = mix(mat.basecolor, vec3(1.0), BRDFBasics::SchlickWeight(HoV));
float ax, ay;
BRDFBasics::CalculateAnisotropicParams(mat.roughness,mat.anisotropic,ax,ay);
vec3 s = BRDFBasics::EvalMicrofacetReflection(ax, ay, wo, wi, wm, F, tmpPdf) * metalWt * illum;
vec3 s = BRDFBasics::EvalMicrofacetReflection(ax, ay, wo, wi, wm, F, tmpPdf) * metalWt;
sterm = sterm + s;
f = f + s;
fPdf += tmpPdf * metalPr;
Expand Down Expand Up @@ -451,7 +451,7 @@ namespace DisneyBSDF{
wo, wi, wm,
vec3(F), tmpPdf);

vec3 t = brdf * glassWt * illum;
vec3 t = brdf * glassWt;
tterm = tterm + t;
f = f + t;
fPdf += tmpPdf * glassPr * (1.0 - F);
Expand All @@ -464,7 +464,7 @@ namespace DisneyBSDF{
{
vec3 wm = normalize(wi + wo);
vec3 s = BRDFBasics::EvalClearcoat(mat.clearcoatRoughness, wo, wi,
wm, tmpPdf) * 0.25 * mat.clearcoat * illum;
wm, tmpPdf) * 0.25 * mat.clearcoat;
sterm = sterm + s;
f = f + s;
fPdf += tmpPdf * clearCtPr;
Expand Down
12 changes: 6 additions & 6 deletions zenovis/xinxinoptix/TraceStuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ struct RadiancePRD
}

void offsetUpdateRay(float3& P, float3 new_dir) {
double x = (double)(P.x) - (double)(this->camPos.x);
double y = (double)(P.y) - (double)(this->camPos.y);
double z = (double)(P.z) - (double)(this->camPos.z);
double x = (double)(P.x);
double y = (double)(P.y);
double z = (double)(P.z);
auto beforeOffset = make_float3(x, y, z);
//this->origin = P;
this->direction = new_dir;
offsetRay(beforeOffset, new_dir);
double x2 = (double)(beforeOffset.x) + (double)(this->camPos.x);
double y2 = (double)(beforeOffset.y) + (double)(this->camPos.y);
double z2 = (double)(beforeOffset.z) + (double)(this->camPos.z);
double x2 = (double)(beforeOffset.x);
double y2 = (double)(beforeOffset.y);
double z2 = (double)(beforeOffset.z);
this->origin = make_float3(x2, y2, z2);
}

Expand Down

0 comments on commit f6bca99

Please sign in to comment.