Home Technical Talk

Flow Map directions by UV?

polycounter
Offline / Send Message
Davision3D polycounter
It there some tool/programm that generates a map of the directions of the UV. Like when you have a face UV upright in your texture and then rotate it 90 degrees that map will show that rotation through a color.

To illustrate:

This are the 360 degrees of a flow map:
WhNfob4.jpg

A upright head with the UV direction just roughly painted in by me:
QkJrfmN.jpg
Since the UV is upright it is in that purple-ish color at the top of the UV while the directions distort to the edges slightly to different directions naturally through the pelt mapping.

Now with the UV rotated 90 degrees to the right it would have to look like this:
wa7WLLw.jpg
It is that orange-ish color on the right of the color wheel.


If I could generated such flow map directions by UV direction I would have a great workflow for my painting game. I could just make a greyscale with the amount/speed of the flow and overlay that on the direction map to get the actual flow map.
That greyscale part can then be just a tiled texture so I have all my flow maps basically generated just through the UV.

Here is a experiment with a strokes flow map:
53Jh1Dj.jpg
That flow map is just random directions and world mapped.

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    Cool project.

    Check out John Burnett's maps: InfoTexture, UVW to RGB.
    http://maxplugins.de/max2016.php?search=john%20burnett&sort=Name

    You can probably bake them to bitmaps using Render To Texture, you could also try baking them to vertex color using the Vertex Paint modifier.
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    Cool project.

    Check out John Burnett's maps: InfoTexture, UVW to RGB.
    http://maxplugins.de/max2016.php?search=john%20burnett&sort=Name

    You can probably bake them to bitmaps using Render To Texture, you could also try baking them to vertex color using the Vertex Paint modifier.

    Looks promising.
    I tried to install the version that matches my 3DsMax version, it shows up in the plugin Manager as loaded but I can't find it anywhere. Normally it would show up in the Customize list under the same name as it is in the plugin manager right?
  • Eric Chadwick
    Options
    Offline / Send Message
    No these are maps, so they'll show up in the Material Editor when you're adding a new map to a material.
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    No these are maps, so they'll show up in the Material Editor when you're adding a new map to a material.

    Thx, tested it now. But it is not what I'm looking for. It is basically UVW position as RGB pixel. I doubt I could extract rotation from that and map it to that color wheel.

    MicK0en.jpg
    On the right is rotated.
  • Eric Chadwick
    Options
    Offline / Send Message
    How are you rotating the UVs? It sounds like you are doing it manually in Unwrap, which means the offset is not stored anywhere, it is simply rotated and forgotten. You would need to store that rotation value, and then convert it into pixels. Can you write scripts? If you used UVW Xform, you would have a value to grab.

    You could also try converting the UVs into geometry, then doing the transforms in model space. However you would still have to figure out how to colorize them.

    I think hand-painting is your best bet. I remember how blankslatejoe explained they hand-painted normal maps for the 38 Studios game Copernicus.
    http://www.polycount.com/forum/showthread.php?p=1745478#post1745478
  • ZacD
    Options
    Online / Send Message
    ZacD ngon master
    You might be able to map something like that work with Substance designer, but it'd probably have to be done in a hacky and weird way. Someone setup rotating normal maps, might be able to use that as a starting point. Maybe create a mask, colorID, or vertex paint that tells Substance what way is up for each UV? Seems like a very specific use case.

    http://www.polycount.com/forum/newreply.php?do=newreply&p=2279352
  • Eric Chadwick
    Options
    Offline / Send Message
    You might also look into a way to use the tangent basis as your color control. It's kind of similar to what you want.

    http://docs.unity3d.com/Manual/SL-VertexProgramInputs.html

    SL-DebugTangents.png
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    How are you rotating the UVs? It sounds like you are doing it manually in Unwrap, which means the offset is not stored anywhere, it is simply rotated and forgotten. You would need to store that rotation value, and then convert it into pixels. Can you write scripts? If you used UVW Xform, you would have a value to grab.

    You could also try converting the UVs into geometry, then doing the transforms in model space. However you would still have to figure out how to colorize them.

    I think hand-painting is your best bet. I remember how blankslatejoe explained they hand-painted normal maps for the 38 Studios game Copernicus.
    http://www.polycount.com/forum/showthread.php?p=1745478#post1745478

    Yea, doing the UV rotation manually in Unwrap is the point so I can easily define Flow Map direction by rotating stuff in Unwrap. That then also matches the strokes tiled grescale map, strokes go in 1 direction in the texture but the UV then changes the direction. I have no experience with writing scripts unfortunately.
    Converting UV to geometry sounds intriguing while it offers more options I can't think of anything that could colorize them based on rotation.

    Handpainting them manually is what I did. That is hard and time consuming while doing it by UV would be easy and quick. This is the tutorial I used for the manual approach: http://www.polycount.com/forum/showthread.php?t=98983
    ZacD wrote: »
    You might be able to map something like that work with Substance designer, but it'd probably have to be done in a hacky and weird way. Someone setup rotating normal maps, might be able to use that as a starting point. Maybe create a mask, colorID, or vertex paint that tells Substance what way is up for each UV? Seems like a very specific use case.

    http://www.polycount.com/forum/newreply.php?do=newreply&p=2279352
    My experience with Substance Designer is very limited. In the end it comes all down if Substance Designer allows for anything based on UV rotation. Telling what way is up for the whole UV is not the problem. It is the UV isles that I need to rotate and also grab then the distorted rotation. UV is stored in just position so it would compare the mesh vertex position with UV position and calculate rotation from that somehow I guess.
    You might also look into a way to use the tangent basis as your color control. It's kind of similar to what you want.

    http://docs.unity3d.com/Manual/SL-VertexProgramInputs.html

    SL-DebugTangents.png
    I tried to grab that shader code and put it in UE4 and as a directx shader in 3Ds Max but it is not as easy as that. I make my shaders completely in the visual material editor of UE4 so don't know how to handle that.

    But isn't tangent just the different normal map, tangent normal = local normal. Or is tangent basis something different. In any case from what I understand a normal map doesn't care about the UV rotation. When you just have a plane and rotate it to the side it remains the same normal map information.
  • Eric Chadwick
    Options
    Offline / Send Message
    The tangent basis is different from a tangent space normal map. A tangent space normal map needs the tangent basis to transform (rotate) the normals from texture space into model space. Once there, they can then be lit.

    There are many ways to do the tangent basis, but usually it takes into account the UV orientation, and compares this with the polygon orientation.

    When you rotate a plane, you're rotating the polygons. But if you rotate a chunk of pixels in a tangent space normal map, the lighting will become incorrect (left doesn't point left anymore). There are tools however, like the Substance ZacD pointed to, which transform the normal map colors as you rotate them, so left is still left in tangent space.

    You're doing some freaky cool stuff with your experiment. So you're going to need some freaky hacks. I would seek out a technical artist to team up with.

    http://www.polycount.com/forum/forumdisplay.php?f=44
    and/or
    http://tech-artists.org/forum/forum.php
Sign In or Register to comment.