0
votes

I've been creating cellular automata using AGAL and having some issues. My code basically does the following:

  • Kicks off with a bitmap used to create a texture.
  • Invokes setTextureAt() to pass the texture to context3D
  • Applies that texture to a simple plane
  • Does some cellular automata magic
  • Renders to back buffer
  • Also renders back to the same texture
  • Repeats

I sample neighbouring pixels by adding the 1 / (width or height). I thought that mpimapping might help - but I can't see a way to mipmap generated textures.

You can see the application here and the source code is here. The AGAL code lives in classes.WillamowskyRosslerRenderer

The code works, but I get these odd artefacts when I zoom in:

enter image description here

Many thanks in advance,

simon

Update! I've been playing around and the artefacts and flickering have both vanished by:

  • *Setting the texture size to 2048 * 2048*
  • configureBackBuffer(1024,1024,16)

It's a workaround rather than a fix, so I'm still investigating

1

1 Answers

0
votes

Yay! Fixed with mipmapping. I didn't realise that render to texture automatically creates mip maps so I can use proper filtering in the 'tex' calls.

Also, in this project, the back buffer needs to be the same aspect ratio as the texture

I blogged about it here: http://flexmonkey.blogspot.co.uk/2013/03/stage3d-joys-of-mipmapping.html