Home Unreal Engine

UDK - Material - Flipbook Tile

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all,

I was wondering if anyone had any tips on how I could tile a flip-book.

In my case, when I try to tile it, the flip-book shows ALL the information on my texture sprite sheet, something which I'm trying to avoid for each frame.

Also, as a misc. question, if there a way to control what I frame I want to freeze it on? For example, I want to show frame 4 only, is there a way?

Cheers and ciao.

Replies

  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    I'm confused exactly on what you're trying to accomplish, could you clarify? Are you using a "Flipbook Sample" expression in your material? Or are you doing a flipbook inside of cascade?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    I have kinda of a Brothel nudie sign.

    It's divided into 4 equal parts and is a Flipbook texture.

    It's going to be applied on a mesh I figure.

    I would like to tile it if possible. So my first frame is tiled 4 times. However, when I do tile it, it breaks my texture with horrible streaking and shows all of my texture, not only single frames.

    So basically, I was wondering if there is a way to tile only one from frame from a Flipbook on a mesh, if not, what would be the other closest solution.

    Bonus Question: Is there a way to stop the Flipbook at certain frames or to manually set the values outside of the Properties option on the textures.

    Hope that is more clear then before ;P
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    [ame="http://www.youtube.com/watch?v=6K8XMc6Z89M"]UDK Controllable Sprite Sheet - YouTube[/ame]

    Also Note that this effectively IS how a flipbook works under the hood. Yes there is a way to tile this on a mesh. plug that Coords node into a Frac before the divide. Mind you you will need to control your frames manually via kismet or unrealscipt this way, however it also means you can pause on frames if you like, or create oscillating sets of frames.

    You'll also need to alter the below node setup to accomodate row and collumn textures like the flipbooks are usually set up, or just alter your texture to be in just one long row or one long collumn. Whichever you find easier.

    See pic at end of post.

    Also get out of my head. :P A controllable multi-tile texture was something I wanted to put together a while back but hadn't bothered to do. This solves that.. so you could have multiple tiling detail textures packed into a single large/medium map.

    So that's now solved, and it was simpler than I figured actually. Thanks ace.. one more thing for the material function library.

    TileControl_Nodes.jpg
    TileControl.jpg
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Woot! Awesome one mate, seriously, this is great! Thank you very much.

    Question: Is there a specific texture setting I need to employ for it to work? My textures end up stretching, even sprites from UDK.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Err.. Don't use a flipbook texture with this. Just a normal texture and sampler.
    If that's not it then post your material network. And a sample pic
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Here it is: sdfsfp.png

    I basically get 2 different textures as opposed to the first one only.

    Tried it with a simplified texture, this one:
    4dflip.jpg

    Not sure if I misunderstood something, but I also tried on the default UDK sprite textures, but same problemo.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Yeah.. you either missed or misunderstood what I said in a previous post.
    Vailias wrote: »
    You'll also need to alter the below node setup to accomodate row and collumn textures like the flipbooks are usually set up, or just alter your texture to be in just one long row or one long collumn. Whichever you find easier.

    The node structure as I show in the video and screen cap is for mono directional tiling.
    Textures like this
    virtualSpriteSheet.png
    If you need bi-directional tiling, like your texture is set up for, you'll either need to break the controls up into rows and columns (the simplest change) or do the math to convert your total number of frames into rows and collumns (the most user friendly way).

    Either way you choose you'll need to have the segmentation math applied to the R channel of the UV's also, but controlled by the collumns setting, while the G is controlling the rows.
  • Hellfire
    Options
    Offline / Send Message
    Hellfire polycounter lvl 14
    hi,

    mattree for multitextures

    4 multitexture

    741cr.jpg

    16 multitexture

    852w.jpg


    but fac textures has seams problem with UDK and looks terrible. :/


    the hell
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Ah, OK, understood. Thanks guys!
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    I actually did up something like this for one of the artists here just a couple weeks ago. It started off straightforward (ie, fixed spritesheet format, single row), but soon grew into a bit of a monstrosity...

    flipbook-nodes.jpg

    Sorry for the huge image :p This one does a bit more than the standard flipbook, since you can define a transition time as well (fade from one frame to the next).
    Can't share the package from work, so I might throw together a function node in UDK when I'm home. I'll probably add comment boxes as well, because this one is notably light on those.

    Anyway, the node structure is pretty messy, but ultimately, once you instance the material, you'll have 5 float inputs:
    Number of Rows
    Number of Columns
    Framerate (this is in frames per second)
    Transition time (1 = full frame time, 2 = half frame time, etc)
    (I should really clamp this to 1, since fractional values are pretty pointless)

    The texture atlas will need its wrapmode set to Clamp, though as Hellfire has pointed out, you will see some bleedover from neighbouring frames (unless you use linear filtering, or leave some bleed area in the UVs).
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Wowzers, that a big one. Much appreciated for the show, thank you!
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    Oh wait, I'm a dick, I forgot about the bit where you were asking for tileable. :| My solution won't tile, and the way it's currently set up, I don't think it /can/ tile. My bad.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Not a problem, I can always find a use for a new material, you never know, and knowing if half the battle.
  • Patackular
    Options
    Offline / Send Message
    Patackular polycounter lvl 9
    Hey guys. I have been reading through your progress, but I'm still having trouble with the project I'm working on. I am trying to trigger a Flipbook to play on command instead of automatically playing on level load. For example - on pressing the 'Q' key, but there seems to be no way of referencing the Flipbook (both the type and the custom ones you have built above) in Matinee or Kismet. Any suggestions would be much appreciated.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Have 2 materials. One static, one with the flipbook. Have your command set the material on the object to the one you want. Or look into movie file textures.
  • Patackular
    Options
    Offline / Send Message
    Patackular polycounter lvl 9
    Movie file textures sound very promising, but could you give an example of the Flipbook suggestion you gave? I am not sure what you mean.
Sign In or Register to comment.