Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Render passes: added new debug for diagnosing light estimation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBluecame committed Jul 22, 2016
1 parent 543e2a4 commit 6286b91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/core_api/renderpasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ enum intPassTypes_t
PASS_INT_DEBUG_DSDU,
PASS_INT_DEBUG_DSDV,
PASS_INT_AA_SAMPLES,
PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_DIRAC,
PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_SAMPLING,
PASS_INT_DEBUG_LIGHT_ESTIMATION_MAT_SAMPLING,
PASS_INT_TOTAL_PASSES //IMPORTANT: KEEP THIS ALWAYS IN THE LAST POSITION
};

Expand Down
6 changes: 6 additions & 0 deletions src/yafraycore/mcintegrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ inline color_t mcIntegrator_t::doLightEstimation(renderState_t &state, light_t *
colorPasses.probe_add(PASS_INT_DIFFUSE, colDiffDir, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_DIFFUSE_NO_SHADOW, colDiffNoShadow, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_GLOSSY, colGlossyDir, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_DIRAC, col, state.raylevel == 0);
}
else // area light and suchlike
{
Expand Down Expand Up @@ -248,6 +249,9 @@ inline color_t mcIntegrator_t::doLightEstimation(renderState_t &state, light_t *
}

col += ccol * invNS;

colorPasses.probe_add(PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_SAMPLING, ccol * invNS, state.raylevel == 0);

colorPasses.probe_add(PASS_INT_SHADOW, colShadow * invNS, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_MAT_INDEX_MASK_SHADOW, colShadowMatMask * invNS, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_OBJ_INDEX_MASK_SHADOW, colShadowObjMask * invNS, state.raylevel == 0);
Expand Down Expand Up @@ -318,6 +322,8 @@ inline color_t mcIntegrator_t::doLightEstimation(renderState_t &state, light_t *
}

col += ccol2 * invNS;

colorPasses.probe_add(PASS_INT_DEBUG_LIGHT_ESTIMATION_MAT_SAMPLING, ccol2 * invNS, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_DIFFUSE, colDiffDir * invNS, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_DIFFUSE_NO_SHADOW, colDiffNoShadow * invNS, state.raylevel == 0);
colorPasses.probe_add(PASS_INT_GLOSSY, colGlossyDir * invNS, state.raylevel == 0);
Expand Down
3 changes: 3 additions & 0 deletions src/yafraycore/renderpasses.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ void renderPasses_t::generate_pass_maps()
intPassMapStringInt["adv-volume-integration"] = PASS_INT_VOLUME_INTEGRATION;
intPassMapStringInt["adv-volume-transmittance"] = PASS_INT_VOLUME_TRANSMITTANCE;
intPassMapStringInt["debug-aa-samples"] = PASS_INT_AA_SAMPLES;
intPassMapStringInt["debug-light-estimation-light-dirac"] = PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_DIRAC;
intPassMapStringInt["debug-light-estimation-light-sampling"] = PASS_INT_DEBUG_LIGHT_ESTIMATION_LIGHT_SAMPLING;
intPassMapStringInt["debug-light-estimation-mat-sampling"] = PASS_INT_DEBUG_LIGHT_ESTIMATION_MAT_SAMPLING;

//Generation of reverse map (pass type -> pass_string)
for(auto it = intPassMapStringInt.begin(); it != intPassMapStringInt.end(); ++it)
Expand Down

0 comments on commit 6286b91

Please sign in to comment.