Announcement

Collapse
No announcement yet.

Water Flow For UDK

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I received letter with question how flowmaps can be painted with Mesh Paint tool.
    Post my answer here for people who have interest.

    This algorithm uses color representation of vector field. And specific color is a specific direction of flow, or more exactly - distortion of UVs.

    I thought about Mesh Paint, but there is few problems which make me refuse this idea.

    First of all, in UDK you can't paint flow by moving brush in desired direction. It's only paints selected color.
    Of course, with editor's source code we would be able to implement our own special brush, with blackjack and hookers, but alas...

    If you really want to paint it, you need to look at the scheme, then paint, then look again, paint, look, paint, and so on.

    Also, because of UVs distortion, you can see some artefacts.

    Texture must be:
    - unpacked from -1 to 1
    - not sRGB

    All this easily achieves with compression NormalMap or NormalMapUncompressed.
    By the way, the last one produces best visual results.

    And to make it work in the right way, you need to use "Normal" sampler in material.
    But you can't paint on that sampler type.

    So, to paint, you need texture with "Default" compression, unchecked sRGB, assigned to simple texture sampler, and you need to unpack it to (-1;1) in material, using "(tex - 0.5)/0.5" or something similar.
    And, as I already said, paint, repaint and paint again...

    Exists another way by using vertex color, but again, because of UVs distortion and it's artifacts, you need really high-res grid.
    Valve says that flowmap "relatively low resolution", but this is a little "relatively".
    It's not a big problem with normal maps, but its VERY noticeable on color textures.
    I used flowmaps with resolution 1024*1024, and I can't say this is enough.
    And with UDK limitation 64K tris for mesh, maximum which you can get is 256*256 grid.

    In this case, Houdini pipeline, with already implemented forces, slowdown and reflection effects, more simpler and faster.
    You just need to export your scene, replace models in Houdini nodes, tweak few parameters and thats all.

    Leave a comment:


  • replied
    super cool man! thanks for sharing

    Leave a comment:


  • replied
    Well, with weird I meant more that my implementation was rather ugly. I used a very simple way through the UV coordinates to make the water "bend" around corners. It wasn't an exceptional result, but it wasn't like there was anything really wrong with it. Just ugly :P

    Leave a comment:


  • replied
    Hi all!
    Thank you for your thanks!

    cridia
    without doing weird stuff to the mesh itself
    you can use flow algorithm with DX11 tesselation, by flowing displacement map in the same way as flowing normal map in DX9.

    Leave a comment:


  • replied
    @cridia - it shouldn't do ANYTHING to your mesh because it's a texture/uvcoords effect.
    To simplify it, all you do is take a plane with uv coordinates, create a flowTEXTURE for it and use it in the shader.
    If your mesh gets *weird* from that make sure your shader setup is right, check WorldPosOffset and Displacement/Tesselation.
    Otherwise please post a screenshot so that we can see what stuff your mesh's doing!

    Leave a comment:


  • replied
    This is amazing. I always wondered how to get that effect where you can alter the direction of where the water is flowing, without doing weird stuff to the mesh itself (my flowing water instances have been rather... ugly). Thanks for sharing it; I made sure to put it into my bookmarks!

    Leave a comment:


  • replied
    looks very amazing, thanks for sharing it.

    Leave a comment:


  • replied
    Nice work, thanks for sharing!

    Leave a comment:


  • replied
    Thank You!

    Leave a comment:


  • replied
    Nice work! Thanks for making the effort!

    Leave a comment:


  • replied
    Best water I've seen in UDK, cheers for making this and sharing the how-to knowledge!

    Leave a comment:


  • replied
    Good job Redbox!

    Leave a comment:


  • replied
    Thanks a tonne for this Redbox, I'm not familiar with Houdini at all so struggling through it... but it'll be worth it in the end I'm sure!

    If I manage to make my way through and learn enough, I might make a full step-by-step video tutorial unless somebody more knowledgeable is able to do so.

    Leave a comment:


  • replied
    So, I was having issues getting HOT to work with Houdini 12.5 for Normals generation. Interestingly enough, they released 12.5 with Ocean FX built in. Granted, I don't know how it compares to HOT, but I was able to get Normals generation no problem. Here are the steps I took to getting it to view (using basically the same exact settings from redbox's document):

    1) Create the following:

    Camera:
    Translation = 0, 128, 0.
    Rotate = -90, 0, 0.
    Icon Scale = 100.
    Resolution = 1024*1024.
    Aperture = 100.

    Ambient Light:
    Ambient color = 1, 1, 1.
    Light Intensity = 1.

    Grid:
    Size = 512*512.
    Rows/Columns = 512*512.

    2) Select the grid, go to deform (should be top left toolbar), and click on "Ocean Waves"
    3) Adjust nodes as per redbox's document!

    As for adjusting the waves, some fields are different or simply non-existent. Check out the oceanspectrum node for all your ocean tweaking needs =]

    Leave a comment:


  • replied
    Nice Work.. Thanks

    Leave a comment:

Working...
X