Ejemplo n.º 1
0
def initializeScene(infile, subdivision=10.0):
    scene = readScene(infile)
    patches = createPatches(scene, applyMacros(scene), subdivision)
    arrays = createGlArraysForPatches(patches) # from experimentCachingFormFactors, arrays are slightly faster
    formfactorengine = HemicubeFormFactorEngine(patches=patches, resolution=256, arrays=arrays)

    return scene, patches, formfactorengine
Ejemplo n.º 2
0
        def setUp(self):
            self.infile = "./xml_test_files/test_scene.xml"
            self.inscene = readScene(self.infile)
            self.transformations = applyMacros(self.inscene)

            self.triangleset = self.inscene.get_head().get_objectdef()[0].get_triangleset()[0]
            self.triangleset_objectdef = self.inscene.get_head().get_objectdef()[0]

            self.cuboid = self.inscene.get_head().get_objectdef()[3].get_cuboid()[0]
            self.cuboid_objectdef = self.inscene.get_head().get_objectdef()[3]

            self.barrel_objectdef = self.inscene.get_head().get_objectdef()[2]
            self.barrel = self.barrel_objectdef.get_barrel()[0]

            self.teapot_objectdef = self.inscene.get_head().get_objectdef()[4]
            self.teapot = self.teapot_objectdef.get_teapot()[0]
Ejemplo n.º 3
0
        def setUp(self):
            self.infile = "./xml_test_files/test_scene_radiosity_relaxation.xml"
            self.reffile = "./xml_test_files/test_scene_rr_rrv_computed.xml"

            self.outfileJacobi = "./xml_test_files/test_scene_jacobi_iteration.xml"
            self.outfileGaussSeidel = "./xml_test_files/test_scene_gauss_seidel.xml"
            self.outfileSouthwell = "./xml_test_files/test_scene_southwell.xml"
            self.outfileProgressiveRefinement = "./xml_test_files/test_scene_progressive_refinement.xml"

            self.resolution = 256

            self.inscene = readScene(self.infile)
            self.patches = createPatches(self.inscene, applyMacros(self.inscene), 1000000.0) # to ensure no subdivision
            
            self.formfactorengine = HemicubeFormFactorEngine(patches=self.patches, resolution=self.resolution)
            # cache all the form factors for every patch
            self.cached_form_factors = {}
            for patch in self.patches:
                self.cached_form_factors[patch] = self.formfactorengine.computeFormFactorsForPatch(patch)
Ejemplo n.º 4
0
 def setUp(self):
     self.infile = "./xml_test_files/test_scene_xmlscenewriter.xml"
     self.inscene = readScene(self.infile)
     self.outfile = "./xml_test_files/test_scene_xmlscenewriter_rewritten.xml"
     writeScene(self.inscene, self.outfile)
     self.scene = readScene(self.outfile)
Ejemplo n.º 5
0
 def setUp(self):
     self.infile = "./xml_test_files/test_scene_xmlscene_functions.xml"
     self.inscene = readScene(self.infile)
Ejemplo n.º 6
0
 def setUp(self):
     self.infile = "./test_scene.xml"
     self.inscene = readScene(self.infile)
Ejemplo n.º 7
0
                    use_display_list = True
                    use_gl_arrays = False
                elif arg == "arrays":
                    use_gl_arrays = True
                    use_display_list = False
    except:
        sys.exit(2)

    if do_cache_timing is True:
        for i in [1000000, 100, 40, 10, 5, 3, 1]:
            ffe = None
            display_list = None
            vbos = None
            arrays = None

            scene = readScene(test_scene)
            patches = createPatches(scene, applyMacros(scene), float(i))

            outfile = "./experiments/memoize_experiment_"

            if use_hemicube_ffe is True:
                ffe = HemicubeFormFactorEngine(patches=patches, resolution=res, display_list=display_list, arrays=arrays, createGLUTRenderingContext=True)
            outfile += ffe.toString() + "_"
            
            if use_display_list:
                outfile += "display_list_"
                display_list = createGL_TRIANGLESDisplayListForPatches(patches)
            elif use_gl_arrays:
                outfile += "gl_arrays_"
                arrays = createGlArraysForPatches(patches)
            elif use_vbos:
Ejemplo n.º 8
0
 def test_convert_patches_to_xml_scene(self):
     writeScene(convertPatchesToXmlScene(self.patches), self.outfile)
     self.patch_scene = readScene(self.outfile)
Ejemplo n.º 9
0
 def setUp(self):
     self.infile = "./xml_test_files/test_scene_patch.xml"
     self.inscene = readScene(self.infile)
     self.patches = createPatches(self.inscene, applyMacros(self.inscene), 1000000.0) # to ensure no subdivision
     self.outfile = "./xml_test_files/test_scene_patch_rewritten.xml"