Fix the unbelieveably stupid bug I've been chasing for days.

This commit is contained in:
Steven Robertson 2010-09-12 18:42:52 -04:00
parent 2f48d01aa9
commit 5a5fcf5bb9
3 changed files with 8 additions and 3 deletions

View File

@ -429,6 +429,7 @@ class PaletteLookup(PTXFragment):
self.texref.set_address_mode(0, cuda.address_mode.CLAMP)
self.texref.set_address_mode(1, cuda.address_mode.CLAMP)
self.texref.set_array(dev_array)
self.pal = pal
def call_setup(self, ctx):
assert self.texref, "Must upload palette texture before launch!"

View File

@ -98,8 +98,8 @@ class Frame(object):
for batch_idx in range(center.nbatches):
for time_idx in range(center.ntemporal_samples):
idx = time_idx + batch_idx * center.nbatches
time = time + filters.temporal_deltas[idx]
cp = self._frame.interpolate(time)
interp_time = time + filters.temporal_deltas[idx]
cp = self._frame.interpolate(interp_time)
cp_list.append(cp)
cp.camera = Camera(self._frame, cp, filters)

View File

@ -16,7 +16,7 @@ from ctypes import *
import numpy as np
from cuburn.device_code import IterThread
from cuburn.device_code import *
from cuburn.cuda import LaunchContext
from fr0stlib.pyflam3 import *
from fr0stlib.pyflam3._flam3 import *
@ -67,10 +67,14 @@ def main(args):
anim.features.hist_stride*4)
tex = image.texture
pal = (anim.ctx.ptx.instances[PaletteLookup].pal * 255.).astype(np.uint8)
image2 = pyglet.image.ImageData(256, 16, 'RGBA', pal.tostring())
@window.event
def on_draw():
window.clear()
tex.blit(0, 0)
image2.blit(0, 0)
@window.event
def on_key_press(sym, mod):