Hi, I had the same issue recently. I'll post the code I ended up using
in my UpdateEvent function in case that helps. Basically the solution I
found was as follows: I created a blank BitmapData and a blank
TextureFilter as follows:
public var blank_bmp:BitmapData = new BitmapData(floor_width,floor_length,false,0xffffffff)
public var t3d:Texture3D = new Texture3D(null)
public var tf:TextureFilter = new TextureFilter(t3d)
Then at the start of the UpdateEvent, I did the following:
private function updateEvent(e:Event):void
{
shader.filters[0] = blank_tf
t3d.bitmapData = blank_bmp
// now it's safe to dispose the previous Texture3D
t3d.dispose()
// now I recreate the Texture3D
t3d = new Texture3D(canvas)
tf = new TextureFilter(t3d)
//shader = new Shader3D("base")
shader.filters[0] = tf
shader.build()
plane.setMaterial(shader)
...
Anyway, this worked and made it possible to render a new bitmap texture
every frame without running out of memory after 10-20 seconds. You can
see the whole code <a
href="http://timbudds.info/bitmap/bitmap3d.as">here[/url] if it
helps and <a
href=http://timbudds.info/bitmap/Bitmap%20Scroll.html>here[/url]
is what I ended up making (just for fun, playing with something I found
on the Plastic Sturgeon website).