several animated Sprite3D, same animation (bug)?

Software: Away3D 4.x

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 09:31 AM   Total Posts: 28

Hi there.
I am creating some particles based in Sprite3Ds with a common spritesheet BitmapData.
I assigned a different textureMaterial to each sprite, based on the same BitmapData source.
in each frame, the uv’s from each sprite geometries are shifted.
When testing with 1 sprite, everuthing seems ok. The animation flows correctly and super-fast.
But when raising the sprite number, I find myself with an array of sprites sharing the same uv’s animation, although when tracing the uvData in each sprite, I get different (and correct) positions.

Am I missing something here? If the uvData has the correct positions and I called an updateUVData on the sprite’s geometry, shouldn’t each sprite animate independently?

   

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 10:57 AM   Total Posts: 28   [ # 1 ]

I just tried a brute force test on this, using a different bitmapData and Material for each Sprite3D.
The UV positions reported are correct- but in the screen, all Sprite3D share the same uvData..
What is wrong with this?

 

   

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 11:00 AM   Total Posts: 28   [ # 2 ]

Sprite3D uv’s aren’t being instanced or shared between Sprites, because the tracing reports correct positions. It’s all in the buffer. Or so it seems..

I appreciate any help given on this troublesome detail. I cannot use proper particles with this bug.

 

   

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 11:27 AM   Total Posts: 28   [ # 3 ]

Detected another strange thing- I assigned different UV scales to each sprite3D, and after creation, they were correct. But upon rendering, all sprite3D started to propagate the UVScale, ending after few frames with the same scale- the UVScale of the last Sprite3D on the list.

Hope this helps tracing the bug.

I ask for help again on this matter, because if this is not corrected, the only available way to animate several sprite3D independently, will be with bitmapData assigning- and probably that costs much more in performance.

Many thanks

 

   

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 11:40 AM   Total Posts: 28   [ # 4 ]

Detected the origin of the bug-
Sprite3D class defines the subgeometry as a private static class.
This forces an instance of the subgeometry to all sprite3D created- that includes UV manipulation too.
A way must be found to keep the subgeometry instance but store the uvData for each Sprite, in case of an animated sprite.
I temporarily corrected this forcing the subgeometry variable in the sprite3D to private (no static)

 

   

Avatar
Alex-Crafter, Newbie
Posted: 25 October 2012 11:51 AM   Total Posts: 28   [ # 5 ]

This was the intended effect- fire fading in the older particles.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X