0

I need to update the texture of a 3D object frequently. (it is a procedurally generated pattern, so it cannot be cached, it has to be dynamically generated each frame)

What is the fastest way of doing this?

First I thought of updating a bitmapData via copyPixels(), then reupload this bitmapdata via Texture.uploadFromBitmapData() each frame, but I've heard that this is very slow ( due to moving data from system RAM to GPU RAM)

Any way of directly manipulating a Texture on the GPU,so I could avoid this step?

Martin K
  • 765
  • 1
  • 6
  • 15

1 Answers1

1

If it's a procedurally generated pattern then it can be done on the gpu. If it's impossible, then only way is the way you described - it's the fastest one. And yes, it's slow process.

nikitablack
  • 4,359
  • 2
  • 35
  • 68
  • would you be able to give a bit more specific instructions, as of how the in-GPU procedural texture painting/updating would work? I am guessing that it would involve rendering via setRenderToTexture / optimizeForRenderToTexture = true. But there are hardly any usable tutorials or information on this anywhere! – Martin K Oct 05 '12 at 12:03
  • 1
    Fuf. Here a snail answer - I don't know what kind of procedurally generated pattern do you mean. But if you can generate it on the gpu, then you can render it to texture as you mentioned. Check out my tutorial [link](http://volgogradetzzz.blogspot.ru/2012/05/stage3d-displacementmapfilter.html) it's just about that. – nikitablack Dec 07 '12 at 16:40