(Created page with "Seamless is a powerful graph builder integrated in the Unity Editor. It allows you to bake beautiful procedural textures from noise or geometric primitives, coupled with mathematical operations, image filters, etc. Seamless works natively with any render pipeline on any Unity version above 2018.1. thumb|366x366px|The Seamless logo. Fun-fact: it was created with the tool itself == Setup == The whole package is contained in the Seamless folde...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
Seamless is a powerful graph builder integrated in the Unity Editor. It allows
Sampl is a powerful audio graph builder integrated in the Unity Editor. It allows


you to bake beautiful procedural textures from noise or geometric primitives,
you to bake unique procedural audio clips from noise, trigonometric or instrument primitives,


coupled with mathematical operations, image filters, etc.
coupled with mathematical operations, filters, etc.


Seamless works natively with any render pipeline on any Unity version above
Sampl works natively with any render pipeline on any Unity version above
 
2018.1.
[[File:SeamlessLogo.png|thumb|366x366px|The Seamless logo. Fun-fact: it was created with the tool itself]]


2020.3
== Setup ==
== Setup ==
The whole package is contained in the Seamless folder resulting from the import. You can move it wherever you want, but it is recommended to keep the same folder structure.
The whole package is contained in the Sampl folder resulting from the import. You can move it wherever you want, but it is recommended to keep the same folder structure.


== Basics ==
== Basics ==
You can create a new Seamless graph from the right-click context menu in the project window.
You can create a new Sampl graph from the right-click context menu in the project window.
 
[[File:Sampl2.png|frameless]]


[[File:Seamless MAN1.png|frameless|330x330px]]


Each graph is saved as a SeamlessObject in a <code>.asset</code> file. You can recognize
Each graph is saved as a SamplObject in a <code>.asset</code> file. You can recognize


them with the seamless logo. You can change the texture size from the inspector.
them with the Sampl logo. You can change some parameters from the inspector such as sampling frequency and the length of the clip.


[[File:Seamless MAN2.png|frameless]]
[[File:Sampl1.png|frameless|713x713px]]


You can open a graph by double-clicking on it. On Unity 2019.2 and above, the window will try dock itself next to the scene window, otherwise it will appear as a floating window, that you can dock manually.
You can open a graph by double-clicking on it. The window will try to dock itself next to the scene window, otherwise it will appear as a floating window, that you can dock manually.
[[File:Image 2023-04-27 181556615.png|center|thumb|750x750px|The provided procedural rain example]]


== Navigation ==
== Navigation ==
The navigation in the main canvas is similar to other graph editors such as Shadergraph or the animator. You can zoom in/out using scroll wheel, move by click & drag on the mouse scroll wheel. Nodes can be selected by clicking on it, or by drawing a selection rectangle. You can drag selected nodes to move them.
The navigation in the main canvas is similar to other graph editors such as Shadergraph or the animator. You can zoom in/out using scroll wheel, move by click & drag on the mouse scroll wheel. Nodes can be selected by clicking on it, by drawing a selection rectangle, or by using Ctrl + click. You can drag selected nodes to move them.
 
You cannot select or interact with links: they are 100% visual. To add a link, you must click and drag from an output, links cannot be created backwards. To remove a link you must remove one of the nodes it connect, click the red cross on its left, or connect another link to the same output node. There is a header on the top of each window containing information and buttons to save, save as, reload the graph, export all the export nodes, or show/hide stats on each node.
 
To create a new node, just right click on the canvas and a context menu will appear. You can also start building a link and releasing the mouse left button in a free space, the same context menu will appear and the link will be associated with the first input (if there is any) of the added node. You can cancel by pressing ESC.


You cannot select or interact with links : they are 100% visual. To add a link, you must click and drag from an output, links cannot be created backwards. To remove a link you must remove one of the nodes it connect, or connect another link to the same output node. There is a header on the top of each window containing information and buttons to save, save as, and reload the graph.
[[File:Seamless MAN3.png|border|center|frameless|725x725px]]To create a new node, just right click on the canvas and a context menu will appear. You can also start building a link and releasing the mouse left button in a free space, the same context menu will appear and the link will be associated with the first input (if there is any) of the added node. You can cancel by pressing ESC twice.
[[File:Seamless MAN4.png|border|center|frameless|724x724px]]




Some nodes contain one or several parameters. You can change their value as a text edit or as a slider with the mouse.
Some nodes contain one or several parameters. You can change their value as a text edit or as a slider with the mouse.


Once you are happy with a result, you can export it as a static image using an Export node. You can use as many Export nodes as you want. So far, Seamless only supports PNG export.
Once you are happy with a node's clip, you can export it as a static wav clip using an Export node. You can use as many Export nodes as you want. So far, Sampl only supports WAV export.
[[File:Seamless MAN5.png|border|center|frameless|561x561px]]
 
You can browse the path by clicking on the Folder icon. Make sure you select a path included in the Assets folder of your project.
You can browse the path by clicking on the Folder icon. Make sure you select a path included in the Assets folder of your project.
== Nodes list ==
== Nodes list ==
[[File:Seamless Primitive Nodes.png|thumb|770x770px|All the primitive nodes]]
[[File:Image 2023-05-02 093231644.png|thumb|All of Sampl's primitives|none|756x756px]]
 
=== Multiply   ===
=== Preview ===
Multiplies two inputs. The Multiplier parameter can adjust the output gain.
Does nothing. Displays the input as it is.
 
=== OneMinus ===
Computes the negative or R, G and B. Keep Alpha untouched.
 
=== Add ===
Adds A and B channel-wise. Clamps automatically between 0 and 1.
 
=== Subtract ===
Subtracts A and B channel-wise.
 
=== Multiply ===
Multiplies A and B channel-wise. A multiplier float field let you ajust the result.
 
===Pow===
Applies the mathematical power function to Input with a float exponent.
 
===Divide===
Divides A by B channel-wise.
 
===Clamp===
Clamps Input between Min and Max float parameters.
 
===Step===
Binarizes the input channel-wise, using a float edge between 0 and 1.
 
===Lerp (since version 2.1)===
Perform a linear interpolation from A to B according to T channel-wise.


===Hash (since version 3.1)===
=== Add        ===
Perform a hashing of the input channel-wise. Simple way to randomize the input.
Adds the two inputs


===Blur===
=== Subtract  ===
Applies Gaussian Blur to the input, using a float radius and an integer steps number parameters.
Subtracts the input A with input B


===EdgeDetection===
=== Clamp      ===
Performs the input’s edge detection. You can adjust the steps number in pixels.
Clamps the input in the given range


===Normal===
=== Invert    ===
Computes normal map from a given heightmap. Only the red channel of the input is considered. You can adjust the strength of the normal effect with a float parameter.
Inverts the phase


===Barrel===
=== ShiftScale ===
Applies Barrel Distortion algorithm to the input. The power is controlled by a float parameter.
A multiple parameter node to control the pitch and a relative temporal offset


===Spherize===
=== Lerp      ===
Maps the input on a sphere.
Linear interpolation between 2 clips A and B, following the T curve. T's [-1,1] interval is remapped according to the provided parameter.


===Curvature===
=== Warp      ===
Computes the curvature of the input. Useful for ambient occlusion estimation.
Temporal warping feature. For each sample in the output clip : <math>Output[i]= Input[i + Dist[i] * Multiplier];</math>


===Luminance (since version 3.1)===
=== Reverse    ===
Computes the grayscale luminance of the colored input. Dot product of (R,G,B) with (0.299, 0.587, 0.114)
Time reverse.


===TilingOffset===
=== Remap      ===
Tiles and/or offsets the input following the given parameters.
Linear remapping of the input [-1,1] into the given interval.


===Rotate===
=== Equalizer  ===
Rotates the input of the given angle in degrees.
Experimental. An FFT based GPU equalizer. Uses unity built-in curve widget.


===HFlip===
=== Reverb    ===
Flips the input horizontally.
Simulates reverb. Useful to "smooth" an aggressive sound


===VFlip===
=== Delay      ===
Flips the input vertically.
Echoes with linear damping. You can control the number of feedbacks and their interval with the given parameters.


===Splatter (since version 3.0)===
=== Maximize  ===
Splatters an Input following a grid size and randomizes its local position, rotation and scale following the entered parameters.  
Amplifies samples that are above the intensity threshold given in the parameters.


===Warp (since version 3.0)===
=== Envelope  ===
Warps an Input following to the given direction : Red channel for horizontal warp and green channel for vertical. Direction's blue and alpha channels are ignored. The intensity can be controlled with the Multiplier parameter.
Returns the intensity envelope of the input signal using the given window size. The ouput is always in the [0,1] interval.


===Split===
=== Resample  ===
Splits the 4 channels of the input into 4 B&W outputs.
Simulates a downsampling to the given number of bits.


===Merge===
=== Fade      ===
Creates a RGBA output from 4 inputs. Only the red channel of each input is considered.
In and Out fading.


===Color===
=== Widen      ===
Outputs a uniform color determined by a color picker.
Experimental. Useful to get a proper stereo track from a mono one.


===RenderTexture===
=== Constant  ===
Outputs the given RenderTexture. If the render texture size is different than the one defined in the graph settings, the input texture will appear bigger/smaller accordingly on the children nodes. <!-- If assets are reimported, the RenderTexture may be missing, just put it back in the object field. -->
Constant value in the interval [-1,1]


===Squircle===
=== Noise      ===
Creates a squircle according to the given parameters.
White noise.


===RoundedRect===
=== SineWave  ===
Creates a rounded rectangle. Useful for capsule too.
Pure sine wave. You can control the frequency, phase and the amplitude from the parameters.  


===Polygon===
=== Sawtooth  ===
Creates a polygon according to the given parameters
Sawtooth wave. You can control the frequency, phase and the amplitude from the parameters.


===UV===
=== TriangleWave ===
Creates a UV gradient. Horizontal linear gradient in R, vertical linear gradient in G, 0 in B and 1 in A.
Triangle wave. You can control the frequency, phase and the amplitude from the parameters.  


===Noise===
=== SquareWave ===
Creates tileable IQ noise according to the given parameters.
Square wave. You can control the frequency, phase and the amplitude from the parameters.  


===Voronoi===
=== SineRamp  ===
Creates tileable voronoi noise according to the given parameters. Additionnal corollary outputs are also provided.
Linear pure sine riser. You can control the frequencies, phase and the amplitude from the parameters.  


===FractalNoise (since version 2.0)===
=== DynamicSine ===
Creates a tileable fractal IQ Noise according to the given parameters. Supports up to 8 octaves.
Outputs a sine with a variable frequency, depending on the input and the remapping parameters provided. You can choose the sine type, phase, window size (the lower the better but also the longer to process), and amplitude from the parameters.


===FractalWarp (since version 2.0)===
===AudioClip===
Creates a tileable fractal warp based on IQ Noise according to the given parameters. Supports up to 8 octaves.
Outputs the given AudioClip. An operation is performed to adapt the sample rate to the graph's one, but the samples are not stretched to fit the length of the clip, padding 0 are added instead (or the clip is clamped if it is longer). <!-- If assets are reimported, the AudioClip may be missing, just put it back in the object field. -->


===Export===
=== Kick      ===
Let the user export a PNG image from the input. The image will have the same size as in the graph settings. If you export a normal map, don’t forget to apply the right import settings, Seamless won’t do it automatically.
Experimental. Close from the pad sound but dissonant.  


== Tips and tricks ==
=== Pad        ===
=== Make an existing picture seamlessly tileable ===
Experimental. A simple synth sound.
Seamless main use case is procedural texture generation, but you can also use existing pictures and make them tileable thanks to the Splatter node. Here is how:


* Create a CustomRenderTexture and sets its Initialization and update modes on OnLoad or Realtime according to your needs, and set your custom picture in the initialization texture field.
=== Curve      ===
Draw your own curve from unity curve input widget.


* Make sure the CustomRenderTexture is the same size than the graph you want to use it in.
=== Export  ===
 
Export any clip you want. Mono and Stereo are supported. The provided path must be in the Assets folder from the current project.
* Create a new SeamlessGraph.  
 
* Add a RenderTexture node and plug the CustomRenderTexture.
* Multiply it with a 0.5 falloff, 32 sided polygon to fade the borders. Also, you should dim the result with the multiplier parameter to avoid overexposure later.
 
* Plug it as a Splatter node Input. As long as you keep low scales (lower than 3), the output is guaranteed to be tileable. For higher scales, some seams may appear, or not, it depends on your input picture.
* You can play with different parameters to fit your needs.[[File:Non Tileable to tileable.png|thumb|750x750px|This simple graph turns a non tileable picture to a tileable one.|center]]


== Troubleshooting ==
== Troubleshooting ==


=== The node preview looks brighter than usual ===
=== The graph is frozen, spams errors and no nodes are showing up ===
You are probably using linear color space instead of gamma. Don't worry, the textures will contain exactly the same data, it is just displayed differently on the screen.
The Unity Editor can sometimes free up memory and delete some nodes audio clips. Try to change tab if it is docked, right click on the frozen sampl graph tab and select "close tab". Reopening the graph should solve the issue.
 
Legacy RP use gamma color space by default while URP and HDRP use linear by default.
 
You can switch the color space in <code>Edit->Project Settings->Player->Other Settings</code> but be careful, if will change the visual aspect of your whole game.
 
=== All my nodes turned gray when I opened the graph ===
You probably left the graph's tab for a while and Unity unloaded the render textures to save up memory. Click on the reload button.
 
=== The preview material is pink ===
This issue can happen when switching scenes. Try to re-open the graph.
 
=== The preview material looks overexposed and unlit when the metallic value goes below 1 ===
This is a know issue in HDRP only. With a merge node, set a color whose green channel equals 0 in the occlusion slot (the actual occlusion is controlled by the red channel).
 
=== The preview material displays the normal map in the wrong way ===
Make sure your normal map alpha channel is not 0. Otherwise, the standard shader will try to unpack an already unpacked normal map.


==Contact==
==Contact==
Feel free to contact me via e-mail: [mailto:chaumartinleo@gmail.com chaumartinleo@gmail.com]
Feel free to contact me via e-mail: [mailto:support@leochaumartin.com support@leochaumartin.com]
 
== References ==
https://galloscript.itch.io/texgraph

Latest revision as of 23:13, 12 February 2024

Sampl is a powerful audio graph builder integrated in the Unity Editor. It allows

you to bake unique procedural audio clips from noise, trigonometric or instrument primitives,

coupled with mathematical operations, filters, etc.

Sampl works natively with any render pipeline on any Unity version above

2020.3

Setup

The whole package is contained in the Sampl folder resulting from the import. You can move it wherever you want, but it is recommended to keep the same folder structure.

Basics

You can create a new Sampl graph from the right-click context menu in the project window.

Sampl2.png


Each graph is saved as a SamplObject in a .asset file. You can recognize

them with the Sampl logo. You can change some parameters from the inspector such as sampling frequency and the length of the clip.

Sampl1.png

You can open a graph by double-clicking on it. The window will try to dock itself next to the scene window, otherwise it will appear as a floating window, that you can dock manually.

The provided procedural rain example

Navigation

The navigation in the main canvas is similar to other graph editors such as Shadergraph or the animator. You can zoom in/out using scroll wheel, move by click & drag on the mouse scroll wheel. Nodes can be selected by clicking on it, by drawing a selection rectangle, or by using Ctrl + click. You can drag selected nodes to move them.

You cannot select or interact with links: they are 100% visual. To add a link, you must click and drag from an output, links cannot be created backwards. To remove a link you must remove one of the nodes it connect, click the red cross on its left, or connect another link to the same output node. There is a header on the top of each window containing information and buttons to save, save as, reload the graph, export all the export nodes, or show/hide stats on each node.

To create a new node, just right click on the canvas and a context menu will appear. You can also start building a link and releasing the mouse left button in a free space, the same context menu will appear and the link will be associated with the first input (if there is any) of the added node. You can cancel by pressing ESC.


Some nodes contain one or several parameters. You can change their value as a text edit or as a slider with the mouse.

Once you are happy with a node's clip, you can export it as a static wav clip using an Export node. You can use as many Export nodes as you want. So far, Sampl only supports WAV export.

You can browse the path by clicking on the Folder icon. Make sure you select a path included in the Assets folder of your project.

Nodes list

All of Sampl's primitives

Multiply

Multiplies two inputs. The Multiplier parameter can adjust the output gain.

Add

Adds the two inputs

Subtract

Subtracts the input A with input B

Clamp

Clamps the input in the given range

Invert

Inverts the phase

ShiftScale

A multiple parameter node to control the pitch and a relative temporal offset

Lerp

Linear interpolation between 2 clips A and B, following the T curve. T's [-1,1] interval is remapped according to the provided parameter.

Warp

Temporal warping feature. For each sample in the output clip :

Reverse

Time reverse.

Remap

Linear remapping of the input [-1,1] into the given interval.

Equalizer

Experimental. An FFT based GPU equalizer. Uses unity built-in curve widget.

Reverb

Simulates reverb. Useful to "smooth" an aggressive sound

Delay

Echoes with linear damping. You can control the number of feedbacks and their interval with the given parameters.

Maximize

Amplifies samples that are above the intensity threshold given in the parameters.

Envelope

Returns the intensity envelope of the input signal using the given window size. The ouput is always in the [0,1] interval.

Resample

Simulates a downsampling to the given number of bits.

Fade

In and Out fading.

Widen

Experimental. Useful to get a proper stereo track from a mono one.

Constant

Constant value in the interval [-1,1]

Noise

White noise.

SineWave

Pure sine wave. You can control the frequency, phase and the amplitude from the parameters.

Sawtooth

Sawtooth wave. You can control the frequency, phase and the amplitude from the parameters.

TriangleWave

Triangle wave. You can control the frequency, phase and the amplitude from the parameters.

SquareWave

Square wave. You can control the frequency, phase and the amplitude from the parameters.

SineRamp

Linear pure sine riser. You can control the frequencies, phase and the amplitude from the parameters.

DynamicSine

Outputs a sine with a variable frequency, depending on the input and the remapping parameters provided. You can choose the sine type, phase, window size (the lower the better but also the longer to process), and amplitude from the parameters.

AudioClip

Outputs the given AudioClip. An operation is performed to adapt the sample rate to the graph's one, but the samples are not stretched to fit the length of the clip, padding 0 are added instead (or the clip is clamped if it is longer).

Kick

Experimental. Close from the pad sound but dissonant.

Pad

Experimental. A simple synth sound.

Curve

Draw your own curve from unity curve input widget.

Export

Export any clip you want. Mono and Stereo are supported. The provided path must be in the Assets folder from the current project.

Troubleshooting

The graph is frozen, spams errors and no nodes are showing up

The Unity Editor can sometimes free up memory and delete some nodes audio clips. Try to change tab if it is docked, right click on the frozen sampl graph tab and select "close tab". Reopening the graph should solve the issue.

Contact

Feel free to contact me via e-mail: support@leochaumartin.com