From: Antonio Ospite Date: Thu, 17 Aug 2006 10:58:49 +0000 (+0200) Subject: Do Depth Sorting later X-Git-Tag: vrm-0.3~23 X-Git-Url: https://git.ao2.it/vrm.git/commitdiff_plain/bfe651e97954b264507caf17365aa37c8562ded8 Do Depth Sorting later Posticipate depth sorting after BackFace culling so we have less faces to process Signed-off-by: Antonio Ospite --- diff --git a/vrm.py b/vrm.py index c7d7a87..0d35415 100755 --- a/vrm.py +++ b/vrm.py @@ -257,6 +257,7 @@ class Projector: return p + ## # Private methods # @@ -764,7 +765,7 @@ class Renderer: self._doConvertGeometricObjToMesh(workScene) - self._doSceneClipping(workScene) + #self._doSceneClipping(workScene) if config.output['JOIN_OBJECTS']: self._joinMeshObjectsInScene(workScene) @@ -775,6 +776,7 @@ class Renderer: Objects = workScene.getChildren() for obj in Objects: + if obj.getType() != 'Mesh': print "Only Mesh supported! - Skipping type:", obj.getType() @@ -786,10 +788,10 @@ class Renderer: self._doModelToWorldCoordinates(mesh, obj.matrix) - self._doObjectDepthSorting(mesh) - self._doBackFaceCulling(mesh) + self._doObjectDepthSorting(mesh) + self._doColorAndLighting(mesh) self._doEdgesStyle(mesh, edgeStyles[config.edges['STYLE']]) @@ -1051,12 +1053,20 @@ class Renderer: nmesh.faces.sort(by_max_vert_dist) nmesh.faces.reverse() + # Get visible faces + #vf = nmesh.faces + #while len(vf)>1: + # p1 = vf[0] + # insideList = + + mesh.faces.delete(1, range(0, len(mesh.faces))) for i,f in enumerate(nmesh.faces): fv = [v.index for v in f.v] mesh.faces.extend(fv) mesh.faces[i].mat = f.mat + mesh.faces[i].sel = f.sel def _doBackFaceCulling(self, mesh):