Skip to content
Permalink
Browse files

Fixed PhotonGI usage of geometry normal instead of shading normal

  • Loading branch information...
Dade916 committed Mar 17, 2019
1 parent 4123e41 commit b3b711419583e9554dfdd04440bb35f8c371039e
@@ -1,6 +1,30 @@
film.width = 640
film.height = 480
image.filename = scenes/bump/bump-proc.png
##
#path.clamping.variance.maxvalue = 1
##
#path.photongi.sampler.type = RANDOM
#path.photongi.sampler.type = METROPOLIS
path.photongi.photon.maxcount = 10000000
path.photongi.photon.maxdepth = 4
##
path.photongi.indirect.enabled = 1
path.photongi.indirect.maxsize = 0
#path.photongi.indirect.haltthreshold = 0.05
#path.photongi.indirect.lookup.radius = 0.15
path.photongi.indirect.lookup.radius = 0.0
#path.photongi.indirect.glossinessusagethreshold = 0.0
#path.photongi.indirect.usagethresholdscale = 0.0
#path.photongi.indirect.filter.radiusscale = 4.0
##
path.photongi.caustic.enabled = 0
path.photongi.caustic.maxsize = 10000
path.photongi.caustic.lookup.radius = 0.15
#path.photongi.debug.type = showindirect
#path.photongi.debug.type = showcaustic
#path.photongi.debug.type = showindirectpathmix
##
batch.halttime = 0
batch.haltspp = 0
scene.file = scenes/bump/bump-proc.scn
@@ -2,6 +2,15 @@ scene.camera.fieldofview = 49.1343
scene.camera.lookat = -13.205945 -67.920326 103.170464 -13.034013 -67.735992 102.202759
scene.camera.up = 0.660041 0.707676 0.252073
################################################################################
scene.textures.bumpmap.type = fbm
scene.textures.bumpmap.octaves = 8
scene.textures.bumpmap.omega = 0.5
scene.textures.bumpmap.mapping.type = globalmapping3d
scene.textures.bumpmap.mapping.transformation = 2.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 2.0 0.0 40.0 40.0 40.0 1.0
scene.textures.scaled_bumpmap.type = scale
scene.textures.scaled_bumpmap.texture1 = 0.05
scene.textures.scaled_bumpmap.texture2 = bumpmap
################################################################################
scene.materials.Cubo_Prism_01_MAT.type = glass
scene.materials.Cubo_Prism_01_MAT.kr = 1. 1. 1.
scene.materials.Cubo_Prism_01_MAT.kt = 0.8 0.8 0.8
@@ -13,6 +22,7 @@ scene.materials.Light_01_MAT.emission = 32000.000477 32000.000477 32000.000477
##
scene.materials.Ground_01_MAT.type = matte
scene.materials.Ground_01_MAT.kd = 0.8 0.8 0.8
#scene.materials.Ground_01_MAT.bumptex = scaled_bumpmap
##
#scene.materials.Ground_01_MAT.type = glossy2
#scene.materials.Ground_01_MAT.kd = 0.5 0.0 0.0
@@ -594,8 +594,6 @@ Spectrum PhotonGICache::ProcessCacheEntries(const vector<NearPhoton> &entries,
const Photon &photon = photons[nearPhoton.photonIndex];

// Using a Simpson filter here
//
// Note: the usage of shadeN instead of geometryN is intended
result += SimpsonKernel(bsdf.hitPoint.p, photon.p, maxDistance2) *
photon.alpha;
}
@@ -655,7 +653,7 @@ Spectrum PhotonGICache::GetCausticRadiance(const BSDF &bsdf) const {
entries.reserve(causticPhotonsBVH->GetEntryMaxLookUpCount());

// Flip the normal if required
const Normal n = (bsdf.hitPoint.intoObject ? 1.f: -1.f) * bsdf.hitPoint.shadeN;
const Normal n = (bsdf.hitPoint.intoObject ? 1.f: -1.f) * bsdf.hitPoint.geometryN;
float maxDistance2;
causticPhotonsBVH->GetAllNearEntries(entries, bsdf.hitPoint.p, n, maxDistance2);

@@ -170,7 +170,7 @@ bool TracePhotonsThread::TracePhotonPath(RandomGenerator &rndGen,
lightPathFlux.IsValid()) {
// Flip the normal if required
const Normal landingSurfaceNormal = ((Dot(bsdf.hitPoint.geometryN, -nextEventRay.d) > 0.f) ?
1.f : -1.f) * bsdf.hitPoint.shadeN;
1.f : -1.f) * bsdf.hitPoint.geometryN;

// Check if the point is visible
allNearEntryIndices.clear();

0 comments on commit b3b7114

Please sign in to comment.
You can’t perform that action at this time.