i have been playing around with the eggdata generator i use (misc/wallgenerator/wallGenerator2_V0007.py):
INVERT_ALPHA = False
from pandac.PandaModules import EggData, EggGroup, EggVertexPool, EggPolygon, \
EggVertex, VBase4, Point3D, Point2D, Vec3D, Filename, loadEggData, GlobPattern
class eggGeneratorClass:
# this one takes longer to generate
# but it automatically generates a ?optimized? version
# includes tangent and binormals as well
def __init__( self ):
self.egg = EggData()
self.vtxPool = EggVertexPool('eggvertexpool')
self.egg.addChild(self.vtxPool)
self.group = EggGroup('egggroup')
self.egg.addChild(self.group)
self.c = 0
def addSquare( self, in_position, in_color
, normal=[(0,0,1),(0,0,1),(0,0,1),(0,0,1)]
, texCoord = [[1,0],[1,1],[0,1],[0,0]] ):
epoly = EggPolygon()
self.group.addChild(epoly)
for i in xrange(4):
eprim = epoly
ev = EggVertex()
ev.setPos(Point3D(*in_position[i]))
ev.setUv(Point2D(*texCoord[i]))
ev.setNormal(Vec3D(*normal[i]))
if INVERT_ALPHA:
in_color[i][3] = 1.0-in_color[i][3]
ev.setColor(VBase4(*in_color[i]))
self.vtxPool.addVertex(ev)
eprim.addVertex(ev)
def generate( self ):
self.egg.recomputeTangentBinormal(GlobPattern(""))
self.egg.removeUnusedVertices(GlobPattern(""))
#self.save( 'tmp.egg' )
return loadEggData( self.egg )
def save( self, filename ):
self.egg.writeEgg( Filename( filename ) )
def reset( self ):
self.egg = EggData()
i’d like to know if there is a way to prevent this optimization which is done in the egg-file.
The problem really is, that if i take the bam file created from the geomvertexwriter, convert it to egg and convert it back to to bam the performance goes down quite a lot. Even if i use all possible tools like the octree-optimization tools found in the forums i cant get the speed, i get from using the geomvertexwriter version.