Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transparent fluid when using Meta quest passthrough
#11
(09-11-2023, 12:51 PM)413866 Wrote: Which makes it very weird to me is that we have transparent beakers which work perfectly but only the liquids have a problem.

Because beakers (and most "regular" transparent objects) don't use refraction, just simple alpha blending. If you wanted to use something like an actual crystal shader on the beakers, you'd have the same issue.

Alpha blending just blends the object on top of the screen contents, no need to get them into a texture first. However this doesn't account for the object's thickness or surface direction, so what you see is just a tinted version of the background. Here's fluid with refraction stripped off, just alpha blending (modified the included fluid shader for this, since alpha blending isn't supported out of the box due to its poor result for fluids):

[Image: SRMZC1Z.png]

Refraction distorts what's behind the object, which requires to get whatever is behind the refractive object into a texture. You can't do refraction any other way (except raytracing, which is very costly). However refraction accounts for the object's thickness, which enables absorption (making thicker regions of the object less transparent, giving an important visual cue of the volume occupied by the fluid) and distortion (altering the view of what's behind, based on surface thickness and orientation which gives your eye information about the orientation of the fluid's surface). Here's the same fluid, with refraction enabled:

[Image: yNdbaRZ.png]

Note how you can immediately tell areas where the fluid is thicker, and clearly see its surface. For your reference, here's an in-depth technical explanation of how to make a simple plane look like liquid, instead of just a transparent layer: https://catlikecoding.com/unity/tutorial...ugh-water/
Reply


Messages In This Thread
RE: Transparent fluid when using Meta quest passthrough - by josemendez - 09-11-2023, 01:48 PM