Просмотр исходного кода

Editor: Indirect diffuse debug visualization

Panagiotis Christopoulos Charitos 1 месяц назад
Родитель
Сommit
6dca54495f

+ 2 - 1
AnKi/Core/App.cpp

@@ -326,7 +326,8 @@ Error App::init()
 	if(g_cvarCoreShowEditor)
 	{
 		SceneGraph::getSingleton().setCheckForResourceUpdates(true);
-		Renderer::getSingleton().getDbg().enableOptions(DbgOption::kObjectPicking | DbgOption::kIcons);
+		Renderer::getSingleton().getDbg().getOptions().m_sceneGraphIcons = true;
+		Renderer::getSingleton().getDbg().getOptions().m_objectPicking = true;
 	}
 
 	return Error::kNone;

+ 50 - 31
AnKi/Editor/EditorUi.cpp

@@ -339,51 +339,70 @@ void EditorUi::mainMenu()
 
 			if(ImGui::BeginMenu(ICON_MDI_CUBE_SCAN " Debug"))
 			{
-				Bool bBoundingBoxes = !!(Renderer::getSingleton().getDbg().getOptions() & DbgOption::kBoundingBoxes);
+				DbgOptions& options = Renderer::getSingleton().getDbg().getOptions();
+				Bool bBoundingBoxes = options.m_renderableBoundingBoxes;
 				if(ImGui::Checkbox("Visible Renderables", &bBoundingBoxes))
 				{
-					DbgOption options = Renderer::getSingleton().getDbg().getOptions();
-					if(bBoundingBoxes)
-					{
-						options |= DbgOption::kBoundingBoxes;
-					}
-					else
-					{
-						options &= ~(DbgOption::kBoundingBoxes);
-					}
-					Renderer::getSingleton().getDbg().setOptions(options);
+					options.m_renderableBoundingBoxes = bBoundingBoxes;
 				}
 
-				Bool bPhysics = !!(Renderer::getSingleton().getDbg().getOptions() & DbgOption::kPhysics);
+				Bool bPhysics = options.m_physics;
 				if(ImGui::Checkbox("Physics Bodies", &bPhysics))
 				{
-					DbgOption options = Renderer::getSingleton().getDbg().getOptions();
-					if(bPhysics)
-					{
-						options |= DbgOption::kPhysics;
-					}
-					else
-					{
-						options &= ~DbgOption::kPhysics;
-					}
-					Renderer::getSingleton().getDbg().setOptions(options);
+					options.m_physics = bPhysics;
 				}
 
-				Bool bDepthTest = !!(Renderer::getSingleton().getDbg().getOptions() & DbgOption::kDepthTest);
+				Bool bDepthTest = options.m_depthTest;
 				if(ImGui::Checkbox("Depth Test", &bDepthTest))
 				{
-					DbgOption options = Renderer::getSingleton().getDbg().getOptions();
-					if(bDepthTest)
-					{
-						options |= DbgOption::kDepthTest;
-					}
-					else
+					options.m_depthTest = bDepthTest;
+				}
+
+				ImGui::SeparatorText("Indirect Diffuse");
+				Bool bProbes = options.m_indirectDiffuseProbes;
+				if(ImGui::Checkbox("Indirect Probes", &bProbes))
+				{
+					options.m_indirectDiffuseProbes = bProbes;
+				}
+
+				ImGui::BeginDisabled(!bProbes);
+
+				// Clipmap
+				I32 clipmap = I32(options.m_indirectDiffuseProbesClipmap);
+				if(ImGui::InputInt("Clipmap", &clipmap))
+				{
+					options.m_indirectDiffuseProbesClipmap = clamp<U8>(U8(clipmap), 0, kIndirectDiffuseClipmapCount - 1);
+				}
+
+				// Clipmap type
+				if(ImGui::BeginCombo("Clipmap Type", kIndirectDiffuseClipmapsProbeTypeNames[options.m_indirectDiffuseProbesClipmapType]))
+				{
+					for(IndirectDiffuseClipmapsProbeType type : EnumIterable<IndirectDiffuseClipmapsProbeType>())
 					{
-						options &= ~DbgOption::kDepthTest;
+						const Bool selected = type == options.m_indirectDiffuseProbesClipmapType;
+						if(ImGui::Selectable(kIndirectDiffuseClipmapsProbeTypeNames[type], selected))
+						{
+							options.m_indirectDiffuseProbesClipmapType = type;
+						}
+
+						// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+						if(selected)
+						{
+							ImGui::SetItemDefaultFocus();
+						}
 					}
-					Renderer::getSingleton().getDbg().setOptions(options);
+					ImGui::EndCombo();
 				}
 
+				// Clipmap color scale
+				F32 scale = options.m_indirectDiffuseProbesClipmapColorScale;
+				if(ImGui::SliderFloat("Color Scale", &scale, 0.0f, 1.0f))
+				{
+					options.m_indirectDiffuseProbesClipmapColorScale = scale;
+				}
+
+				ImGui::EndDisabled();
+
 				ImGui::EndMenu();
 			}
 

+ 25 - 12
AnKi/Renderer/Dbg.cpp

@@ -11,6 +11,7 @@
 #include <AnKi/Renderer/ForwardShading.h>
 #include <AnKi/Renderer/ClusterBinning.h>
 #include <AnKi/Renderer/PrimaryNonRenderableVisibility.h>
+#include <AnKi/Renderer/IndirectDiffuseClipmaps.h>
 #include <AnKi/Scene.h>
 #include <AnKi/Util/Logger.h>
 #include <AnKi/Util/Enum.h>
@@ -575,7 +576,7 @@ void Dbg::drawNonRenderable(GpuSceneNonRenderableObjectType type, U32 objCount,
 	} consts;
 	consts.m_viewProjMat = getRenderingContext().m_matrices.m_viewProjection;
 	consts.m_camTrf = getRenderingContext().m_matrices.m_cameraTransform;
-	consts.m_depthFailureVisualization = !(m_options & DbgOption::kDepthTest);
+	consts.m_depthFailureVisualization = !m_options.m_depthTest;
 	cmdb.setFastConstants(&consts, sizeof(consts));
 
 	if(!objectPicking)
@@ -614,7 +615,7 @@ void Dbg::drawParticleEmitters(const InternalCtx& ictx, Bool objectPicking, Rend
 	} consts;
 	consts.m_viewProjMat = getRenderingContext().m_matrices.m_viewProjection;
 	consts.m_camTrf = getRenderingContext().m_matrices.m_cameraTransform;
-	consts.m_depthFailureVisualization = !(m_options & DbgOption::kDepthTest);
+	consts.m_depthFailureVisualization = !m_options.m_depthTest;
 	cmdb.setFastConstants(&consts, sizeof(consts));
 
 	if(!objectPicking)
@@ -649,13 +650,13 @@ void Dbg::populateRenderGraph()
 	populateRenderGraphParticleEmitters(ictx);
 
 	// Debug visualization
-	if(!!(m_options & (DbgOption::kDbgScene)))
+	if(m_options.mainDbgPass())
 	{
 		populateRenderGraphMain(ictx);
 	}
 
 	// Object picking
-	if(!!(m_options & DbgOption::kObjectPicking))
+	if(m_options.m_objectPicking)
 	{
 		populateRenderGraphObjectPicking(ictx);
 	}
@@ -774,9 +775,14 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 		pass.newBufferDependency(fvisOut.m_dependency, BufferUsageBit::kSrvGeometry);
 	}
 
+	if(m_options.m_indirectDiffuseProbes && isIndirectDiffuseClipmapsEnabled())
+	{
+		getIndirectDiffuseClipmaps().setDependenciesForDrawDebugProbes(pass);
+	}
+
 	pass.setWork([this, ictx](RenderPassWorkContext& rgraphCtx) {
 		ANKI_TRACE_SCOPED_EVENT(Dbg);
-		ANKI_ASSERT(!!(m_options & DbgOption::kDbgScene));
+		ANKI_ASSERT(m_options.mainDbgPass());
 
 		CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
@@ -785,7 +791,7 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 		cmdb.setDepthWrite(false);
 
 		cmdb.setBlendFactors(0, BlendFactor::kSrcAlpha, BlendFactor::kOneMinusSrcAlpha);
-		cmdb.setDepthCompareOperation(!!(m_options & DbgOption::kDepthTest) ? CompareOperation::kLess : CompareOperation::kAlways);
+		cmdb.setDepthCompareOperation(m_options.m_depthTest ? CompareOperation::kLess : CompareOperation::kAlways);
 		cmdb.setLineWidth(2.0f);
 
 		rgraphCtx.bindSrv(0, 0, getGBuffer().getDepthRt());
@@ -810,7 +816,7 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 			} consts;
 			consts.m_color = Vec4(1.0f, 1.0f, 0.0f, 1.0f);
 			consts.m_viewProjMat = getRenderingContext().m_matrices.m_viewProjection;
-			consts.m_depthFailureVisualization = !(m_options & DbgOption::kDepthTest);
+			consts.m_depthFailureVisualization = !m_options.m_depthTest;
 
 			cmdb.setFastConstants(&consts, sizeof(consts));
 			cmdb.bindVertexBuffer(0, BufferView(m_boxLines.m_positionsBuff.get()), sizeof(Vec3));
@@ -820,7 +826,7 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 
 		// GBuffer AABBs
 		const U32 gbufferAllAabbCount = GpuSceneArrays::RenderableBoundingVolumeGBuffer::getSingleton().getElementCount();
-		if(!!(m_options & DbgOption::kBoundingBoxes) && gbufferAllAabbCount)
+		if(m_options.m_renderableBoundingBoxes && gbufferAllAabbCount)
 		{
 			cmdb.bindSrv(1, 0, GpuSceneArrays::RenderableBoundingVolumeGBuffer::getSingleton().getBufferView());
 
@@ -832,7 +838,7 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 
 		// Forward shading renderables
 		const U32 forwardAllAabbCount = GpuSceneArrays::RenderableBoundingVolumeForward::getSingleton().getElementCount();
-		if(!!(m_options & DbgOption::kBoundingBoxes) && forwardAllAabbCount)
+		if(m_options.m_renderableBoundingBoxes && forwardAllAabbCount)
 		{
 			cmdb.bindSrv(1, 0, GpuSceneArrays::RenderableBoundingVolumeForward::getSingleton().getBufferView());
 
@@ -843,7 +849,7 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 		}
 
 		// Draw non-renderables
-		if(!!(m_options & DbgOption::kIcons))
+		if(m_options.m_sceneGraphIcons)
 		{
 			drawNonRenderable(GpuSceneNonRenderableObjectType::kLight, GpuSceneArrays::Light::getSingleton().getElementCount(), *m_pointLightImage,
 							  false, rgraphCtx);
@@ -856,13 +862,13 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 		}
 
 		// Particle emitter icons
-		if(!!(m_options & DbgOption::kIcons))
+		if(m_options.m_sceneGraphIcons)
 		{
 			drawParticleEmitters(ictx, false, rgraphCtx);
 		}
 
 		// Physics
-		if(!!(m_options & DbgOption::kPhysics))
+		if(m_options.m_physics)
 		{
 			class MyPhysicsDebugDrawerInterface final : public PhysicsDebugDrawerInterface
 			{
@@ -920,6 +926,13 @@ void Dbg::populateRenderGraphMain(InternalCtx& ictx)
 			}
 		}
 
+		if(m_options.m_indirectDiffuseProbes && isIndirectDiffuseClipmapsEnabled())
+		{
+			getIndirectDiffuseClipmaps().drawDebugProbes(rgraphCtx, m_options.m_indirectDiffuseProbesClipmap,
+														 m_options.m_indirectDiffuseProbesClipmapType,
+														 m_options.m_indirectDiffuseProbesClipmapColorScale);
+		}
+
 		if(m_gizmos.m_enabled)
 		{
 			cmdb.setDepthCompareOperation(CompareOperation::kAlways);

+ 39 - 29
AnKi/Renderer/Dbg.h

@@ -7,31 +7,46 @@
 
 #include <AnKi/Renderer/RendererObject.h>
 #include <AnKi/Renderer/Utils/Readback.h>
+#include <AnKi/Renderer/IndirectDiffuseClipmaps.h>
 #include <AnKi/Gr.h>
 #include <AnKi/Util/Enum.h>
 
 namespace anki {
 
-enum class DbgOption : U8
+class DbgOptions
 {
-	kNone = 0,
-
-	// Flags that draw something somewhere
-	kBoundingBoxes = 1 << 0,
-	kIcons = 1 << 1,
-	kPhysics = 1 << 2,
-	kObjectPicking = 1 << 3,
-	kSelectedObjectOutline = 1 << 4,
-
-	// Flags that affect how things are drawn
-	kDepthTest = 1 << 5,
-
-	// Agregate flags
-	kGatherAabbs = kBoundingBoxes | kObjectPicking,
-	kDbgScene = kBoundingBoxes | kIcons | kPhysics | kSelectedObjectOutline,
-	kDbgEnabled = kDbgScene | kObjectPicking | kSelectedObjectOutline,
+public:
+	// Main pass:
+	Bool m_renderableBoundingBoxes : 1 = false;
+	Bool m_sceneGraphIcons : 1 = false;
+	Bool m_physics : 1 = false;
+	Bool m_indirectDiffuseProbes : 1 = false;
+
+	U8 m_indirectDiffuseProbesClipmap = 0;
+	IndirectDiffuseClipmapsProbeType m_indirectDiffuseProbesClipmapType = IndirectDiffuseClipmapsProbeType::kIrradiance;
+	F32 m_indirectDiffuseProbesClipmapColorScale = 1.0f;
+
+	// Object picking:
+	Bool m_objectPicking : 1 = false;
+
+	// Misc flags:
+	Bool m_depthTest : 1 = true;
+
+	Bool visibilityShouldGatherAabbs() const
+	{
+		return m_renderableBoundingBoxes || m_objectPicking;
+	}
+
+	Bool mainDbgPass() const
+	{
+		return m_renderableBoundingBoxes || m_sceneGraphIcons || m_physics || m_indirectDiffuseProbes;
+	}
+
+	Bool dgbEnabled() const
+	{
+		return mainDbgPass() || m_objectPicking;
+	}
 };
-ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(DbgOption)
 
 class DbgObjectPickingResult
 {
@@ -66,29 +81,24 @@ public:
 		return m_runCtx.m_rt;
 	}
 
-	void setOptions(DbgOption options)
+	const DbgOptions& getOptions() const
 	{
-		m_options = options;
-	}
-
-	void enableOptions(DbgOption options)
-	{
-		m_options |= options;
+		return m_options;
 	}
 
-	DbgOption getOptions() const
+	DbgOptions& getOptions()
 	{
 		return m_options;
 	}
 
 	Bool isEnabled() const
 	{
-		return !!(m_options & DbgOption::kDbgEnabled);
+		return m_options.dgbEnabled();
 	}
 
 	const DbgObjectPickingResult& getObjectPickingResultAtMousePosition() const
 	{
-		ANKI_ASSERT(!!(m_options & DbgOption::kObjectPicking));
+		ANKI_ASSERT(m_options.m_objectPicking);
 		return m_runCtx.m_objPickingRes;
 	}
 
@@ -155,7 +165,7 @@ private:
 		Bool m_enableDepthTest = false;
 	} m_debugPoint;
 
-	DbgOption m_options = DbgOption::kDepthTest;
+	DbgOptions m_options;
 
 	class
 	{

+ 2 - 2
AnKi/Renderer/FinalComposite.cpp

@@ -107,7 +107,7 @@ void FinalComposite::populateRenderGraph()
 
 	pass.newTextureDependency(outRt, TextureUsageBit::kRtvDsvWrite);
 
-	if(!!(getDbg().getOptions() & DbgOption::kDbgScene))
+	if(getDbg().getOptions().mainDbgPass())
 	{
 		pass.newTextureDependency(getRenderer().getDbg().getRt(), TextureUsageBit::kSrvPixel);
 	}
@@ -137,7 +137,7 @@ void FinalComposite::populateRenderGraph()
 		ANKI_TRACE_SCOPED_EVENT(FinalComposite);
 
 		CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
-		const Bool dbgEnabled = !!(getDbg().getOptions() & DbgOption::kDbgScene);
+		const Bool dbgEnabled = getDbg().getOptions().mainDbgPass();
 
 		Array<RenderTargetHandle, U32(DebugRenderTargetRegister::kCount)> dbgRts;
 		DebugRenderTargetDrawStyle drawStyle;

+ 1 - 1
AnKi/Renderer/ForwardShading.cpp

@@ -35,7 +35,7 @@ void ForwardShading::populateRenderGraph()
 	visIn.m_lodReferencePoint = getRenderingContext().m_matrices.m_cameraTransform.getTranslationPart().xyz;
 	visIn.m_lodDistances = lodDistances;
 	visIn.m_rgraph = &rgraph;
-	visIn.m_gatherAabbIndices = !!(getDbg().getOptions() & DbgOption::kGatherAabbs);
+	visIn.m_gatherAabbIndices = getDbg().getOptions().visibilityShouldGatherAabbs();
 	RenderTargetHandle hzb = getGBuffer().getHzbRt();
 	visIn.m_hzbRt = &hzb;
 	visIn.m_viewportSize = getRenderer().getInternalResolution();

+ 1 - 1
AnKi/Renderer/GBuffer.cpp

@@ -106,7 +106,7 @@ void GBuffer::populateRenderGraph()
 		visIn.m_lodDistances = lodDistances;
 		visIn.m_rgraph = &rgraph;
 		visIn.m_hzbRt = &m_runCtx.m_hzbRt;
-		visIn.m_gatherAabbIndices = !!(getDbg().getOptions() & DbgOption::kGatherAabbs);
+		visIn.m_gatherAabbIndices = getDbg().getOptions().visibilityShouldGatherAabbs();
 		visIn.m_viewportSize = getRenderer().getInternalResolution();
 		visIn.m_twoPhaseOcclusionCulling = getRenderer().getMeshletRenderingType() != MeshletRenderingType::kNone;
 

+ 46 - 5
AnKi/Renderer/IndirectDiffuseClipmaps.cpp

@@ -158,6 +158,15 @@ static void computeClipmapBounds(Vec3 cameraPos, Vec3 lookDir, U32 clipmapIdx, I
 	ANKI_ASSERT(aabbMax - consts.m_aabbMins[clipmapIdx].xyz == consts.m_sizes[clipmapIdx].xyz);
 }
 
+IndirectDiffuseClipmaps::IndirectDiffuseClipmaps()
+{
+	registerDebugRenderTarget("IndirectDiffuseClipmaps");
+}
+
+IndirectDiffuseClipmaps::~IndirectDiffuseClipmaps()
+{
+}
+
 Error IndirectDiffuseClipmaps::init()
 {
 	ANKI_CHECK(RtMaterialFetchRendererObject::init());
@@ -831,20 +840,34 @@ void IndirectDiffuseClipmaps::populateRenderGraph()
 	m_runCtx.m_handles.m_appliedIrradiance = historyRt;
 }
 
-void IndirectDiffuseClipmaps::drawDebugProbes(RenderPassWorkContext& rgraphCtx) const
+void IndirectDiffuseClipmaps::drawDebugProbes(RenderPassWorkContext& rgraphCtx, U8 clipmap, IndirectDiffuseClipmapsProbeType probeType,
+											  F32 colorScale) const
 {
+	ANKI_ASSERT(clipmap < kIndirectDiffuseClipmapCount);
 	CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
-	const U32 clipmap = 0;
-
 	cmdb.bindShaderProgram(m_visProbesGrProg.get());
 
-	const UVec4 consts(clipmap);
+	const UVec4 consts(clipmap, asU32(colorScale), 0, 0);
 	cmdb.setFastConstants(&consts, sizeof(consts));
 
 	cmdb.bindConstantBuffer(0, 0, getRenderingContext().m_globalRenderingConstantsBuffer);
 
-	const RenderTargetHandle visVolume = m_runCtx.m_handles.m_radianceVolumes[clipmap];
+	RenderTargetHandle visVolume;
+	if(probeType == IndirectDiffuseClipmapsProbeType::kRadiance)
+	{
+		visVolume = m_runCtx.m_handles.m_radianceVolumes[clipmap];
+	}
+	else if(probeType == IndirectDiffuseClipmapsProbeType::kIrradiance)
+	{
+		visVolume = m_runCtx.m_handles.m_irradianceVolumes[clipmap];
+	}
+	else
+	{
+		ANKI_ASSERT(probeType == IndirectDiffuseClipmapsProbeType::kAverageIrradiance);
+		visVolume = m_runCtx.m_handles.m_avgIrradianceVolumes[clipmap];
+	}
+
 	rgraphCtx.bindSrv(0, 0, visVolume);
 	rgraphCtx.bindSrv(1, 0, m_runCtx.m_handles.m_probeValidityVolumes[clipmap]);
 	cmdb.bindSampler(0, 0, getRenderer().getSamplers().m_trilinearRepeat.get());
@@ -852,4 +875,22 @@ void IndirectDiffuseClipmaps::drawDebugProbes(RenderPassWorkContext& rgraphCtx)
 	cmdb.draw(PrimitiveTopology::kTriangles, 36, m_consts.m_totalProbeCount);
 }
 
+void IndirectDiffuseClipmaps::setDependenciesForDrawDebugProbes(RenderPassBase& pass)
+{
+	for(RenderTargetHandle& handle : m_runCtx.m_handles.m_radianceVolumes)
+	{
+		pass.newTextureDependency(handle, TextureUsageBit::kSrvPixel);
+	}
+
+	for(RenderTargetHandle& handle : m_runCtx.m_handles.m_irradianceVolumes)
+	{
+		pass.newTextureDependency(handle, TextureUsageBit::kSrvPixel);
+	}
+
+	for(RenderTargetHandle& handle : m_runCtx.m_handles.m_avgIrradianceVolumes)
+	{
+		pass.newTextureDependency(handle, TextureUsageBit::kSrvPixel);
+	}
+}
+
 } // end namespace anki

+ 21 - 5
AnKi/Renderer/IndirectDiffuseClipmaps.h

@@ -73,14 +73,27 @@ public:
 	Array<RenderTargetHandle, kIndirectDiffuseClipmapCount> m_avgIrradianceVolumes;
 };
 
+enum class IndirectDiffuseClipmapsProbeType : U8
+{
+	kRadiance,
+	kIrradiance,
+	kAverageIrradiance,
+
+	kCount,
+	kFirst = 0
+};
+ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(IndirectDiffuseClipmapsProbeType)
+
+inline constexpr Array<const Char*, U32(IndirectDiffuseClipmapsProbeType::kCount)> kIndirectDiffuseClipmapsProbeTypeNames = {"Radiance", "Irradiance",
+																															 "Avg Irradiance"};
+
 // Indirect diffuse based on clipmaps of probes.
 class IndirectDiffuseClipmaps : public RtMaterialFetchRendererObject
 {
 public:
-	IndirectDiffuseClipmaps()
-	{
-		registerDebugRenderTarget("IndirectDiffuseClipmaps");
-	}
+	IndirectDiffuseClipmaps();
+
+	~IndirectDiffuseClipmaps();
 
 	Error init();
 
@@ -98,7 +111,10 @@ public:
 		return m_consts;
 	}
 
-	void drawDebugProbes(RenderPassWorkContext& rgraphCtx) const;
+	void drawDebugProbes(RenderPassWorkContext& rgraphCtx, U8 clipmap, IndirectDiffuseClipmapsProbeType probeType, F32 colorScale) const;
+
+	// Set the dependencies before calling drawDebugProbes()
+	void setDependenciesForDrawDebugProbes(RenderPassBase& pass);
 
 	const IndirectDiffuseClipmapsRenderTargetHandles& getRts() const
 	{

+ 0 - 6
AnKi/Renderer/LightShading.cpp

@@ -208,12 +208,6 @@ void LightShading::run(RenderPassWorkContext& rgraphCtx)
 		cmdb.popDebugMarker();
 	}
 
-	// Debug stuff
-	if(g_cvarRenderVisualizeGiProbes && getRenderer().isIndirectDiffuseClipmapsEnabled())
-	{
-		getIndirectDiffuseClipmaps().drawDebugProbes(rgraphCtx);
-	}
-
 	// Forward shading last
 	{
 		cmdb.pushDebugMarker("ForwardShading", Vec3(0.0f, 1.0f, 1.0f));

+ 5 - 2
AnKi/Shaders/IndirectDiffuseClipmaps.ankiprog

@@ -962,7 +962,7 @@ struct FragOut
 struct Consts
 {
 	U32 m_clipmapIdx;
-	U32 m_padding1;
+	F32 m_colorScaleFactor;
 	U32 m_padding2;
 	U32 m_padding3;
 };
@@ -1079,7 +1079,10 @@ FragOut main(VertOut input)
 		radiance = Vec3(1.0, 0.0, 1.0);
 	}
 
-	output.m_color = Vec4(radiance, 0.0);
+	output.m_color = Vec4(radiance, 1.0);
+
+	output.m_color.xyz *= g_consts.m_colorScaleFactor;
+
 	return output;
 }
 #	endif // ANKI_PIXEL_SHADER

+ 3 - 3
AnKi/Shaders/Sky.hlsl

@@ -67,9 +67,9 @@ Vec3 sunWithBloom(Vec3 rayDir, Vec3 dirToSun)
 	return gaussianBloom + invBloom;
 }
 
-/// Compute the sky color.
-/// @param rayDir It's the vector: normalize(frag-cameraOrigin)
-/// @param dirToSun It's opposite direction the light travels.
+// Compute the sky color.
+// rayDir: It's the vector: normalize(frag-cameraOrigin)
+// dirToSun: It's opposite direction the light travels.
 Vec3 computeSkyColor(Texture2D<Vec4> skyLut, SamplerState linearAnyClampSampler, Vec3 rayDir, Vec3 dirToSun, F32 sunPower, Bool drawSun)
 {
 	Vec3 col = getValFromSkyLut(skyLut, linearAnyClampSampler, rayDir, dirToSun);

+ 0 - 24
Samples/Common/SampleApp.cpp

@@ -108,30 +108,6 @@ Error SampleApp::userMainLoop(Bool& quit, Second elapsedTime)
 		mousePosOn1stClick = in.getMousePositionNdc();
 	}
 
-	if(in.getKey(KeyCode::kF1) == 1)
-	{
-		DbgOption options = renderer.getDbg().getOptions();
-
-		static U mode = 0;
-		mode = (mode + 1) % 3;
-		if(mode == 0)
-		{
-			options &= ~DbgOption::kBoundingBoxes;
-		}
-		else if(mode == 1)
-		{
-			options |= DbgOption::kBoundingBoxes;
-			options |= DbgOption::kDepthTest;
-		}
-		else
-		{
-			options |= DbgOption::kBoundingBoxes;
-			options &= ~DbgOption::kDepthTest;
-		}
-
-		renderer.getDbg().setOptions(options);
-	}
-
 #if ANKI_TRACING_ENABLED
 	if(in.getKey(KeyCode::kF11) == 1)
 	{

+ 0 - 48
Sandbox/Main.cpp

@@ -124,30 +124,6 @@ Error MyApp::userMainLoop(Bool& quit, Second elapsedTime)
 		mover->setLocalOrigin(origin + Vec3(0, 15, 0));
 	}
 
-	if(in.getKey(KeyCode::kF1) == 1)
-	{
-		DbgOption options = renderer.getDbg().getOptions();
-
-		static U mode = 0;
-		mode = (mode + 1) % 3;
-		if(mode == 0)
-		{
-			options &= ~DbgOption::kBoundingBoxes;
-		}
-		else if(mode == 1)
-		{
-			options |= DbgOption::kBoundingBoxes;
-			options |= DbgOption::kDepthTest;
-		}
-		else
-		{
-			options |= DbgOption::kBoundingBoxes;
-			options &= ~DbgOption::kDepthTest;
-		}
-
-		renderer.getDbg().setOptions(options);
-	}
-
 #if ANKI_TRACING_ENABLED
 	if(in.getKey(KeyCode::kF11) == 1)
 	{
@@ -175,30 +151,6 @@ Error MyApp::userMainLoop(Bool& quit, Second elapsedTime)
 			mover = &scene.getActiveCameraNode();
 		}
 
-		if(in.getKey(KeyCode::kF1) == 1)
-		{
-			DbgOption options = renderer.getDbg().getOptions();
-
-			static U mode = 0;
-			mode = (mode + 1) % 3;
-			if(mode == 0)
-			{
-				options &= ~DbgOption::kBoundingBoxes;
-			}
-			else if(mode == 1)
-			{
-				options |= DbgOption::kBoundingBoxes;
-				options |= DbgOption::kDepthTest;
-			}
-			else
-			{
-				options |= DbgOption::kBoundingBoxes;
-				options &= ~DbgOption::kDepthTest;
-			}
-
-			renderer.getDbg().setOptions(options);
-		}
-
 		if(in.getKey(KeyCode::kUp) > 0)
 		{
 			mover->rotateLocalX(ROTATE_ANGLE);