Home Unreal Engine

How Do You Make a Flow Map?

13

Replies

  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    SirCalalot wrote: »
    With regards to using Vertex Colours instead of a Flow Map Texture, I take it that I would simply need to replace the TextureSample node with a VertexColor Node?

    In that case, I would be filling the whole mesh in 0.5 Red and 0.5 Green before then painting extra Red to move flow in the direction of the X axis and Green for the Y?

    Sorry if I'm being dense, I just want to make sure I have it right in my head, as the benefits of being able to paint flow in realtime using the viewport would be amazing.

    Here's a really simple example I've made showing how you can use vertex colour to achieve this kind of thing.

    7162660588_b0e6e7233a_z.jpg
    vertexColourDistort090512 by sprunghunt, on Flickr

    Obviously using both red and green channels the complexity is higher.

    From this I can see that there are two downsides to using vertex colour.

    1) Even a fairly highly tesselated mesh isn't as detailed as a bitmap. And it causes a roughness to the ripples.

    2) in the case of a water surface using vertex colour runs into the problem of not having enough interpolators to have a reflection. This is fixable but still a problem.

    However in UDK you could just use the texturepaint feature to do this instead of vertex colour.

    http://udn.epicgames.com/Three/TexturePaintReference.html
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
  • sinistergfx
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    So I take it that this Flow-Field Editor can be used to author Flow Maps? Or are there some settings that need adjusting beforehand?

    As the only image doesn't look too much like a 2-channel or 3-channel coordinate map:

    flowed.png
  • sinistergfx
    Options
    Offline / Send Message
    sinistergfx polycounter lvl 18
    That's just a screenshot of all the different features...
    Give it a try.

    Editing a flow using just the 'Flow Points' tool:
    flowmap01_flowed.png
    I first loaded up a blank 512x512 image to set my flowmap size. You could use an image of your mesh UVs to guide you if you need something specific. I didn't use it in this example, but the flow brush is pretty useful for adjusting flow vectors. It'd be nice if you could 'comb' the flow points in the future; would be very useful with flow grids.

    The output flowmap after being inverting R and G and slightly blurring in PS:
    flowmap01_map.png

    The very -basics- of the flow material in UDK, still needs noise modulation to get rid of pulsing:
    flowmap01_udk_mat.jpg
    Make sure you set your flowmap to a type of normal map compression to get correct vectors (-1,-1 to 1,1 instead of 0,0 to 1,1). The append in the flow map box can also be a component mask.

    The result:
    flowmap01_udk_ani.gif

    Still need to play around with it some more, but seems like a good solution for free.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Yep, it's good indeed, the only issue is that it might go Commercial in the future (so it won't be free in the long run), and from the way the math is done, it seem like a 'comb in direct you move your pointer in' won't come out for a long while too, but the Lines set to Bezier are doing the job just fine, without any lag, vertex limitations, etc.
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    That tool looks pretty awesome, thanks for sharing :)
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    Cheers for putting this up @sinistergfx :)
    I'm all over this like nuns on toast.
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    To add to this already crazy thread, I'm starting to experiment with using Maya fluids to generate a flow map that can simply be rendered out for use in UDK.

    FluidsTest01.jpg

    I want to explore more on how to utilize flow maps for VFX, as the guys at Naughty Dog have. More to come.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    imbueFX wrote: »
    To add to this already crazy thread, I'm starting to experiment with using Maya fluids to generate a flow map that can simply be rendered out for use in UDK.

    FluidsTest01.jpg

    I want to explore more on how to utilize flow maps for VFX, as the guys at Naughty Dog have. More to come.

    DVD/3d-motive material?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    I've been adding flow map painting to my Unity vertex painter, and once I'm done with the editor extension stuff, I'm thinking I might put together a standalone (or perhaps web-based, or both) as well, just to paint flowmaps and output to a texture file.

    This is what I have so far, but it's all built to work in the editor, so it currently won't work as a standalone.

    [ame="http://www.youtube.com/watch?v=U_Nyo_2fDfU"]Flow map painting - YouTube[/ame]

    I figure a standalone could potentially come in handy.
  • Paunescu.Daniel
    WOW @ LoTekK, that is some awesome thing you got going there.
    Standalone version?
    YES PLEASE!!!
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    Great work @imbueFX, I'd love to see the results!

    And @LoTekK, that has to be the most visually impressive way of authoring flow maps I have seen so far!
    A standalone version would be infinitely appreciated by everyone!
  • aajohnny
    Options
    Offline / Send Message
    aajohnny polycounter lvl 13
    I third that LoTekK Make a standalone!
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    That flow map editor is so awesome LoTeKK!
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    LoTekK for Flow Kings!
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Bill did you get that to work with Soup? Also yes lotekk, standalone!
  • Santewi
    Options
    Offline / Send Message
    That's just a screenshot of all the different features...
    Give it a try.

    Howcome the program looks like this for me...

    XQNCU.png
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    @Lotekk: Incredible!

    @Haidda: Originally I was messing with soup, but kept getting stuck. I found a solution that allows me to work easily with the built-in features in Maya.

    @Computron: I will eventually make a tutorial regarding this method, yes. For my site, probably not 3dmotive.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Imbue, I can't wait to see what you got!
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    @santewi you need to load an image first
  • Santewi
    Options
    Offline / Send Message
    JordanW wrote: »
    @santewi you need to load an image first

    Oh, thanks.

    What kind of image should I load? Layout of the area I need a flowmap for or something?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    So first pass prototyping the standalone version. Managed to [relatively] cleanly port most of the editor code over to runtime code, added a way to bake out the vertex colors from the [pregenerated 64x64 plane] to an arbitrarily-sized texture.

    [ame="http://www.youtube.com/watch?v=n_ZuZ76gCj0"]Prototyping a standalone flowmap painter - YouTube[/ame]
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    Well that was arousing - in a game art kind of way, of course.

    How easy would it be to overlay an image onto the canvas as reference (perhaps a plan-view of your environment)?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    You could always use ImageForegroundReference tool or GhostIt? Two standalone overlay programs.
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    SirCalalot:
    That's actually already in the works :) It'll be quite rudimentary, at least initially. For now you'll just feed it a path/url (Unity doesn't have built in functionality for a file system browser, so I'll have to write/find one eventually), and it'll stick that on top of the flowmap. I'm setting it up so you can adjust its transparency, and it'll also use the texture's alpha if available. I'm also going to let the user point the flowmap shader to your own texture (and adjust tiling/speed), so you can get a better representation of your own assets.

    Of course, GhostIt/ImageForegroundReference would work in a pinch as well :)
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    Thanking you both kindly - glad to see these things are thought of before I even raise my hand!
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    So initial release is out!
    http://teckartist.com/?p=96

    and the thread if that floats your boat better. :)

    flowMapPainter.jpg
  • Hellfire
    Options
    Offline / Send Message
    Hellfire polycounter lvl 14
    Thx you this is awesome!!!
  • Santewi
    Options
    Offline / Send Message
    Simply amazing.
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    As promised, here are some of my initial tests utilizing flow maps for VFX.

    While the basic premise is the same, using this on particles has its own advantages. Mainly since particles typically have fixed lifetimes, I don't have to worry about blending various states. Flow increases over time, then the particle dies. We also have the advantage in that since we typically have multiple particles drawing on top of one another (think smoke, fire, water), we get the advantage of multiple flowmaps with random particle rotations working together.

    To reiterate from my previous post, I'm rendering these out via Maya Fluids. This could also be painted by hand with Teck's flowmap painter, or with the liquify tool in photoshop. The reason I'm sold with Maya Fluids is that is designed to simulate exactly that: fluid dynamics. This will help provide much more detailed eddys quickly and more realistically.

    This was one of my 1st successful flow maps rendered from Maya

    FluidsTest01.jpg

    I take this flow map and lerp between a regular texture coordinate. I can set a range via a dynamic paramater so that every particle gets a unique amount of "flow" as to avoid repetition and add variety.

    VFX_Flowmap.jpg

    I took it further and started to mess with the concept of a Detail Flow Map, much in line with the concept of a detail normal map. Each one can be turned on or off individually through new dynamic parameters, and with new rangers for even more variety!

    VFX_Flowmap2.jpg

    The end result / a quick breakdown can be seen here:

    http://youtu.be/SHlwMytl-2g

    While not perfect, the results are very convincing. I feel like this is just the tip of the ice berg, I've only played with smoke so far. I can see this being used for fire as well. What's awesome about this is that it's only 1 base texture and 2 flow maps. No flipbooks, and it can be controlled over a very long particle lifetime. Also remember that every particle is picking from 2 random ranges, so the chance of having 2 particles that look alike is slim and helps add to its realism.
  • Santewi
    Options
    Offline / Send Message
    imbueFX wrote: »
    Also remember that every particle is picking from 2 random ranges, so the chance of having 2 particles that look alike is slim and helps add to its realism.


    Which is exactly the reason I use distortion with particles and fluid materials. I wish more people would use distortion, having 100 particles that look exactly the same doesn't look very good.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    That's very interesting, is there a strong extra cost while using these flow maps ?
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    In a particle system it could get quite expensive. This is better for systems with a small volume of larger particles.
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    Froyok wrote: »
    That's very interesting, is there a strong extra cost while using these flow maps ?

    Yes, the biggest issue to consider is performance. However, it's not "crazy" expensive and also depends on your hardware. In MK9, UV distortion was utilized extensively throughout the game (ps3/360). When it came time for us to port the game to the Vita, we quickly learned that it wasn't viable performance wise. As soon as you started modifying the UVs, it would kill framerate. So use sparingly :poly121:
  • Santewi
    Options
    Offline / Send Message
    imbueFX wrote: »
    Yes, the biggest issue to consider is performance. However, it's not "crazy" expensive and also depends on your hardware. In MK9, UV distortion was utilized extensively throughout the game (ps3/360). When it came time for us to port the game to the Vita, we quickly learned that it wasn't viable performance wise. As soon as you started modifying the UVs, it would kill framerate. So use sparingly :poly121:

    Then again with this method you don't need as many individual particles to get a convincing look, that's another thing to consider.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Thanks for the answers guys ! :)
  • Teessider
    Options
    Offline / Send Message
    Teessider polycounter lvl 11
    Wow...this thread is absolutely incredible! And this is a perfect source of information for my research project...Flow Maps :P

    I started a thread on PC a while back now http://www.polycount.com/forum/showthread.php?t=106663 asking about topics that the industry wants to be researched and flow maps came up. I have been researching for a while now and came across some the tutorials in this thread (albeit via google and the PC wiki) and I've only just somehow stumbled upon this thread?!

    From reading through this thread (and from what valve have said), they seem pretty complicated :S although this is not going to put me off trying to create them myself.

    When I'm carrying out my research should I just reply to this thread or make a new one in technical talk?

    Once again - Awesome thread! I've learned lots already and I haven't even started yet lol
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    Using flow maps is pretty easy - but generating them can be problematic if you need any level of accuracy or realism. Valve have a superb PDF file out there somewhere that goes into detail with how they achieved generating their flow maps for L4D2 using Houdini.
  • feanix
    Options
    Offline / Send Message
    feanix polycounter lvl 7
    I'm having some trouble trying to get this shader to work in the UDK.

    Here's my test flowmap. I'd expect no movement in the centre, and movement away from the centre in all other blocks.
    wEW4F.png

    Here's the shader tree, based on Phill's tutorial:
    M4H7o.png

    Here's the result:
    https://www.youtube.com/watch?v=Y8Aukho0crI

    Can't figure out why the movement is slower at the top right, quicker at the bottom left. There should be none at all in the centre. Is this a gamma thing?

    Any help would be appreciated!
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Disable SRGB on the texture maybe?
  • feanix
    Options
    Offline / Send Message
    feanix polycounter lvl 7
    Seems that it was already disabled.
  • feanix
    Options
    Offline / Send Message
    feanix polycounter lvl 7
    Oh, I forgot to say. Solved this by changing the compression of the flowmap to a normal map.
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    Hey all,

    I'm about to post this in the general section as well, but I thought everyone here would like to know that I've finally gotten around to releasing my flow map tutorial for particles & VFX. You may remember my posts from a few months back where I showed some techniques of generating flowmaps with Maya Fluids, and the video covers all of that and lots more. Again while this is related to how environment artists use flow maps, we take some different approaches since these will be used with particles.

    Check out the product here

    Products_DVDCover_FlowMaps_01-280x399.png


    And watch the 1st chapter on Youtube

    http://youtu.be/7X45ED6ArJA

    And a serious thank you to all the great people who contributed to this thread. I was always lurking for months as I developed my techniques in my spare time, and there was always such great inspiration from everyone on here. :poly124:
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 16
    awesome stuff! i actually just started watching a few of your 3dmotive vids last night and was enjoying them very much. ill definitely check this out after i make my way through the others :D
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    Oniram wrote: »
    awesome stuff! i actually just started watching a few of your 3dmotive vids last night and was enjoying them very much. ill definitely check this out after i make my way through the others :D

    Thank you!
  • MaVCArt
    Options
    Offline / Send Message
    MaVCArt polycounter lvl 8
    in an attempt to have some cheap advertising, should you be a max user, you can also use my script/plugin to easily generate flow maps:

    http://www.polycount.com/forum/showthread.php?t=97215
  • p1ll
    Options
    Offline / Send Message
    Hey, I been studying imbueFX flowmap lesson, it's really thorough and awsome. I'm not a paid spokesmodel, no, totally non solicited :) I jsut joined polycount, I don't know what took me so long,! cheers
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    Welcome Scott, & thanks for recommending my work :)
13
Sign In or Register to comment.