mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Fix the unbelieveably stupid bug I've been chasing for days.
This commit is contained in:
parent
2f48d01aa9
commit
5a5fcf5bb9
@ -429,6 +429,7 @@ class PaletteLookup(PTXFragment):
|
|||||||
self.texref.set_address_mode(0, cuda.address_mode.CLAMP)
|
self.texref.set_address_mode(0, cuda.address_mode.CLAMP)
|
||||||
self.texref.set_address_mode(1, cuda.address_mode.CLAMP)
|
self.texref.set_address_mode(1, cuda.address_mode.CLAMP)
|
||||||
self.texref.set_array(dev_array)
|
self.texref.set_array(dev_array)
|
||||||
|
self.pal = pal
|
||||||
|
|
||||||
def call_setup(self, ctx):
|
def call_setup(self, ctx):
|
||||||
assert self.texref, "Must upload palette texture before launch!"
|
assert self.texref, "Must upload palette texture before launch!"
|
||||||
|
@ -98,8 +98,8 @@ class Frame(object):
|
|||||||
for batch_idx in range(center.nbatches):
|
for batch_idx in range(center.nbatches):
|
||||||
for time_idx in range(center.ntemporal_samples):
|
for time_idx in range(center.ntemporal_samples):
|
||||||
idx = time_idx + batch_idx * center.nbatches
|
idx = time_idx + batch_idx * center.nbatches
|
||||||
time = time + filters.temporal_deltas[idx]
|
interp_time = time + filters.temporal_deltas[idx]
|
||||||
cp = self._frame.interpolate(time)
|
cp = self._frame.interpolate(interp_time)
|
||||||
cp_list.append(cp)
|
cp_list.append(cp)
|
||||||
|
|
||||||
cp.camera = Camera(self._frame, cp, filters)
|
cp.camera = Camera(self._frame, cp, filters)
|
||||||
|
6
main.py
6
main.py
@ -16,7 +16,7 @@ from ctypes import *
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from cuburn.device_code import IterThread
|
from cuburn.device_code import *
|
||||||
from cuburn.cuda import LaunchContext
|
from cuburn.cuda import LaunchContext
|
||||||
from fr0stlib.pyflam3 import *
|
from fr0stlib.pyflam3 import *
|
||||||
from fr0stlib.pyflam3._flam3 import *
|
from fr0stlib.pyflam3._flam3 import *
|
||||||
@ -67,10 +67,14 @@ def main(args):
|
|||||||
anim.features.hist_stride*4)
|
anim.features.hist_stride*4)
|
||||||
tex = image.texture
|
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
|
@window.event
|
||||||
def on_draw():
|
def on_draw():
|
||||||
window.clear()
|
window.clear()
|
||||||
tex.blit(0, 0)
|
tex.blit(0, 0)
|
||||||
|
image2.blit(0, 0)
|
||||||
|
|
||||||
@window.event
|
@window.event
|
||||||
def on_key_press(sym, mod):
|
def on_key_press(sym, mod):
|
||||||
|
Loading…
Reference in New Issue
Block a user