Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Distance Fields not working
#1
Hi Obi,

I just purchased Obi Fluid yesterday to make my game. But I experienced difficulty in implementing it, and currently I'm stuck in Distance Fields.
Referring to this thread, that has resolved my initial issues so far (the lag for using raw mesh collider), I am now able to create Distance Field for my fbx glass mesh.
However, when implementing it on sample scene FaucetAndBucket, it seems that the Distance Field doesn't work at all.
The water seems to just went through the mesh.

Pic:
[attachment=401]

Distance Field:
   

Mesh:
   

How do I resolve this?
Reply
#2
(16-09-2019, 05:37 AM)jaysama Wrote: Hi Obi,

I just purchased Obi Fluid yesterday to make my game. But I experienced difficulty in implementing it, and currently I'm stuck in Distance Fields.
Referring to this thread, that has resolved my initial issues so far (the lag for using raw mesh collider), I am now able to create Distance Field for my fbx glass mesh.
However, when implementing it on sample scene FaucetAndBucket, it seems that the Distance Field doesn't work at all.
The water seems to just went through the mesh.

Pic:


Distance Field:


Mesh:




How do I resolve this?

Your mesh, while having non-zero thickness, is extremely thin, so you will have to reduce max error and/or increase the scale of your mesh for the distance field to be able to pick up such small features. As you can see in the preview, the distance field does not have fine enough resolution to "see" there's an inside and an outside to your glass, and thinks it's all outside (black).
Reply
#3
(16-09-2019, 03:18 PM)josemendez Wrote: Your mesh, while having non-zero thickness, is extremely thin, so you will have to reduce max error and/or increase the scale of your mesh for the distance field to be able to pick up such small features. As you can see in the preview, the distance field does not have fine enough resolution to "see" there's an inside and an outside to your glass, and thinks it's all outside (black).

Thanks for your answer Jose.
I have resolved it by using .blend file instead of .fbx, I still don't know why it doesn't work using fbx.
Anyway, now everything is up and running, except that I see that the fluid doesn't completely fill the empty space within my glass.

Scene view (I enabled convex just for previewing the collider)
[attachment=404]

Game view
[attachment=405]

See that there is empty unfilled spaces at the bottom and on the left and right of the glass.
I have tried modifying the material fluid, regenerating distance fields using any parameters, changing the radius of the particles, but nothing could fill those empty spaces.
Is there any solution to this?
Reply
#4
(16-09-2019, 04:21 PM)jaysama Wrote: Thanks for your answer Jose.
I have resolved it by using .blend file instead of .fbx, I still don't know why it doesn't work using fbx.
Anyway, now everything is up and running, except that I see that the fluid doesn't completely fill the empty space within my glass.

Scene view (I enabled convex just for previewing the collider)


Game view


See that there is empty unfilled spaces at the bottom and on the left and right of the glass.
I have tried modifying the material fluid, regenerating distance fields using any parameters, changing the radius of the particles, but nothing could fill those empty spaces.
Is there any solution to this?

Hi,

Probably the scale at which the mesh was exported in .blend was larger than the one used by .fbx.

Particles are rendered as ellipsoids that follow the fluid's isosurface, but collision detection is performed using spheres (with the ellipsoid's larger radius) for performance reasons.

You can:
- tweak the collider's "thickness", using a negative value to let the particles go into the collider a bit
- slightly increase the ParticleRenderer's "radius scale" a bit so that particles are drawn larger than they are.
- Increase the fluid's resolution (so that particles are smaller, the gap will reduce).

All three can be used at the same time. #1 and #2 do not affect performance in any way, #3 incurs some cost (as more particles will be used for the same volume of fluid).

Some reading:
http://obi.virtualmethodstudio.com/tutor...sions.html
http://obi.virtualmethodstudio.com/tutor...ering.html
http://obi.virtualmethodstudio.com/tutor...ering.html
http://obi.virtualmethodstudio.com/tutor...rials.html
Reply