Browse Source

Removed some stuff from hardware vertex buffer

Marko Pintera 13 years ago
parent
commit
9a4094c5bb

+ 0 - 81
CamelotRenderer/OgreHardwareVertexBuffer.cpp

@@ -486,87 +486,6 @@ namespace Ogre {
 
         }
 
-    }
-    //-----------------------------------------------------------------------
-    VertexDeclaration* VertexDeclaration::getAutoOrganisedDeclaration(
-		bool skeletalAnimation, bool vertexAnimation)
-    {
-        VertexDeclaration* newDecl = this->clone();
-        // Set all sources to the same buffer (for now)
-        const VertexDeclaration::VertexElementList& elems = newDecl->getElements();
-        VertexDeclaration::VertexElementList::const_iterator i;
-        unsigned short c = 0;
-        for (i = elems.begin(); i != elems.end(); ++i, ++c)
-        {
-            const VertexElement& elem = *i;
-            // Set source & offset to 0 for now, before sort
-            newDecl->modifyElement(c, 0, 0, elem.getType(), elem.getSemantic(), elem.getIndex());
-        }
-        newDecl->sort();
-        // Now sort out proper buffer assignments and offsets
-        size_t offset = 0;
-        c = 0;
-		unsigned short buffer = 0;
-        VertexElementSemantic prevSemantic = VES_POSITION;
-        for (i = elems.begin(); i != elems.end(); ++i, ++c)
-        {
-            const VertexElement& elem = *i;
-
-            bool splitWithPrev = false;
-            bool splitWithNext = false;
-            switch (elem.getSemantic())
-            {
-            case VES_POSITION:
-                // For morph animation, we need positions on their own
-                splitWithPrev = vertexAnimation;
-                splitWithNext = vertexAnimation;
-                break;
-            case VES_NORMAL:
-                // Normals can't sharing with blend weights/indices
-                splitWithPrev = (prevSemantic == VES_BLEND_WEIGHTS || prevSemantic == VES_BLEND_INDICES);
-                // All animated meshes have to split after normal
-                splitWithNext = (skeletalAnimation || vertexAnimation);
-                break;
-            case VES_BLEND_WEIGHTS:
-                // Blend weights/indices can be sharing with their own buffer only
-                splitWithPrev = true;
-                break;
-            case VES_BLEND_INDICES:
-                // Blend weights/indices can be sharing with their own buffer only
-                splitWithNext = true;
-                break;
-            case VES_DIFFUSE:
-            case VES_SPECULAR:
-            case VES_TEXTURE_COORDINATES:
-            case VES_BINORMAL:
-            case VES_TANGENT:
-                break;
-            }
-
-            if (splitWithPrev && offset)
-            {
-                ++buffer;
-                offset = 0;
-            }
-
-            prevSemantic = elem.getSemantic();
-            newDecl->modifyElement(c, buffer, offset,
-                elem.getType(), elem.getSemantic(), elem.getIndex());
-
-            if (splitWithNext)
-            {
-                ++buffer;
-                offset = 0;
-            }
-            else
-            {
-                offset += elem.getSize();
-            }
-        }
-
-        return newDecl;
-
-
     }
     //-----------------------------------------------------------------------------
     unsigned short VertexDeclaration::getMaxSource(void) const

+ 0 - 13
CamelotRenderer/OgreHardwareVertexBuffer.h

@@ -336,19 +336,6 @@ namespace Ogre {
         */
         void closeGapsInSource(void);
 
-        /** Generates a new VertexDeclaration for optimal usage based on the current
-            vertex declaration, which can be used with VertexData::reorganiseBuffers later
-            if you wish, or simply used as a template.
-		@remarks
-			Different buffer organisations and buffer usages will be returned
-            depending on the parameters passed to this method.
-        @param skeletalAnimation Whether this vertex data is going to be
-			skeletally animated
-		@param vertexAnimation Whether this vertex data is going to be vertex animated
-        */
-        VertexDeclaration* getAutoOrganisedDeclaration(bool skeletalAnimation,
-			bool vertexAnimation);
-
         /** Gets the index of the highest source value referenced by this declaration. */
         unsigned short getMaxSource(void) const;
 

+ 0 - 39
CamelotRenderer/OgreVertexIndexData.cpp

@@ -47,7 +47,6 @@ namespace Ogre {
 		mDeleteDclBinding = true;
 		vertexCount = 0;
 		vertexStart = 0;
-		hwAnimDataItemsUsed = 0;
 
 	}
 	//---------------------------------------------------------------------
@@ -60,7 +59,6 @@ namespace Ogre {
 		mDeleteDclBinding = false;
 		vertexCount = 0;
 		vertexStart = 0;
-		hwAnimDataItemsUsed = 0;
 	}
     //-----------------------------------------------------------------------
 	VertexData::~VertexData()
@@ -127,11 +125,6 @@ namespace Ogre {
 
 		// Copy reference to hardware shadow buffer, no matter whether copy data or not
         dest->hardwareShadowVolWBuffer = hardwareShadowVolWBuffer;
-
-		// copy anim data
-		dest->hwAnimationDataList = hwAnimationDataList;
-		dest->hwAnimDataItemsUsed = hwAnimDataItemsUsed;
-
         
         return dest;
 	}
@@ -666,38 +659,6 @@ namespace Ogre {
 
 
 		} // each buffer
-
-
-	}
-	//-----------------------------------------------------------------------
-	void VertexData::allocateHardwareAnimationElements(ushort count)
-	{
-		// Find first free texture coord set
-		unsigned short texCoord = 0;
-		const VertexDeclaration::VertexElementList& vel = vertexDeclaration->getElements();
-		for (VertexDeclaration::VertexElementList::const_iterator i = vel.begin(); 
-			i != vel.end(); ++i)
-		{
-			const VertexElement& el = *i;
-			if (el.getSemantic() == VES_TEXTURE_COORDINATES)
-			{
-				++texCoord;
-			}
-		}
-		assert(texCoord <= OGRE_MAX_TEXTURE_COORD_SETS);
-
-		// Increase to correct size
-		for (size_t c = hwAnimationDataList.size(); c < count; ++c)
-		{
-			// Create a new 3D texture coordinate set
-			HardwareAnimationData data;
-			data.targetVertexElement = &(vertexDeclaration->addElement(
-				vertexBufferBinding->getNextIndex(), 0, VET_FLOAT3, VES_TEXTURE_COORDINATES, texCoord++));
-
-			hwAnimationDataList.push_back(data);
-			// Vertex buffer will not be bound yet, we expect this to be done by the
-			// caller when it becomes appropriate (e.g. through a VertexAnimationTrack)
-		}
 	}
     //-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------

+ 0 - 32
CamelotRenderer/OgreVertexIndexData.h

@@ -87,19 +87,6 @@ namespace Ogre {
 		size_t vertexStart;
 		/// The number of vertices used in this operation
 		size_t vertexCount;
-
-
-		/// Struct used to hold hardware morph / pose vertex data information
-		struct HardwareAnimationData
-		{
-			const VertexElement* targetVertexElement;
-			Real parametric;
-		};
-		typedef vector<HardwareAnimationData>::type HardwareAnimationDataList;
-		/// VertexElements used for hardware morph / pose animation
-		HardwareAnimationDataList hwAnimationDataList;
-		/// Number of hardware animation data items used
-		size_t hwAnimDataItemsUsed;
 		
 		/** Clones this vertex data, potentially including replicating any vertex buffers.
 		@param copyData Whether to create new vertex buffers too or just reference the existing ones
@@ -214,25 +201,6 @@ namespace Ogre {
 			VET_COLOUR_ARGB.
 		*/
 		void convertPackedColour(VertexElementType srcType, VertexElementType destType);
-
-
-		/** Allocate elements to serve a holder of morph / pose target data 
-			for hardware morphing / pose blending.
-		@remarks
-			This method will allocate the given number of 3D texture coordinate 
-			sets for use as a morph target or target pose offset (3D position).
-			These elements will be saved in hwAnimationDataList.
-			It will also assume that the source of these new elements will be new
-			buffers which are not bound at this time, so will start the sources to 
-			1 higher than the current highest binding source. The caller is
-			expected to bind these new buffers when appropriate. For morph animation
-			the original position buffer will be the 'from' keyframe data, whilst
-			for pose animation it will be the original vertex data.
-		*/
-		void allocateHardwareAnimationElements(ushort count);
-
-
-
 	};
 
 	/** Summary class collecting together index data source information. */

+ 1 - 3
CamelotRenderer/TODO.txt

@@ -3,6 +3,7 @@ PARSED FILES:
 GpuProgram - PARSED!
 TextureState - PARSED!
  - This is just an utility class representing texture state
+HardwareVertexBuffer - PARSED!
 VertexIndexData - Just data structures
  - VertexCacheProfiler is a weird one, but I think I don't have to remove it as it might come in handy
 RenderTexture - Everything OK
@@ -44,9 +45,6 @@ HardwarePixelBuffer
  - I might consider giving PixelBox a better name. Also rename PixelFormat.h to PixelUtil.h or similar. Makes more sense.
  - _clearSliceRTT method I'm not sure what is it used for, but I might want to remove it
 
-HardwareVertexBuffer - Very neat file
- - VertexDeclaration::getAutoOrganisedDeclaration is my only complaint. It has some vertex/skeletal animation specifics I don't want.
-
 HighLevelGpuProgram - Mostly okay
  - Has some methods for loading from a file, which I wont do