Skip to content

Commit

Permalink
fix error in intersectGP
Browse files Browse the repository at this point in the history
  • Loading branch information
Cchen-77 committed Oct 31, 2024
1 parent 32a8cf4 commit cd7ce88
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scenes/gpis-1/scene.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"renderer" : {
"spp" : 1,
"spp" : 32,
"output_file" : "gpis"
},

"mediums" : [
{
"name" : "gpis-hard",
"type" : "gpis",
"marching_num_sample_points":64,
"marching_num_sample_points":32,
"marching_step_size": 10000,
"gaussian_process":{
"type":"std",
6 changes: 3 additions & 3 deletions src/FunctionLayer/Medium/GPISMedium.cpp
Original file line number Diff line number Diff line change
@@ -108,10 +108,10 @@ bool GPISMedium::intersectGP(const Ray &ray, GPRealization &gpRealization, doubl
std::vector<DerivativeType> derivativeTypes;
std::vector<double> ts;

Point3d p = ray.origin + ray.direction * (determinedStepSize * 0.1 + t);
Point3d p = ray.origin + ray.direction * (determinedStepSize * 0.01 + t);
points.push_back(p);
derivativeTypes.push_back(DerivativeType::None);
ts.push_back(determinedStepSize * 0.1 + t);
ts.push_back(determinedStepSize * 0.01 + t);

for (int i = 1; i < marchingNumSamplePoints; ++i) {
Point3d p = ray.origin + ray.direction * (i * determinedStepSize + t);
@@ -130,7 +130,7 @@ bool GPISMedium::intersectGP(const Ray &ray, GPRealization &gpRealization, doubl
points.data(), derivativeTypes.data(), nullptr, marchingNumSamplePoints, {}, EXPAND_GPREALIZATION_WITH_VALUE(gpRealization), sampler);
}
double lastV = gpRealization.values[0];
double lastT = ray.timeMin;;
double lastT = ts[0];
t = ts[0];
for (int i = 1; i < marchingNumSamplePoints; ++i) {
double curV = gpRealization.values[i];

0 comments on commit cd7ce88

Please sign in to comment.