Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Masking out fluids
#2
(04-10-2019, 08:35 PM)billmccrary Wrote: Maybe an odd question / request - we have some fluid clipping through some geometry due to a large-ish render scale (5), and we'd like to be able to put some 'masking' geometry over the top of it that will allow the camera to see everything BUT the fluid.  We don't have any shader specialists so wondering if that is something possible to do with obi fluids today or if that would be something someone knew how to do?  I have simple sandbox examples of basic geometry working by reusing someone's stencil buffer shaders, but I don't know how to implement that against the fluids.  Attached images of that simple sandbox stuff if it helps explain what I'm asking.  Thanks!

Hi there,

This is more of a general shader question that anything specific to Obi. Modifying "DielectricFluidShader.shader" (or whatever shader your fluid material is using) to read from the stencil buffer should be enough. See:
https://docs.unity3d.com/Manual/SL-Stencil.html
Reply


Messages In This Thread
Masking out fluids - by billmccrary - 04-10-2019, 08:35 PM
RE: Masking out fluids - by josemendez - 05-10-2019, 11:36 AM
RE: Masking out fluids - by billmccrary - 07-10-2019, 08:09 PM