def test1(self): mgr = ColorManager() sampler = RegularSampler(2, 2, pixel=1.0) tile = Tile(5, 5, 20, 20) tile.split(1) runtime = Runtime() sampler.get_sample_asm([runtime], "get_sample", mgr.assembler) mc = mgr.assembler.assemble(self.asm_code()) ds = runtime.load('test', mc) sampler.set_tile(tile) while True: sample = sampler.get_sample() if sample is None: break runtime.run('test') self.sample_test(sample, ds) runtime.run('test') ret = ds['kraj'] self.assertFalse(ret)
def test1(self): mgr = ColorManager() sampler = RandomSampler(2, 2, pixel=1.0) tile = Tile(0, 0, 3, 3) tile.split(1) runtime = Runtime() mgr.macro_call.set_runtimes([runtime]) sampler.get_sample_asm([runtime], "get_sample", mgr.assembler) mc = mgr.assembler.assemble(self.asm_code()) ds = runtime.load('test', mc) sampler.set_tile(tile) while True: sample = sampler.get_sample() if sample is None: break runtime.run('test') self.show_samples(sample, ds) runtime.run('test') ret = ds['kraj'] self.assertFalse(ret)
""" cam = Pinhole((2,3,4), (5,9,1)) mgr = ColorManager() width = 2 height = 2 sampler = RegularSampler(width, height) runtime = Runtime() sampler.get_sample_asm([runtime], "get_sample", mgr.assembler) cam.ray_asm([runtime], 'get_ray', mgr.assembler) mc = mgr.assembler.assemble(ASM_CODE) ds = runtime.load('test', mc) tile = Tile(0,0, width, height) tile.split(1) sampler.set_tile(tile) start = time.clock() while True: sample = sampler.get_sample() if sample is None: break ray = cam.ray(sample) print(ray) runtime.run('test') print(ds['ray1.origin']) print(ds['ray1.dir']) print('**********************') end = time.clock()