Przeglądaj źródła

Nothing important

Panagiotis Christopoulos Charitos 14 lat temu
rodzic
commit
a38295c4f2
4 zmienionych plików z 90 dodań i 53 usunięć
  1. 2 4
      anki/renderer/Is.cpp
  2. 48 48
      anki/renderer/Is.h
  3. 1 1
      anki/resource/Material.h
  4. 39 0
      anki/scene/Renderable.h

+ 2 - 4
anki/renderer/Is.cpp

@@ -25,10 +25,8 @@ namespace anki {
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
-Is::Is(Renderer& r_):
-	RenderingPass(r_),
-	sm(r_),
-	smo(r_)
+Is::Is(Renderer& r_)
+	: RenderingPass(r_), sm(r_), smo(r_)
 {}
 
 

+ 48 - 48
anki/renderer/Is.h

@@ -23,54 +23,54 @@ class SpotLight;
 /// Illumination stage
 class Is: private RenderingPass
 {
-	public:
-		Is(Renderer& r_);
-		void init(const RendererInitializer& initializer);
-		void run();
-
-		/// @name Accessors
-		/// @{
-		const Texture& getFai() const
-		{
-			return fai;
-		}
-		/// @}
-
-	private:
-		Sm sm; ///< Shadowmapping pass
-		Smo smo; /// Stencil masking optimizations pass
-		Fbo fbo; ///< This FBO writes to the Is::fai
-		Texture fai; ///< The one and only FAI
-		uint stencilRb; ///< Illumination stage stencil buffer
-		Texture copyMsDepthFai;
-		Fbo readFbo;
-		Fbo writeFbo;
-		/// Illumination stage ambient pass shader program
-		ShaderProgramResourcePointer ambientPassSProg;
-		/// Illumination stage point light shader program
-		ShaderProgramResourcePointer pointLightSProg;
-		/// Illumination stage spot light w/o shadow shader program
-		ShaderProgramResourcePointer spotLightNoShadowSProg;
-		/// Illumination stage spot light w/ shadow shader program
-		ShaderProgramResourcePointer spotLightShadowSProg;
-
-		/// The ambient pass
-		void ambientPass(const Vec3& color);
-
-		/// The point light pass
-		void pointLightPass(PointLight& plight);
-
-		/// The spot light pass
-		void spotLightPass(SpotLight& slight);
-
-		/// Used in @ref init
-		void initFbo();
-
-		/// Init the copy stuff
-		void initCopy();
-
-		/// Copy the MS depth FAI to one of our own
-		void copyDepth();
+public:
+	Is(Renderer& r_);
+	void init(const RendererInitializer& initializer);
+	void run();
+
+	/// @name Accessors
+	/// @{
+	const Texture& getFai() const
+	{
+		return fai;
+	}
+	/// @}
+
+private:
+	Sm sm; ///< Shadowmapping pass
+	Smo smo; /// Stencil masking optimizations pass
+	Fbo fbo; ///< This FBO writes to the Is::fai
+	Texture fai; ///< The one and only FAI
+	uint stencilRb; ///< Illumination stage stencil buffer
+	Texture copyMsDepthFai;
+	Fbo readFbo;
+	Fbo writeFbo;
+	/// Illumination stage ambient pass shader program
+	ShaderProgramResourcePointer ambientPassSProg;
+	/// Illumination stage point light shader program
+	ShaderProgramResourcePointer pointLightSProg;
+	/// Illumination stage spot light w/o shadow shader program
+	ShaderProgramResourcePointer spotLightNoShadowSProg;
+	/// Illumination stage spot light w/ shadow shader program
+	ShaderProgramResourcePointer spotLightShadowSProg;
+
+	/// The ambient pass
+	void ambientPass(const Vec3& color);
+
+	/// The point light pass
+	void pointLightPass(PointLight& plight);
+
+	/// The spot light pass
+	void spotLightPass(SpotLight& slight);
+
+	/// Used in @ref init
+	void initFbo();
+
+	/// Init the copy stuff
+	void initCopy();
+
+	/// Copy the MS depth FAI to one of our own
+	void copyDepth();
 };
 
 

+ 1 - 1
anki/resource/Material.h

@@ -204,7 +204,7 @@ protected:
 /// Material XML file format:
 /// @code
 /// <material>
-/// 	<renderingStage>0 to N</renderingStage> (1)
+/// 	<renderingStage>N</renderingStage> (1)
 ///
 /// 	[<passes>COLOR DEPTH</passes>] (2)
 ///

+ 39 - 0
anki/scene/Renderable.h

@@ -0,0 +1,39 @@
+#ifndef ANKI_SCENE_RENDERABLE_H
+#define ANKI_SCENE_RENDERABLE_H
+
+
+namespace anki {
+
+
+class PassLevelKey;
+class MaterialRuntime;
+class Vao;
+class Transform;
+
+
+/// XXX
+class Renderable
+{
+public:
+	/// Get VAO depending the rendering pass
+	virtual const Vao& getVao(const PassLevelKey& k) = 0;
+
+	/// Get vert ids number for rendering
+	virtual uint getVertexIdsNum(const PassLevelKey& k) = 0;
+
+	/// Get the material runtime
+	virtual MaterialRuntime& getMaterialRuntime() = 0;
+
+	/// Get current transform
+	virtual const Transform& getWorldTransform(const PassLevelKey& k) = 0;
+
+	/// Get previous transform
+	virtual const Transform& getPreviousWorldTransform(
+		const PassLevelKey& k) = 0;
+};
+
+
+} // end namespace
+
+
+#endif