Search Unity

NumberFlow, visual editor for procedural textures

Discussion in 'Assets and Asset Store' started by Jasper-Flick, Nov 21, 2013.

  1. Game-Whiz

    Game-Whiz

    Joined:
    Nov 10, 2011
    Posts:
    122
    Sure. I'll submit a bug report to Unity with your plugin, so that it's (hopefully) corrected when 4.6 comes out.
     
  2. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @Game Whiz: It is better to provide a minimal setup to reproduce the bug. A single script with a single public gradient variable as a component on one game object should do it.
     
  3. Game-Whiz

    Game-Whiz

    Joined:
    Nov 10, 2011
    Posts:
    122
    Don't worry. I have dozens of successfully submitted bug reports, and the great majority of them have been reproduced by Unity's team. I should do fine ;).
     
  4. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    I have made a FREE version of NumberFlow available for non-commercial use. You can find it on the website. This version is built for Unity 5.0.1 and does not include most source code.

    $numberflow-free.jpg

    Grab it and have some fun!
     
    Last edited: May 2, 2019
  5. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Hi would it be possible to add vector graphics support to this tool ? If it supported SVG input nodes for example it could be used to efficiently pack and render vector graphics to use on procedural textures. It would be even more powerful if you could provide it with vector shape keyframes and then have it procedurally tween between them at run time.

    This tool is very powerful but a bit tricky for people to wrap there heads around. If you made it support vector masks and then made a tutorial showing how to apply some SVG text over the top of a low res bitmap and generate the texture at runtime to combine them together without losing the text resolution it would be a good example for people to see why it is useful.
     
  6. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @IanStanbridge: It's a neat idea, but vector graphics are an entirely different cup of tea. It would boil down to first rasterizing the SVG data to an intermediate texture before NumberFlow's rasterization process could make use of it. If you have an SVG rasterizer you could hook it up to NumberFlow by means of an input texture. However, fast, efficient, and correct SVG rasterization is a big project all by itself and there currently aren't good options available for Unity in C#.
     
  7. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
  8. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @davidsirmons: That is apples and oranges. Both fruit but quite different. NumberFlow is a visual editor that creates textures and runs on the CPU. You link to CG code for shaded and deformed geometry which runs on the GPU.
    Despite the different use cases, it's still inspirational material.
     
  9. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Hi Jasper.
    I am now a user from your assert. It is fantastic.
    My english is fantastic in the other side :) <- sorry

    I need do a texture change in the time. I had reading some examples, and the demo "noise blend" run in time by self.

    How is this ? Can I get control the velocity ?

    Thanks.

    Please, I am very novell in Unity and javascript / c#

    Thanks for the develop this assert !

    PD.: Can I get tex that modify the grown as the unity example "Normal Extrusion" ?
     
  10. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @glunity To have a texture change with time, use a float input node in your diagram. Then have a component script set that node's value to the current time and fill the texture again each update. The demo does this, though it's a little more complicated because it uses multithreading and controls multiple diagrams and settings.

    You can control the change velocity by multiplying the input time by some factor, either in the diagram or in your script.

    If you're new to scripting, have a look at my Unity C# tutorials.

    Do you mean the "Normal Extrusion" surface shader example, which bloats the soldier? That is accomplished with a vertex shader that moves vertices in the direction of their normal. It uses mesh vertex data for this, not texture data.
     
  11. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Hi Jasper !
    :)
    I go to tutorial. Thanks for all.
     
  12. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Sorry Jasper. A problem.
    I see the windows info bad.
    In all I create new. Before I downloaded the free version. Then I get the commercial.
    I am new in this system, then I am not shure where is the problem.

    Thanks for all.
    Glunity
    Captura de pantalla 2014-06-21 a la(s) 12.09.20.png
     
  13. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @glunity Which Unity version are you using? Make sure you remove the free version's DLLs.
     
  14. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Hi Jasper.
    I use the 4.5.0.f6

    Mac osx 10.9.3

    I had erased all from all, I just create a new, then I import from assert.
     
  15. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @glunity Got it. To fix this, open Plugins / Editor / Catlike Coding / NumberFlow / DiagramWindowNode.cs and change lines 230 - 232
    Code (csharp):
    1. #ifUNITY_4_3
    2.    EditorGUIUtility.labelWidth = labelWidth;
    3. #endif
    into
    Code (csharp):
    1.    EditorGUIUtility.labelWidth = labelWidth;
    So remove the Unity 4.3 conditional. I'll push this update to the Asset Store as well.
     
  16. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    THANKS !
    je je, very fast your reply, my friend !
     
  17. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    #Jasper.
    I had followed your instructions.

    I had same problem.

    I had now installed the unity3d 4.5.1 no resolve this problem.

    I do this: Installed 4.5.1
    a new proyect. empty all (none into)
    go to assert, import all from your pack.
    I Go to edit the files code.
    I open the sample texture stone. I see all ok.
    ok in other from your sample materials.

    I create a new material and no get the info big. It is little, as the image I send.

    Sorry my english.

    Can be some I do wrong ?
    Can be I work with two monitors ?
     
  18. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @glunity Oh you mean the output nodes? It's the same deal there, damn those conditionals. Do the same thing, but for Plugins / Editor / Catlike Coding / NumberFlow / DiagramWindowOutputNode.cs lines 80 - 82.
     
  19. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    The above changes are also in the latest version on the Asset Store by now.
     
  20. Lasse-Loepfe

    Lasse-Loepfe

    Joined:
    Mar 28, 2014
    Posts:
    29
    Hi,

    cool stuff!
    just one issue:
    In the DiagramMaterialLink script, method AssignTexturesToMaterials () I had to replace the line

    material.SetTexture(diagram.outputs[o].name, textures[o]);
    by
    material.mainTexture = textures[o];

    otherwise no material was assigned. Is that just me?
    BTW, I'm using unity 4.6.21.

    Best
    Lasse
     
  21. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    It should work fine in 4.6. I just tried it with the first release candidate, 4.6.0f1.

    Make sure you set the name of your output node to _MainTex. That's the texture variable name used by all Unity shaders and is what the mainTexture shorthand property refers to.
     
  22. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    I'm interested into the generation of 3DTex
    Hi,
    i'm interested into the generation of 3DTexures with NumberFlow. With the release of MegaFlow there is a good use case to generate a Texture3D with NumberFlow. Any chance to get this on top of your roadmap?
     
  23. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    Maybe. I'll put it back on my to-investigate list.
     
  24. Zellski

    Zellski

    Joined:
    Jan 25, 2015
    Posts:
    1
    This is an exceptional piece of work! The editor (or maybe the entire topic) may be a bit too demanding for widespread adoption, and personally I want to get my hands dirty with actual code -- but this is really impressive and I'm enjoying playing with it a lot. Kudos.
     
  25. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
  26. lagagne72

    lagagne72

    Joined:
    Nov 23, 2013
    Posts:
    2
    Hello guys, i've been trying to follow the "get started" tutorial, but i can never have the material gain the texture, it just stays blank. I've tried twice on mac and pc, same issue. i double checked that the manager is a prefab and instanced. Is it possible this comes from unity 5? thanks!
     
  27. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @lagagne72 It should work fine with Unity 5 and even Unity 5.2.1. Does the Gallery example work for you? Make sure that you have connected the right diagram and materials.
     
  28. lagagne72

    lagagne72

    Joined:
    Nov 23, 2013
    Posts:
    2
    well after trying again it works! to be honest i dont know what i was doing wrong. it is possible i dragged the material into the instanced material manager instead of its prefab... anyways, thanks :)
     
  29. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    Glad it works!
     
  30. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    I made a change to Perlin and Turbulence noise in version 1.2. The multi-frequency methods are now normalized so their output range is always 0 to 1, regardless of octave count, and even for Perlin noise. So you'll have to check your existing diagrams and adjust scaling and offset for noise output.

    Perlin noise used to have an output range of roughly -0.7 to 0.7. I normalized it to -1-1 for the single-frequency API method and adjusted the multi-frequency version to output values in the 0-1 range. I decided to change the output range of Perlin noise so all noise types now have the same range.

    The noise API has been moved to its own namespace, CatlikeCoding.Noise. The noise methods have been put in their own classes, PerlinNoise, ValueNoise, and VoronoiNoise. You should use these new methods and get rid of the old Math library from older versions.

    The noise code has also been sanitized. Now it's more maintainable and performs a bit better too.
     
    Last edited: May 2, 2019
  31. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Is cubemap support available at this time? I saw that you said it was on the roadmap but haven't seen anything about it being released.
     
  32. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @tbg10101_ No cube map support yet. I haven't found a good user-friendly way to add it yet, but I have some idea I'm going to try out soon.
     
  33. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    In version 1.2.2 I've added 2D versions of all noise types, both the API and diagram nodes. Of course this also includes 2D vector nodes to supply sample points.

    One advantage of 2D noise is that it's quicker to compute than 3D noise. Another reason why you might want to use it is because 2D simply looks a little different than 3D. This is most profound in the cases of Perlin and Turbulence noise, because I use 16 gradient directions for 2D, which has more variety than the 3D gradients. This results in slightly more wavy patterns with less straight lines. To illustrate, here's a material made with 2D Turbulence noise:

    2d.png

    And here's the same material, but with 3D Turbulence noise:

    3d.png

    Of course you cannot morph 2D noise by animating the third dimension. You still need 3D noise for that.
     
    Last edited: May 2, 2019
  34. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    I've tried the free version just today and it's very good! I will be definitely getting the product but it doesn't come with the DLL like the free version does? I actually like to have both the source code and DLL as it fastens the compilation time.
    If there's no limitation in free version(as it seems), I guess I should keep using the DLL after I bought the asset?
     
    Last edited: Nov 11, 2015
  35. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @noanoa Both versions have the same functionality, so yes you can buy the full version, get the source code, and still use the DLLs. Just don't put them both in the same project. You can also compile your own DLLs.
     
    noanoa likes this.
  36. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    until now I used LibNoise for procedural terrain.
    I have tried today (free version) of your plugin, but I can't find any random operation for randomly generated noise from input values. It's very usefull for proceduraly generated data using RND or any seed fuction. Do you have plan to add this one to FlowNumbers plugin?

    Best regards,
    AndyGFX
     
    Last edited: Nov 13, 2015
  37. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @AndyGFX You can use sampling offsets to produce different results, as if using a 2D or 3D seed.
     
  38. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi.
    Yes, this is a way too.

    So, now I have tried step by step sample from video


    and I got always white gameObject. I have same material attached to object which is added to DiagramMaterialManager. After simple debug check, I see that manager is called but texture is not saved to material. Has NumberFlow 1.2.2 something different?

    Technicaly I need get result from my diagram to Texture2D in my other component, which is proceduraly generated world.

    thx.
     
    Last edited: Nov 13, 2015
  39. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @AndyGFX The outlined steps should do the trick. Also, as mentioned in the getting-started document, when using materials with complex editor UIs that set keywords - like the Standard shader - you'd have to select the material so it becomes aware that it should now use textures.

    You can also open the Gallery example scene to see a manager in action.
     
  40. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi, thanks.

    I finally found solution what I need.

    Part of my code, which works in editor and run-time too.

    Code (CSharp):
    1. public void Prepare(int width, int height, float offsetX, float offsetY)
    2.     {
    3.         diagram.Init();
    4.  
    5.         diagram.pixelX = width;
    6.         diagram.pixelY = height;
    7.         pixels = new Color[width * height];
    8.         this.outTexture = new Texture2D(width, height);
    9.  
    10.         diagram.GetInputValue("OffsetX").Float = this.offset.x;
    11.         diagram.GetInputValue("OffsetY").Float = this.offset.y;
    12.         diagram.Fill(pixels, width, height);
    13.  
    14.         // output: generated noise texture
    15.         this.outTexture.SetPixels(pixels);
    16.         this.outTexture.filterMode = FilterMode.Point;
    17.         this.outTexture.Apply();
    18.     }
    Best regards,
    AndyGFX
     
  41. LSpring

    LSpring

    Joined:
    Nov 12, 2014
    Posts:
    68
    This is a great asset. I can tell I'm going to be using this one a lot. Excellent work.

    I thought I would share a graph for basic sky-sphere projected clouds.

    BasicClouds_Flow.jpg

    This uses the spherical projection node, but I added some additional compensation with a curve on the V axis to better "place" the clouds more flatly in the sky, not "on" the dome itself.

    (Note that in this example, anything in the curve below 0.5 is irrelevant.)
    BasicClouds_Curve.jpg

    Here is the gradient I am using for this example. It is very simple.

    BasicClouds_Gradient.jpg

    I am also animating the noise on all three axes using a named float node split into a vector that drives all three dimensions of the noise sampling equally between 0 and 1 over the course of 120 frames. This makes the clouds move through the sky AND change shape when projected.

    Here is a screen capture of the resultant clouds in the sky.

    BasicClouds_01.jpg

    Very basic but a decent start.
     
  42. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    Nice work! I love it when people show off their work. :)
     
  43. Floutre

    Floutre

    Joined:
    Jan 22, 2016
    Posts:
    3
    Hello!

    I've downloaded the free trial. I was interested in some animated textures seen in the Gallery and wanted to test a few things before deciding to buy the plugin or not. Except all the examples are broken :/ I've been able to create a few nodes in a new diagram, without going any further, but if I open example scenes, errors pop in the console. The only working scene is the one for noise (because it uses no diagram I guess).

    I've extracted a few of the thousands of errors for review. Obviously something is going wrong with the diagrams. When I try to open them, the editor window pops, empty, and can't be closed, moved or minimized (but can be resized). Errors must pop in an Update loop.

    Thus, when opening the Gallery scene, objects are there but no textures are generated or shown :(

    I am using a mac , under 10.10.5 (Yosemite), and using Unity 5.3.1p1.

    Thanks for your help :)
     

    Attached Files:

  44. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @Floutre Have you set Asset Serialization mode to Force Text in Editor Settings? As these are binary assets, interpreting them as text assets will produce the errors you get. Set the mode to Mixed or Force Binary. Then you should be able to import without error.

    By the way, the animations in the gallery are done with shaders in combination with static (generated once) texture data.
     
  45. Floutre

    Floutre

    Joined:
    Jan 22, 2016
    Posts:
    3
    Oh right, it's on Force Text!
    I am in the middle of big changes, so I can't really test it right now, but I will soon and I'll let you know how it goes then :)
    Thanks!
     
  46. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    210
  47. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @Rod Galvao You can take the 0-1 output from a noise node, multiply by N, convert to integer, convert back to float, and then divide by N. That gives you up to N terrace levels with hard transitions. Here is a screenshot of an example diagram.

    terraces.png
     
    Last edited: Feb 15, 2016
    Rod-Galvao likes this.
  48. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    210
    Yes! Never thought about that. :/

    Another question: Is there a way to preview the result in a terrain during editor mode?
     
  49. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @Rod Galvao I have never tried initializing a Unity terrain with a generated texture in edit mode. I'm not sure if that could work well.

    You could use a grid mesh with a vertex shader that samples the texture. Then you could hook its material up with the manager and get the height-field in edit mode. That's not a Unity terrain, but the only quick way I can think of now to preview a height-field mesh.
     
    Rod-Galvao likes this.
  50. kaamos

    kaamos

    Joined:
    Aug 6, 2013
    Posts:
    48
    First of all, what a great asset! I'm experiencing a problem though when I try to use a generated texture:

    UnityException: Texture 'Managed NumberFlow Diagram Texture' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.

    Since obviously the texture is procedural, there are no import settings I can adjust to correct this issue. Any thoughts?