How can I create vector fields for use with the new VFX Graph?
How can I create vector field 3D textures for free, for the new VFX Graph particle system? There are a bunch of plugins out there, but I'm not exactly willing to pay upwards of $20 for an asset to use just to TEST the beta VFX Graph. I've even looked for tutorials with Unreal Engine, and they seem to all be using either slightly different versions of the same paid plugins, or using premade vector fields.
Answer by mikejichaow · Jan 23, 2019 at 03:41 AM
What i've found so far is you can make a texture3d through code and save it as a .asset file. Here is the example code: https://docs.unity3d.com/Manual/class-Texture3D.html. and to save it you can use AssetDatabase.CreateAsset()
found from this thread. Here is another interesting tool to help visualize the 3d texture. https://github.com/raphael-ernaelsten/Texture3DPreview-for-Unity
Here is my full code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Gen3 : MonoBehaviour
{
Texture3D texture;
void Start()
{
texture = CreateTexture3D(256);
UnityEditor.AssetDatabase.CreateAsset(texture, "Assets/test/t3d.asset");
Debug.Log(UnityEditor.AssetDatabase.GetAssetPath(texture));
}
Texture3D CreateTexture3D(int size) {
Color[] colorArray = new Color[size * size * size];
texture = new Texture3D(size, size, size, TextureFormat.RGB24, true);
float r = 1 / (size - 1);
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++)
{
for (int k = 0; k < size; k++)
{
colorArray[i + (j * size) + (k * size * size)] = new Color(i * r, j * r, k * r, 1);
}
}
}
texture.SetPixels(colorArray);
texture.Apply();
return texture;
}
}
Answer by anasainea · Sep 10, 2019 at 11:21 AM
I made a Vector Field Maker plugin for Unity which has a Free version, check it out here
You can add arrows and drag them and duplicate them to create the effect needed here is a tutorial
you can use free version of Houdini and is much easier with far better results! here is link to my tutorial https://youtu.be/VLXYCXRUE5k
Answer by NarxGaming · Jan 21, 2020 at 10:02 AM
TOTALLY FREE AND AWESOME WAY TO MAKE YOUR OWN SDF/VF/POINT CACHES this is a link to my tutorial on how to make your own .vf files for use with unitys vfx graph - conform t signed distance field etc
this use vfx toolbox for unity from github and free version of Houdini .. all links in video description
Hey, The link seems to be unavailable. Could you post the correct one pls...