Skip to content

Commit aca4771

Browse files
authored
Fix Depth (#155)
1 parent 3f00f32 commit aca4771

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

threedgut_tracer/include/3dgut/kernels/cuda/models/gaussianParticles.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ __device__ inline void processHitBwd(
498498
float3 radianceGrad,
499499
float integratedDepth,
500500
float& depth,
501-
float depthGrad) {
501+
float integratedDepthGrad) {
502502
float3 particlePosition;
503503
float3 gscl;
504504
float33 particleRotation;
@@ -550,11 +550,11 @@ __device__ inline void processHitBwd(
550550
// ===> d_hitT / d_galpha = gdist * prevTrm - residualHitT * prevTrm
551551
// = (gdist - residualHitT) * prevTrm
552552
//
553-
const float galphaRayHitGrd = (gdist - residualHitT) * transmittance * depthGrad;
553+
const float galphaRayHitGrd = (gdist - residualHitT) * transmittance * integratedDepthGrad;
554554
//
555555
// ===> d_hitT / d_gsqdist = weight / (2*gdist)
556556
// ===> d_gsqdist / d_grds = 2 * grds
557-
const float3 grdsRayHitGrd = gsqdist > 0.0f ? ((2 * grds * weight) / (2 * gdist)) * depthGrad : make_float3(0.0f);
557+
const float3 grdsRayHitGrd = gsqdist > 0.0f ? ((2 * grds * weight) / (2 * gdist)) * integratedDepthGrad : make_float3(0.0f);
558558

559559
// ---> grds = gscl * grd * dot(grd, -1 * gro)
560560
//

threedgut_tracer/include/3dgut/kernels/cuda/models/shRadiativeGaussianParticles.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ struct ShRadiativeGaussianVolumetricFeaturesParticles : Params, public ExtParams
401401
reinterpret_cast<const float3&>(featuresBackward),
402402
reinterpret_cast<float3&>(features),
403403
reinterpret_cast<const float3&>(featuresGradient),
404-
hitT,
405404
hitTBackward,
405+
hitT,
406406
hitTGradient);
407407
}
408408

0 commit comments

Comments
 (0)