x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Metaballs Blobbing Effect (Fluid Sim)

Hi.

Does anyone know how I can tackle the issue of having meshes merge/fuse into one shape where the gaps are filled in by Geo.

Similar to how they achieve the oil in Portal 2.

alt text

Product Version: UE 4.13
Tags:
portal 2 oil.png (492.4 kB)
more ▼

asked Oct 25 '16 at 09:16 AM in Blueprint Scripting

avatar image

TheVikingProf
4 1 5 10

avatar image ergoproxy Oct 25 '16 at 09:18 AM

I'd like to know this too for a project :)

avatar image TheVikingProf Oct 25 '16 at 10:33 AM

I guess what I want is meta balls, but I would love to be able to use geo-particles.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

This is what I have done so far. I followed this video as closely as I can. link text

The custom hlsl code they use is

 ///////////MetaBalls Simple
 
 float3 CamVec = normalize(WorldPos-View.ViewOrigin);
 float3 curpos = WorldPos;
 float3 normal = 0;
 
 int maxsteps = 16;
 float curdist, accum = 0;
 float minstepsize = 0.01;
 
 int i = 0;
 while(i < maxsteps)
 {
     curdist = CustomExpression0(Parameters, curpos, k, Sphere1, Sphere2, Sphere3, t);
     
     if(curdist < tresh)
     {
         return float4(1,1,1,1);
     }
     curpos += CamVec * max(minstepsize, curdist);
     minstepsize += 0.02;
     i++;
 }
 
 return 0;


and

 //////// evaluate the distance
 
 float s1 = distance(Sphere1.xyz, curpos)-Sphere1.w;
 float s2 = distance(Sphere2.xyz, curpos)-Sphere2.w;
 float s3 = distance(Sphere3.xyz, curpos)-Sphere3.w;
 
 float dot1 = dot( normalize(curpos-Sphere1.xyz), float3(0.707,0.707,0) )-1;
 
 float dot2 = sin( dot1*2 + (t*2) ) * 1.5;
 dot2 += sin( dot1*24 + (t*8) ) * 0.07;
 s1 -= dot2;
 
 float h = saturate( 0.5+0.5*(s2-s1)/k );
 s2 = lerp( s2, s1, h ) - k*h*(1.0-h);
 
 h = saturate( 0.5+0.5*(s3-s2)/k );
 float curdf = lerp( s3, s2, h ) - k*h*(1.0-h);
 
 return curdf;


I have been trouble shooting for a couple of hours now and I can't seem to find any reason to why mine has error and the one they show of in the video works. This is my errors. alt text

compiler error.png (15.0 kB)
more ▼

answered Oct 25 '16 at 03:43 PM

avatar image

TheVikingProf
4 1 5 10

avatar image Shempii Feb 06 '17 at 05:45 PM

georgeng,

In the metaball hlsl, change View.ViewOrigin to View.WorldViewOrigin

I found that reading the youtube comments on the livestream but I believe in the stream they mention that the safest thing is to add an input to the function for calls like that because it's not uncommon for them to change the naming in the engine.

Hopefully you've solved it by now since you asked in October but if not, that's your answer :)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question