Jump to content


Photo

Flowmap Painter


  • Please log in to reply
7 replies to this topic

#1 PeZiK

PeZiK

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 38 posts

Posted 25 September 2012 - 07:45 AM

Source : Maxunderground

Teck Lee Tan has released a free tool for creating flow maps. FlowMap painter is a stand alone application that enables you to easily paint flow maps for real-time textures. Find out more and watch a video on Polycount.

Here's another great source : http://graphicsrunne...-flow-maps.html

How can we use this with Fusion, I think this is a great tool for creating fast flows, like lava, water, etc.? :D

P.
  • AgedocomAccok likes this

#2 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 25 September 2012 - 12:08 PM

I saw something like this at Siggraph a couple years back (EDIT: I see this page was from a couple years back too, so that makes sense). Trivial to do in 3GS, but I don't know how you could do it with the built in 3D shaders... Maybe you could do it to the image, assuming you don't need anything fancy with the object/shading itself (you're fine just doing it at the texture level). Could be done with something like Txr I suppose, you just lose the realtime bit (not that anyone using Fusion cares). It's not advecting, just a straight-up offset, right? The advecting thing, done in 3GS can be super fast though (trust me on this B) ).

As for the painting bit... Not sure what our options there are... Haven't played around with Pnt in a while, and that's the only place where you get the ability to A) paint and B) use the output as input.

#3 redoddity

redoddity

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 190 posts

Posted 25 September 2012 - 12:11 PM

Something like this:?
{
    Tools = ordered() {
        Renderer3D1 = Renderer3D {
            CtrlWZoom = false,
            Inputs = {
                Width = Input { Value = 720, },
                Height = Input { Value = 576, },
                PixelAspect = Input { Value = { 1, 0.703125, }, },
                Depth = Input { Value = 1, },
                SceneInput = Input {
                    SourceOp = "Merge3D1",
                    Source = "Output",
                },
                RendererType = Input { Value = FuID { "RendererOpenGL", }, },
                ["RendererSoftware.Channels.RGBA"] = Input { Disabled = true, },
                ["RendererOpenGL.Channels.RGBA"] = Input { Disabled = true, },
                ["RendererOpenGL.Lighting"] = Input { Value = 1, },
                ["RendererOpenGL.LightingEnabled"] = Input { Value = 1, },
            },
            ViewInfo = OperatorInfo { Pos = { 1265, 214.5, }, },
        },
        Loader4 = Loader {
            Clips = {
                Clip {
                    ID = "Clip1",
                    Filename = "Z:\\Projects\\Tests\\images\\flowmap\\wave1.tga",
                    FormatID = "TargaFormat",
                    Length = 2,
                    LengthSetManually = true,
                    TrimIn = 1,
                    TrimOut = 1,
                    ExtendFirst = 0,
                    ExtendLast = 0,
                    Loop = 0,
                    AspectMode = 0,
                    Depth = 4,
                    TimeCode = 0,
                    GlobalStart = 0,
                    GlobalEnd = 0,
                },
            },
            Inputs = {
                Depth = Input { Value = 4, },
                EnableClipList = Input { Value = 0, },
            },
            ViewInfo = OperatorInfo { Pos = { 165, 115.5, }, },
        },
        Loader2 = Loader {
            Clips = {
                Clip {
                    ID = "Clip1",
                    Filename = "Z:\\Projects\\Tests\\images\\flowmap\\flowmap.png",
                    FormatID = "PNGFormat",
                    StartFrame = -1,
                    LengthSetManually = true,
                    TrimIn = 0,
                    TrimOut = 0,
                    ExtendFirst = 0,
                    ExtendLast = 0,
                    Loop = 0,
                    AspectMode = 0,
                    Depth = 4,
                    TimeCode = 0,
                    GlobalStart = 0,
                    GlobalEnd = 0,
                },
            },
            Inputs = {
                Depth = Input { Value = 4, },
                EnableClipList = Input { Value = 0, },
            },
            ViewInfo = OperatorInfo { Pos = { 165, 214.5, }, },
        },
        BumpMap1 = BumpMap {
            Inputs = {
                SourceImageType = Input { Value = 1, },
                Input = Input {
                    SourceOp = "Merge",
                    Source = "Output",
                },
                MaterialID = Input { Value = 8, },
            },
            ViewInfo = OperatorInfo { Pos = { 605, 214.5, }, },
        },
        Background1 = Background {
            Inputs = {
                Width = Input { Value = 512, },
                Height = Input { Value = 512, },
                Depth = Input { Value = 3, },
                Gradient = Input {
                    Value = Gradient {
                        Colors = {
                            [0] = { 0, 0, 0, 1, },
                            [1] = { 1, 1, 1, 1, },
                        },
                    },
                },
            },
            ViewInfo = OperatorInfo { Pos = { 605, 247.5, }, },
        },
        SphereMap1 = SphereMap {
            Inputs = {
                Image = Input {
                    SourceOp = "Loader3",
                    Source = "Output",
                },
                MaterialID = Input { Value = 5, },
            },
            ViewInfo = OperatorInfo { Pos = { 715, 313.5, }, },
        },
        Loader3 = Loader {
            Clips = {
                Clip {
                    ID = "Clip1",
                    Filename = "Z:\\Projects\\Tests\\images\\flowmap\\grassCUBE.tga",
                    FormatID = "TargaFormat",
                    StartFrame = -1,
                    LengthSetManually = true,
                    TrimIn = 0,
                    TrimOut = 0,
                    ExtendFirst = 0,
                    ExtendLast = 0,
                    Loop = 0,
                    AspectMode = 0,
                    Depth = 0,
                    TimeCode = 0,
                    GlobalStart = 0,
                    GlobalEnd = 0,
                },
            },
            Inputs = {
                EnableClipList = Input { Value = 0, },
            },
            ViewInfo = OperatorInfo { Pos = { 715, 346.5, }, },
        },
        Camera3D1 = Camera3D {
            Inputs = {
                ["Transform3DOp.Translate.Y"] = Input { Value = 0.356358311933913, },
                ["Transform3DOp.Translate.Z"] = Input { Value = 0.795403546099087, },
                ["Transform3DOp.Rotate.X"] = Input { Value = -26.9387755, },
                AoV = Input { Value = 50.0392759364594, },
                FLength = Input { Value = 20, },
                ["Stereo.Method"] = Input { Value = FuID { "Parallel", }, },
                FilmBack = Input { Value = 1, },
                FilmGate = Input { Value = FuID { "FullAperture", }, },
                ApertureW = Input { Value = 0.98, },
                ApertureH = Input { Value = 0.735, },
                ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, },
                ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
            },
            ViewInfo = OperatorInfo { Pos = { 935, 313.5, }, },
        },
        Transform3D1 = Transform3D {
            Inputs = {
                SceneInput = Input {
                    SourceOp = "Camera3D1",
                    Source = "Output",
                },
                ["Transform3DOp.Rotate.Y"] = Input {
                    Value = -8.7,
                    Exp<b></b>ression = "-time/10",
                },
            },
            ViewInfo = OperatorInfo { Pos = { 1045, 313.5, }, },
        },
        Shape3D1 = Shape3D {
            Inputs = {
                ["Transform3DOp.Rotate.X"] = Input { Value = -90, },
                MaterialInput = Input {
                    SourceOp = "ChannelBoolean1",
                    Source = "MaterialOutput",
                },
                ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
                ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            },
            ViewInfo = OperatorInfo { Pos = { 935, 214.5, }, },
        },
        Merge3D1 = Merge3D {
            Inputs = {
                SceneInput1 = Input {
                    SourceOp = "Shape3D1",
                    Source = "Output",
                },
                SceneInput2 = Input {
                    SourceOp = "PointLight1",
                    Source = "Output",
                },
                SceneInput3 = Input {
                    SourceOp = "Transform3D1",
                    Source = "Output",
                },
            },
            ViewInfo = OperatorInfo { Pos = { 1155, 214.5, }, },
        },
        PointLight1 = LightPoint {
            Inputs = {
                ["Transform3DOp.Translate.X"] = Input { Value = 0.0111797825247418, },
                ["Transform3DOp.Translate.Y"] = Input { Value = 0.52352218786569, },
                ["Transform3DOp.Translate.Z"] = Input { Value = -0.166685676712661, },
                Green = Input { Value = 0.883939025186398, },
                Blue = Input { Value = 0.695288888888889, },
            },
            ViewInfo = OperatorInfo { Pos = { 935, 115.5, }, },
        },
        Blinn1 = MtlBlinn {
            Inputs = {
                ["Diffuse.Color.Red"] = Input { Value = 0, },
                ["Diffuse.Color.Green"] = Input { Value = 0, },
                ["Diffuse.Color.Blue"] = Input { Value = 0, },
                ["Specular.Nest"] = Input { Value = 1, },
                ["Bumpmap.Material"] = Input {
                    SourceOp = "BumpMap1",
                    Source = "MaterialOutput",
                },
                MaterialID = Input { Value = 3, },
            },
            ViewInfo = OperatorInfo { Pos = { 715, 214.5, }, },
        },
        Reflect1 = MtlReflect {
            Inputs = {
                BackgroundMaterial = Input {
                    SourceOp = "Background1",
                    Source = "Output",
                },
                ["Reflection.GlancingStrength"] = Input { Value = 0.8, },
                ["Reflection.FaceOnStrength"] = Input { Value = 0.5641892, },
                ["Reflection.Color.Material"] = Input {
                    SourceOp = "SphereMap1",
                    Source = "MaterialOutput",
                },
                ["Bumpmap.Material"] = Input {
                    SourceOp = "BumpMap1",
                    Source = "MaterialOutput",
                },
                MaterialID = Input { Value = 6, },
            },
            ViewInfo = OperatorInfo { Pos = { 715, 247.5, }, },
        },
        ChannelBoolean1 = MtlChanBool {
            Inputs = {
                OperationR = Input { Value = 4, },
                OperationG = Input { Value = 4, },
                OperationB = Input { Value = 4, },
                OperationA = Input { Value = 1, },
                BackgroundMaterial = Input {
                    SourceOp = "Reflect1",
                    Source = "MaterialOutput",
                },
                ForegroundMaterial = Input {
                    SourceOp = "Blinn1",
                    Source = "MaterialOutput",
                },
                MaterialID = Input { Value = 4, },
            },
            ViewInfo = OperatorInfo { Pos = { 825, 247.5, }, },
        },
        Instance_CustomTool1_1 = Custom {
            Inputs = {
                NumberIn1 = Input {
                    Value = 0.18,
                    Exp<b></b>ression = "(time%50) / 250",
                },
                NumberIn2 = Input { Value = 0.25, },
                LUTIn1 = Input {
                    SourceOp = "CustomTool1_1LUTIn1",
                    Source = "Value",
                },
                LUTIn2 = Input {
                    SourceOp = "CustomTool1_1LUTIn2",
                    Source = "Value",
                },
                LUTIn3 = Input {
                    SourceOp = "CustomTool1_1LUTIn3",
                    Source = "Value",
                },
                LUTIn4 = Input {
                    SourceOp = "CustomTool1_1LUTIn4",
                    Source = "Value",
                },
                Intermediate1 = Input { Value = "x + (r2 * 2 - 1) * n1", },
                Intermediate2 = Input { Value = "y + (g2 * 2 - 1) * n1", },
                RedExp<b></b>ression = Input { Value = "getr1w(i1, i2)", },
                GreenExp<b></b>ression = Input { Value = "getg1w(i1, i2)", },
                BlueExp<b></b>ression = Input { Value = "getb1w(i1, i2)", },
                Image1 = Input {
                    SourceOp = "Loader1",
                    Source = "Output",
                },
                Image2 = Input {
                    SourceOp = "Loader2",
                    Source = "Output",
                },
            },
            ViewInfo = OperatorInfo { Pos = { 385, 214.5, }, },
        },
        CustomTool1_1LUTIn1 = LUTBezier {
            KeyColorSplines = {
                [0] = {
                    [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
                    [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
                },
            },
            SplineColor = { Red = 204, Green = 0, Blue = 0, },
            NameSet = true,
        },
        CustomTool1_1LUTIn2 = LUTBezier {
            KeyColorSplines = {
                [0] = {
                    [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
                    [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
                },
            },
            SplineColor = { Red = 0, Green = 204, Blue = 0, },
            NameSet = true,
        },
        CustomTool1_1LUTIn3 = LUTBezier {
            KeyColorSplines = {
                [0] = {
                    [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
                    [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
                },
            },
            SplineColor = { Red = 0, Green = 0, Blue = 204, },
            NameSet = true,
        },
        CustomTool1_1LUTIn4 = LUTBezier {
            KeyColorSplines = {
                [0] = {
                    [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
                    [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
                },
            },
            SplineColor = { Red = 204, Green = 204, Blue = 204, },
            NameSet = true,
        },
        Merge = Merge {
            NameSet = true,
            Inputs = {
                Blend = Input {
                    SourceOp = "MergeBlend",
                    Source = "Value",
                },
                MaskChannel = Input { Value = 0, },
                PerformDepthMerge = Input { Value = 0, },
                Background = Input {
                    SourceOp = "CustomTool1_1",
                    Source = "Output",
                },
                Foreground = Input {
                    SourceOp = "Instance_CustomTool1_1",
                    Source = "Output",
                },
            },
            ViewInfo = OperatorInfo { Pos = { 495, 214.5, }, },
            Colors = {
                TileColor = { R = 0.27843137254902, G = 0.517647058823529, B = 0.290196078431373, },
                TextColor = { R = 0.807843137254902, G = 0.807843137254902, B = 0.807843137254902, },
            },
        },
        MergeBlend = BezierSpline {
            SplineColor = { Red = 205, Green = 205, Blue = 205, },
            NameSet = true,
            KeyFrames = {
                [0] = { 0, RH = { 8.33333333333333, 0.333333333333333, }, Flags = { Linear = true, Loop = true, PreLoop = true, }, },
                [25] = { 1, LH = { 16.6666666666667, 0.666666666666667, }, RH = { 33.3333333333333, 0.666666666666667, }, Flags = { Linear = true, }, },
                [50] = { 0, LH = { 41.6666666666667, 0.333333333333333, }, Flags = { Linear = true, Loop = true, PreLoop = true, }, },
            },
        },
        CustomTool1_1 = Custom {
            Inputs = {
                NumberIn1 = Input {
                    Value = 0.08,
                    Exp<b></b>ression = "((time +25)%50) / 250",
                },
                LUTIn1 = Input {
                    SourceOp = "CustomTool1_1LUTIn1",
                    Source = "Value",
                },
                LUTIn2 = Input {
                    SourceOp = "CustomTool1_1LUTIn2",
                    Source = "Value",
                },
                LUTIn3 = Input {
                    SourceOp = "CustomTool1_1LUTIn3",
                    Source = "Value",
                },
                LUTIn4 = Input {
                    SourceOp = "CustomTool1_1LUTIn4",
                    Source = "Value",
                },
                Intermediate1 = Input { Value = "x + (r2 * 2 - 1) * n1", },
                Intermediate2 = Input { Value = "y + (g2 * 2 - 1) * n1", },
                RedExp<b></b>ression = Input { Value = "getr1w(i1, i2)", },
                GreenExp<b></b>ression = Input { Value = "getg1w(i1, i2)", },
                BlueExp<b></b>ression = Input { Value = "getb1w(i1, i2)", },
                Image1 = Input {
                    SourceOp = "Loader4",
                    Source = "Output",
                },
                Image2 = Input {
                    SourceOp = "Loader2",
                    Source = "Output",
                },
            },
            ViewInfo = OperatorInfo { Pos = { 385, 181.5, }, },
        },
        Loader1 = Loader {
            Clips = {
                Clip {
                    ID = "Clip1",
                    Filename = "Z:\\Projects\\Tests\\images\\flowmap\\wave0.tga",
                    FormatID = "TargaFormat",
                    Length = 2,
                    LengthSetManually = true,
                    TrimIn = 0,
                    TrimOut = 0,
                    ExtendFirst = 0,
                    ExtendLast = 0,
                    Loop = 0,
                    AspectMode = 0,
                    Depth = 4,
                    TimeCode = 0,
                    GlobalStart = 0,
                    GlobalEnd = 0,
                },
            },
            Inputs = {
                Depth = Input { Value = 4, },
                EnableClipList = Input { Value = 0, },
            },
            ViewInfo = OperatorInfo { Pos = { 165, 313.5, }, },
        },
    },
}

The images used are in from the graphicsrunner site you linked (i just converted the dds files to tga)

#4 redoddity

redoddity

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 190 posts

Posted 25 September 2012 - 12:19 PM



#5 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 25 September 2012 - 12:20 PM

Wwwwwoooooooo!

Oh man! I only get to play with Fusion late at night these days. You guys are costing me my sleep...

#6 PeZiK

PeZiK

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 38 posts

Posted 25 September 2012 - 02:47 PM

Holy Moly redoddity, this is amazing!!!

I created a flowmap in the FlowMap editor and ported into your script and it works like a charm!

Is there any change I could get the missing bitmaps that you're using?

* wave#.tga
* grassCUBE.tga

Thanks a billion :D

P.

#7 redoddity

redoddity

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 190 posts

Posted 25 September 2012 - 05:28 PM

Not at work any more, but the site you linked has a download at the bottom (https://skydrive.liv...031B5BFA52B!246)
I just converted the .dds files in XnView to .tga, and that's about it.

The rest is pretty much just converting the shader code to a custom tool (it doesn't do tiling normal maps with a larger flow on to of it, but it gives you an idea where to start.)

#8 PeZiK

PeZiK

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 38 posts

Posted 25 September 2012 - 06:53 PM

Thanks again redoddity, this is a great start. :)

P.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users