0 like 0 dislike
93 views

Hi,

I just want to project a plexus FX on a mesh by projection. I have already followed this tutorial :

https://www.youtube.com/watch?v=vYom8JftGr0

Now I have my effect. I have another reference with the insect crawl simulation in file (https://www.youtube.com/watch?v=K5s7FM3CAic).

How can I do the effect of insects spawn with a sampler named StartPosition to project Plexus on my main mesh ?

I have this hierarchy in my particle tree :

Shape_1 is my head

StartPosition is the box shape to spawn the particles in function from the head surface (Shape_1)

Other references :

First Script :

function void    Eval()
{
    float3    p0 = Position;
}

Second Script :

function void    Eval()
{

    float3    p0 = Position;

    SizeCapsule *= SizeCapsuleCoeff;
    float3 Pos1 = spatialLayers.FirePlexus.Position.closest(Position, Radius, 1);
    
    
    Size *= SizeCoeff;
    float3 p1 = select ( Position , Pos1, Pos1 != infinity );
    
    DisplayPosition= (p1 +Position)/2;
    
    Velocity2 = Position - p1;
    
    float3 Pos2 = spatialLayers.FirePlexus.Position.closest(Position, Radius, 2);
    
    float3 p2 = select ( Position , Pos2, Pos2 != infinity );
    
    DisplayPosition= (p2 +Position)/2;
    
    Velocity2 = Position - p2;
    
    float intensity = 0.5;
    float fade = (1 - LifeRatio);
    
    float3 baseColor = sparkColor + intensity;
    float3 sparkColor = baseColor - intensity;
    
    Color = float4(baseColor ,1) * fade;
}

Third Script :

function void    Eval()
{
    Velocity2 = normalize(Velocity) * 0.5;
    
    float3    n = Shape_1.sampleNormal(PCoords);
    UpAxis = n;
    DisplayPosition = Position + n * 0.01;
}

I tried differents setups but it doesn't work for me. I just want to collapse these 2 exemples in the same particle FX. But something doesn't work with the fields of the billboards. I don't know how to solve that.

asked by Killian (220 points)

1 Answer

1 like 0 dislike

Hi,

we have a very similar effect that was showcased during GDC, we'll probably release it alongside another popcorn startup pack.

First of all, projecting points on an attribute sampler won't work outside of PopcornFX as it requires the 'Attributes at Evolve' feature which is to this date (v1.11) not implemented. This will come very soon by the way.

After that, only thing that really matters is placing the projection evolver before the plexus script(s) and that should be it, really.

The projected particles on the shape will be "MainPoints", and after that the tutorial logic stays the same:

In the tutorial particles have a velocity moving up while in your test particles will be projected each frame on the closest point on the shape. Linking particles will just query the particles based on the projected position.

You need:

  • A projection evolver
  • The tutorial's plexus script
  • Three billboard renderers setup like in the tutorial

That should be a good starting point,

Hope this helps.

answered by HugoPKFX (15.8k points)
Thank you.
...