Search Unity

NumberFlow, visual editor for procedural textures

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

  1. Pointcloud

    Pointcloud

    Joined:
    Nov 24, 2014
    Posts:
    37
    That worked! Thanks for the update, the fps on the hololens is very high too. I ran the gallery example scene without a problem. Quick question, is there a way to extrude the vertices of an object, such as a plane, based on the luminosity values of the noise? Something similar to the extrusion effects from this plugin (https://www.assetstore.unity3d.com/en/?gclid=CPvpive1jcQCFQEIwwodCVIAvg#!/content/3957)? Thanks again, its really exciting to get some holographic noise!
     
  2. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    The included Noise Example and Terrain scenes use noise to adjust the vertices of a plane. These scenes adjust the mesh vertices and normals on the CPU. More advanced would be to do it on the GPU, via tessellation.
     
  3. Pointcloud

    Pointcloud

    Joined:
    Nov 24, 2014
    Posts:
    37
    Ok great! Thanks again for all of your help! One more quick question... what would be the best way to animate the frequency, octaves, lacunarity, persistence, and zOffset over Time.deltaTime? I'm playing around with the NoiseExample.cs script to see if I can get something like this to happen... I can get Noise to animate in the NumberFlow Diagram Manager, is there also a way to do a zOffset with the noise generated in the NumberFlow Diagram Manager? Thanks!
     
    Last edited: May 19, 2017
  4. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    The manager doesn't support animation. In general, continuously generating textures is expensive. The most simple way to animate the texture of a material would be like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using CatlikeCoding.NumberFlow;
    3.  
    4. public class AnimationExample : MonoBehaviour {
    5.  
    6.     public Material material;
    7.  
    8.     public Diagram diagram;
    9.  
    10.     public int width, height;
    11.  
    12.     Value timeValue;
    13.  
    14.     Color[] buffer;
    15.     Texture2D texture;
    16.  
    17.     void Awake () {
    18.         timeValue = diagram.GetInputValue("Time");
    19.         buffer = new Color[width * height];
    20.         texture = new Texture2D(width, height);
    21.         material.mainTexture = texture;
    22.     }
    23.  
    24.     void Update () {
    25.         timeValue.Float = Time.time;
    26.         diagram.Fill(buffer, width, height);
    27.         texture.SetPixels(buffer);
    28.         texture.Apply();
    29.     }
    30. }
    That component fills the texture every update, which is only really feasible with small textures. An improvement would be to update at a lower frequency. Or spread the filling over multiple frames, trying to make sure your app maintains a minimum frame rate.

    In case of a short animation loop, it's best to generate all frames at once at startup and cycle through the textures.
     
  5. Gavriel

    Gavriel

    Joined:
    Apr 3, 2013
    Posts:
    8
    Your asset looks very interesting. Do you have an example on how to manipulate nodes at runtime? I'm looking forward to using multiple random static textures in my game. The textures are going to morph over time so adding or removing nodes at runtime would be interesting.
     
  6. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    The diagrams cannot be edited at run time. Instead, you use input nodes to configure them. You can design diagrams with configuration options, which allows you to produce different results. The simplest example is adding an offset to sample a slice of 3D noise. Diagrams can also be chained, by using texture inputs. You do have to program such a pipeline yourself though.
     
  7. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    191
    Hello dear forum,
    is there a possibility to make a GetFloat(x,y) or even GetFloat(x,y,z) on a diagram? just like with Mathf.PerlinNoise() .

    how would I do that?
    I have a:
    Code (CSharp):
    1. public CatlikeCoding.NumberFlow.Diagram Diag;
    but I don't quite understand how I can retrieve single floats (or ints) on certain coordinates.
    I hope there is a (simple) way, so I can integrate it into my current project, but it looks very promising. :)
     
  8. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    There is no direct API for that, instead there are the various Diagram.Fill methods, which work with Color arrays. If you want per-pixel control they you could grab an output node directly and manipulate the diagram to set the coordinates correctly, but it's not designed for that.
     
  9. MikeChr

    MikeChr

    Joined:
    Feb 2, 2018
    Posts:
    43
    Hi. Not much activity here. Is Numberflow compatible with 2019 HDRP?
    Thanks.
     
  10. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @MikeChr Yes. NumberFlow doesn't depend on shaders. Textures work with any render pipeline. The example scenes use the default legacy pipeline though.
     
  11. DarkoGarcia

    DarkoGarcia

    Joined:
    Aug 14, 2018
    Posts:
    5
    I download the free version (1.2.2) and when I try to implement in my project sends an error about the GUITexture, so I can't run my project with the plug-in, actually I didn't found a correct solution: I change the GUITexture to the Image one but there's a big refactor in a lot of components. Can someone help me to solve that?
     
  12. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @DarkoGarcia In that version GUITexture is only used in old example scenes. NumberFlow itself doesn't need them. You can delete the offending example scripts. That will only make some example scenes nonfunctional.
     
    Zyblade and DarkoGarcia like this.