Merge pull request #1151 from Azaezel/alpha41/fixCaptureFlag

probe capture fixes
This commit is contained in:
Brian Roberts 2023-12-05 23:20:58 -06:00 committed by GitHub
commit c1eaa73ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 104 additions and 30 deletions

View file

@ -184,6 +184,10 @@ void ReflectionProbe::initPersistFields()
"@note Only works for shadow mapped lights.\n\n"
"@ingroup Lighting");
Con::addVariable("$Probes::Capturing", TypeBool, &RenderProbeMgr::smBakeReflectionProbes,
"Toggles probe rendering capture state.\n\n"
"@ingroup Lighting");
Con::addVariable("$Light::renderPreviewProbes", TypeBool, &ReflectionProbe::smRenderPreviewProbes,
"Toggles rendering of light frustums when the light is selected in the editor.\n\n"
"@note Only works for shadow mapped lights.\n\n"
@ -823,7 +827,7 @@ void ReflectionProbe::createEditorResources()
void ReflectionProbe::prepRenderImage(SceneRenderState *state)
{
if (!mEnabled || (!RenderProbeMgr::smRenderReflectionProbes && !dStrcmp(Con::getVariable("$Probes::Capturing", "0"),"1")))
if (!mEnabled || (!RenderProbeMgr::smRenderReflectionProbes || RenderProbeMgr::smBakeReflectionProbes))
return;
Point3F distVec = getRenderPosition() - state->getCameraPosition();