Enabled probe viz item for live updates of probes when working with them(auto-baking while on)

Updated debug forward mat viz to work with probe visualization
More correct premult math
Updated probe viz menu behavior to properly toggle and mark which is active
This commit is contained in:
Areloch 2019-11-22 01:30:49 -06:00
parent 72ceede272
commit 60d0e73190
6 changed files with 313 additions and 13 deletions

View file

@ -1,27 +1,70 @@
function toggleProbeViz(%mode)
{
setLightingMode("ReflectionsOnly");
if($Probes::showAttenuation == 1)
%lastMode = "Attenuation";
else if($Probes::showProbeContrib == 1)
%lastMode = "Contribution";
else if($Probes::showSpecularCubemaps == 1)
%lastMode = "Specular";
else if($Probes::showDiffuseCubemaps == 1)
%lastMode = "Diffuse";
$Probes::showAttenuation = 0;
$Probes::showSpecularCubemaps = 0;
$Probes::showDiffuseCubemaps = 0;
$Probes::showProbeContrib = 0;
for(%i=0; %i < 4; %i++)
{
EVisibilityProbesOptions.checkItem(%i, false);
}
if(%mode $= %lastMode)
{
setLightingMode("Lit");
//forces the forward materials to get dis viz properly
reInitMaterials();
return;
}
else
{
setLightingMode("ReflectionsOnly");
}
switch$(%mode)
{
case "Attenuation":
$Probes::showAttenuation = 1;
EVisibilityProbesOptions.checkItem(0, true);
case "Contribution":
$Probes::showProbeContrib = 1;
EVisibilityProbesOptions.checkItem(1, true);
case "Specular":
$Probes::showSpecularCubemaps = 1;
EVisibilityProbesOptions.checkItem(2, true);
case "Diffuse":
$Probes::showDiffuseCubemaps = 1;
EVisibilityProbesOptions.checkItem(3, true);
}
//forces the forward materials to get dis viz properly
reInitMaterials();
}
function disableProbeViz()
{
setLightingMode("Lit");
toggleProbeViz(-1);
}
function toggleProbeLiveUpdates()
{
if($Probes::liveUpdates $= "")
$Probes::liveUpdates = false;
$Probes::liveUpdates = !$Probes::liveUpdates;
EVisibilityProbesOptions.checkItem(5, $Probes::liveUpdates);
}

View file

@ -150,11 +150,10 @@ function setupEditorVisibilityMenu()
item[ 1 ] = "Show Probe Contribution" TAB "" TAB "toggleProbeViz(\"Contribution\");";
item[ 2 ] = "Show Probe Specular Reflections Only" TAB "" TAB "toggleProbeViz(\"Specular\");";
item[ 3 ] = "Show Probe Diffuse Reflections Only" TAB "" TAB "toggleProbeViz(\"Diffuse\");";
item[ 4 ] = "Enable Live Updates on Selected Probe" TAB "" TAB "";
item[ 4 ] = "-";
item[ 5 ] = "Enable Live Updates on Selected Probe" TAB "" TAB "toggleProbeLiveUpdates();";
};
%probespopup.enableItem(4, false);
%bufferVizpopup = new PopupMenu(EBufferVizModeOptions)
{
superClass = "MenuBuilder";