Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Procedural Art with Unity3D Particle Systems and Vector Fields

Discussion in 'Editor & General Support' started by MartaMartins1, Aug 18, 2023.

  1. MartaMartins1

    MartaMartins1

    Joined:
    Sep 30, 2016
    Posts:
    4
    Hi,
    Anyone here who has worked with Vector Fields, generative art in Unity with particles?
    https://shahriyarshahrabi.medium.co...rticle-systems-and-vector-fields-5a0b6d4cdc65
    In the past few days, I have been experimenting creating patterns using the particle system in Unity Engine
    I'm trying to do something similar like circle reference, but I'm having some difficulties to understand some parts.
    I can't found for example 'Vector Fields'.
    I don't know nothing about code If was needed.

    I have particles with flow, but doesn't stop, and the scene is not very clean like reference

    If anyone can help me. I appreciate
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    It is an interesting approach in that article.

    He sets the camera to "don't clear" because he wants to keep the particles making streaks.

    I know that simply won't work on some platforms.

    For instance if you try it on Android or iOS the graphics are going to almost certainly flash or have trash on them.

    Perhaps what he left out is that he is using a RenderTexture?

    I think when you use that you simply keep adding to the RenderTexture.

    I tried it real quick by putting a particle system on my stage in my scratcher demo. It does work.

    Here's my scratcher project (source is in comments):



    I changed the hierarchy by putting a particle system in it:

    Screen Shot 2023-08-17 at 10.07.09 PM.png

    And then it looks like:
    Screenshot-KurtGame-133368089519416750.png

    I haven't read how he did the vector field, perhaps he manipulated the particles themselves on a callback?
     
  3. MartaMartins1

    MartaMartins1

    Joined:
    Sep 30, 2016
    Posts:
    4
    What i really need help is with Vector fields, because i that's what i miss to finish the job
    My particles have a flow
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    What do you mean by this? What have you tried, what are you having problems with?

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, log output, variable values, and especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven't put effort into finding the documentation, why should we bother putting effort into replying?

    Generally a vector field is simply a function that accepts a vector and returns a vector.

    Code (csharp):
    1. Vector3 MyField(Vector3 position)
    2. {
    3.   return position * 123.0f;
    4. }
    He even provided a trivial one-line vector field for concentric circles.

    Code (csharp):
    1. Particle[i].position = new Vector3(Mathf.Cos(Time),Mathf.Sin(Time), someDisAwayFromCam) * (float) i;
     
  5. MartaMartins1

    MartaMartins1

    Joined:
    Sep 30, 2016
    Posts:
    4
    I have Unity 2022.3.7f1 and I'm trying make something similar, like an article.
    He use vector Fields, but i can't find in my Unity.
    And i don't know nothing about code, so if i need use a code, i cant make nothing
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    A vector field is just a generic mathematical term, which I described in my amateur way above.

    Here's more reading:

    https://en.wikipedia.org/wiki/Vector_field

    You would need to write one that did what you want.
     
  7. MartaMartins1

    MartaMartins1

    Joined:
    Sep 30, 2016
    Posts:
    4
    Thanks, but i really don't understand nothing about that. I'm Just a 3D Artist