Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Using Single Particles shader as blobs!
#1
Hello! I own asset obi fluid, and I'm wondering is there any way to get few particles, for example, 3 particles and place them with your fluid shader, I just need some sort of blob/raymarching effect on 2 spheres, maybe you can give me some advice how to use that. I need to get this kind of effect


Attached Files Thumbnail(s)
   
Reply
#2
(10-05-2021, 10:26 AM)davidsedrakyan Wrote: Hello! I own asset obi fluid, and I'm wondering is there any way to get few particles, for example, 3 particles and place them with your fluid shader, I just need some sort of blob/raymarching effect on 2 spheres, maybe you can give me some advice how to use that. I need to get this kind of effect

Hi there,

You can just create a blueprint with capacity 3 (or any other low number). At runtime you can set their positions to whatever values you like using the particle API. See: http://obi.virtualmethodstudio.com/tutor...icles.html
Reply
#3
(10-05-2021, 10:35 AM)josemendez Wrote: Hi there,

You can just create a blueprint with capacity 3 (or any other low number). At runtime you can set their positions to whatever values you like using the particle API. See: http://obi.virtualmethodstudio.com/tutor...icles.html

Thanks a lot, and also one "advice", if you have time, you can make some kind of fake ray marching thing with your shader and techniques me and lots of guys like me will buy that asset, just for having that kind of effect out of the box!
Reply
#4
(10-05-2021, 10:49 AM)davidsedrakyan Wrote: Thanks a lot, and also one "advice", if you have time, you can make some kind of fake ray marching thing with your shader and techniques me and lots of guys like me will buy that asset, just for having that kind of effect out of the box!

What do you mean by "fake raymarching"? Isn't exactly that what the fluid renderer does already?

Ray marching works by generating a distance field of the fluids surface (or any other surface), then "marching" along a ray and calculating the distance to the closest point on the surface using its distance field. Once you hit the surface, you get its depth along the ray, surface normal, and any other info you need for rendering. This is done at least once per pixel.

Obi's fluid renderer generates the fluids surface by smoothing particles in screen space and generating a fullscreen normal+depth buffer, which is what the output of ray marching would look like. So this is quite literally "fake raymarching" since the results are similar to ray marching, but arrived at in a much cheaper and faster way since you don't need to have a distance field to begin with.
Reply
#5
(10-05-2021, 10:52 AM)josemendez Wrote: What do you mean by "fake raymarching"? Isn't exactly that what the fluid renderer does already?

Ray marching works by generating a distance field of the fluids surface (or any other surface), then "marching" along a ray and calculating the distance to the closest point on the surface using its distance field. Once you hit the surface, you get its depth along the ray, surface normal, and any other info you need for rendering. This is done at least once per pixel.

Obi's fluid renderer generates the fluids surface by smoothing particles in screen space and generating a fullscreen normal+depth buffer, which is what the output of ray marching would look like. So this is quite literally "fake raymarching" since the results are similar to ray marching, but arrived at in a much cheaper and faster way.

Yes, It does the same, I was saying just to have that kind of ray marching shader effect without fluid feature, just separated from the obi fluid asset!

For example, we can't move any particle from unity scene view, but it will be pretty handy to have that kind of feature, just to add shader for example on sphere and get that mixing-raymarching effect
Reply
#6
(10-05-2021, 11:07 AM)davidsedrakyan Wrote: Yes, It does the same, I was saying just to have that kind of ray marching shader effect without fluid feature, just separated from the obi fluid asset!

For example, we can't move any particle from unity scene view, but it will be pretty handy to have that kind of feature, just to add shader for example on sphere and get that mixing-raymarching effect

Oh I see! so you mean to separate the fluid renderer from the fluid simulation itself as a separate package right?

Could be done, I'll think about it Sonrisa
Reply
#7
(10-05-2021, 11:08 AM)josemendez Wrote: Oh I see! so you mean to separate the fluid renderer from the fluid simulation itself as a separate package right?

Could be done, I'll think about it Sonrisa

Yes! That would be perfect and lots of people will buy it!
Reply
#8
(10-05-2021, 10:35 AM)josemendez Wrote: Hi there,

You can just create a blueprint with capacity 3 (or any other low number). At runtime you can set their positions to whatever values you like using the particle API. See: http://obi.virtualmethodstudio.com/tutor...icles.html


hey, I'm trying to achieve this effect, but I generally need kind of 3D Object with collisions and rigidbodies to use as a single "blob" material, do you have any idea how I can achieve that? Would be perfect If I can use some fluid shader on unity basic sphere, or cube , but I understand that it's not possible, is there any workaround ?
Reply
#9
(25-07-2021, 08:24 PM)davidsedrakyan Wrote: hey, I'm trying to achieve this effect, but I generally need kind of 3D Object with collisions and rigidbodies to use as a single "blob" material, do you have any idea how I can achieve that? Would be perfect If I can use some fluid shader on unity basic sphere, or cube , but I understand that it's not possible, is there any workaround ?

Tried to adapt the fluid shader to arbitrary meshes in the past, but it's not possible.
The reason for this is that "thickness" as seen from the camera's pov is approximated by summing the individual thickness of each particle (which can be calculated using a closed-form formula, since they're ellipsoids). For an arbitrary mesh this wouldn't work. Something along the lines of rendering backfaces, front faces and then subtracting their depth would be required, and even then that would only work for convex shapes.

I don't think is possible to use the fluid shader (or a variant) on arbitrary meshes.
Reply