Browse Source

Add some skeleton classes

Panagiotis Christopoulos Charitos 4 years ago
parent
commit
449a01a6cf

+ 6 - 0
AnKi/Renderer/ClusterBinning.cpp

@@ -0,0 +1,6 @@
+// Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#include <AnKi/Renderer/ClusterBinning.h>

+ 34 - 0
AnKi/Renderer/ClusterBinning.h

@@ -0,0 +1,34 @@
+// Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma once
+
+#include <AnKi/Renderer/RendererObject.h>
+
+namespace anki
+{
+
+/// @addtogroup renderer
+/// @{
+
+/// Bins clusterer objects to the clusterer.
+class ClusterBinning : public RendererObject
+{
+public:
+	ClusterBinning(Renderer* r);
+
+	~ClusterBinning();
+
+	ANKI_USE_RESULT Error init(const ConfigSet& config);
+
+	/// Populate the rendergraph.
+	void populateRenderGraph(RenderingContext& ctx);
+
+private:
+	void run(RenderingContext& ctx, RenderPassWorkContext& rgraphCtx);
+};
+/// @}
+
+} // end namespace anki

+ 0 - 0
AnKi/Shaders/ClusterBin.ankiprog → AnKi/Shaders/ClusterBinning.ankiprog


+ 3 - 2
AnKi/Shaders/Include/ClustererTypes.h

@@ -54,10 +54,11 @@ struct SpotLight2
 	Vec3 m_direction; ///< Light direction.
 	Vec3 m_direction; ///< Light direction.
 	F32 m_outerCos;
 	F32 m_outerCos;
 	F32 m_innerCos;
 	F32 m_innerCos;
-	Vec2 m_padding;
+	Vec3 m_edgePoints[5u]; ///< Edge points in world space
+	Vec3 m_padding;
 	Mat4 m_textureMatrix;
 	Mat4 m_textureMatrix;
 };
 };
-const U32 _ANKI_SIZEOF_SpotLight2 = 16u * ANKI_SIZEOF(U32) + ANKI_SIZEOF(Mat4);
+const U32 _ANKI_SIZEOF_SpotLight2 = 32u * ANKI_SIZEOF(U32) + ANKI_SIZEOF(Mat4);
 ANKI_SHADER_STATIC_ASSERT(sizeof(SpotLight2) == _ANKI_SIZEOF_SpotLight2);
 ANKI_SHADER_STATIC_ASSERT(sizeof(SpotLight2) == _ANKI_SIZEOF_SpotLight2);
 
 
 /// Directional light (sun).
 /// Directional light (sun).