Just another point of 2d animated sprites in 3d worlds, I guarantee every single 3d AAA title uses them. Especially when it comes to effects. They're not always just for animating cheap looking characters and objects, they're used for explosion layers, magic effects, within particle generators etc. All that good stuff.
It's still a really exciting plug-in. I look forward to the "casts shadows" feature working, and more options opening up in regards to texture handling/polygon optimization options. But it's off to a cool start though, something I'd been dreaming about for years!
ALRIGHT! So I have discovered a work-around. Probably could use a little extra work for optimization but I'll type out what I've got figured out so far:
HOW TO ANIMATE TEXTURES FOR 3D OBJECTS:
You can change the texture image of a material at run-time, but only by sourcing from an external image file. So what I did is in my file directory place a few consecutive png files to used as animation frames, starting at 0: walking0.png, walking1.png, walking2.png etc.
Then in the event editor you have to say something like these 3 things.
-- When Character is Walking
-- Every 0.10 seconds (or whatever speed you want the frames to change):
------ Set Alterable Value A (of whatever 3D object you are animating or whatever) to:
(Alterable Value A(3d object name) + 1)mod(3) - (using mod then the number '3' is just how many total frames there will be before it goes back 0 and loops.
And then next under the Firefly Material object you go:
----- Edit A Material -> Textures -> First Texture -> From image file -> Input the number Material you are affecting (let's say 1) -> Then the file picker window comes up.
At this point you click 'use expression' and then input something along these lines: "Y:/3d/walking" + Str$(Alterable Value A (3d object name)) + ".png"
(I'm using Alterable Value A as my store for the Frame Number I want to display, and obviously you'd change directories and file extensions to whatever. )
This makes it so that we can tell it which numbered image file to pick from for my 'walking' animation by referencing an Alterable Value that we can just add numbers to, instead of selecting files one by one.
And then finally across under the 3D Object you want to have an animated texture, you would get it to reload the Material:
----- (Load Material -> GetMaterial( "Material", 1 ) -> Node 0 etc.) like you usually do on creation of the object/at the start of frame. It just has to do it every time it updates the textures.
This should mean every 0.10 seconds it will:
- tell the Alterable Value to jump to the next image number,
- tell the Material object to pick the next image in line and load it up as the texture
- tell the 3d object to reload the texture.
Ta-da! Animated textures that can be as many frames as you like, and as fast as you like, for an 3D object. And because the files are sourced externally they are easy enough to edit and replace without changing any more code once it's set up.
Now, while this seems to work pretty much perfectly on any normal 3d object, unfortunately there is a bit of a bug with this when used for the BILLBOARD objects (which is what I originally intended its use for) as it doesn't seem to update the material each loop. So my workaround was to just apply all this to a Firefly Primitive 3d Object set as a Plane, rotate the X Angle 90 degrees so the flat plane is now standing up, and then in the events always set it's Y rotation angle to The Firefly Camera's Y rotation angle + 180, to make it always be looking at the camera.
It does the trick. Hopefully you can all follow that so you can use it in the meantime.
Sorry if these things have already been asked, but is Firefly cross platform compatible so you can build games for iOS and Android on it? And how would performance be? Also will there be any kind of demo to try it out?
why are you loading them from a file ? - i said to use the material cache at the very start and that it would be a lot easier - and doing it your way will kill your speed and your hard drive.
Originally Posted by Modine
@outcast - http://library.clickteam.com/extensions/firefly/frequently-asked-questions/
Mainly because using the Material Cache means you have to keep creating an entire new material and reinputting the settings for each new frame. And when you start getting to animations that have like 10 frames plus. It's fine for a few frames of animation, but this way you just have to put the new frames in a folder and then just change the max frame value. That seems much quicker and easier to me (at least on the creation end) but possibly further down the track it'll show that it starts slowing down the engine. Haven't seen it yet though.
But I'm open to any better ideas! What would you suggest for something like a 10 frame walking animation, with variations for left, right, backwards and forwards direction? (Technically 40 frames just for the walking animations alone)
They're both not the greatest options, but for longer animations I feel like the "in Fusion" way would just become messy.
It's Windows only currently.
Originally Posted by Outcast
Depending on the Sales, Mobile will be added
hmm i'm imagining something like space invaders - where each alien has lets say 20 frames - with 40 aliens on screen you will be accessing the harddrive 60 frames per sec = 2400 file reads per second ? hope you dont have a SSD cause that will burn through your lifetime reads very quickly.
Originally Posted by Modine
if its a sprite image the material cache wont need changing from default values. and just can store all the frames in 1 cache and just loop through them in 1 material change event.
Oh, that makes it not interesting to me. I hope it will be added cross platform compatibility in the future!
Originally Posted by Perry
Ohhhh right. Didn't realise that referencing outside files that frequently could be such a big problem! That's good to know.
Originally Posted by Triadian
I'll play around with just using the Material Cache texture images edited within Fusion instead, but at least I now know its possible to animate textures at all (though a little clunky).
Really hope at some point in the future that multiple animation frames per material texture can be implemented. This will work in the meantime.
Thanks for you help!
I have tried to get exclusive fullscreen to work but all I get is just white a white screen. It does work in borderless windows mode but I want it to work in exclusive fullscreen.
Originally Posted by BartekB
Is there a way to get this to work, it tried to get it to work with the FPS example with no luck.