Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  URP Fluid renderring in FluidMixing scene
#1
Hi! Have a question. I have tried to apply urp fluid shader to simple fluid example and it worked. Made the same with mixing fluids scene from default examples - see nothing. Particles shader work without problems. So here're two questions - what I did wrong and how to mix two transparent white fluids to have opaque white as the result of mixing? Thank you!
Reply
#2
(25-11-2022, 09:07 AM)kebab_traume Wrote: Hi! Have a question. I have tried to apply urp fluid shader to simple fluid example and it worked. Made the same with mixing fluids scene from default examples - see nothing. Particles shader work without problems. So here're two questions - what I did wrong

There's no such thing as a "URP fluid shader" that you can assign to fluids. The only similar shader there is is used internally and won't work when manually assigned to a regular renderer.

You set up fluid rendering in URP by adding a fluid renderer feature to your pipeline's asset, as explained in the manual:
http://obi.virtualmethodstudio.com/manua...ering.html

and this video:
https://www.youtube.com/watch?v=k5Uv5ecjVM0


(25-11-2022, 09:07 AM)kebab_traume Wrote: how to mix two transparent white fluids to have opaque white as the result of mixing?

You can't mix opaque and transparent materials per particle, since transparency is a property of the renderer, not each individual particle.

kind regards,
Reply
#3
[attachment=1575 Wrote:josemendez pid='13503' dateline='1669366111']
There's no such thing as a "URP fluid shader" that you can assign to fluids. The only similar shader there is is used internally and won't work when manually assigned to a regular renderer.

You set up fluid rendering in URP by adding a fluid renderer feature to your pipeline's asset, as explained in the manual:
http://obi.virtualmethodstudio.com/manua...ering.html

and this video:
https://www.youtube.com/watch?v=k5Uv5ecjVM0



You can't mix opaque and transparent materials per particle, since transparency is a property of the renderer, not each individual particle.

kind regards,
hey if there's no such thing as urp fluid shader, so why that thing called FluidShaderURP?


Attached Files Thumbnail(s)
   
Reply
#4
(25-11-2022, 02:24 PM)kebab_traume Wrote: hey if there's no such thing as urp fluid shader, so why that thing called FluidShaderURP?

Hi!

Quoting myself:
Quote:There's no such thing as a "URP fluid shader" that you can assign to fluids. The only similar shader there is is used internally and won't work when manually assigned to a regular renderer.

The reason why it exists is because it is used internally. Not all shaders you'll find can be assigned to a material for rendering an object: some shaders are post-process effects, screen-space rendering methods (which is the case of this particular shader), etc.
Reply
#5
(25-11-2022, 02:28 PM)josemendez Wrote: Hi!

Quoting myself:

The reason why it exists is because it is used internally. Not all shaders you'll find can be assigned to a material for rendering an object: some shaders are post-process effects, screen-space rendering methods (which is the case of this particular shader), etc.
Thank you Jose! If you don't mentioned - I'm won't make a new thread to ask one more thing. I need to have chemistry tubes with a liquid inside - what should I do to achieve that? To put emitter inside a collider (in a tube)? Am I right?
Reply
#6
(25-11-2022, 04:44 PM)kebab_traume Wrote: Thank you Jose! If you don't mentioned - I'm won't make a new thread to ask one more thing. I need to have chemistry tubes with a liquid inside - what should I do to achieve that? To put emitter inside a collider (in a tube)? Am I right?

You're welcome Sonrisa

Depends on whether you want fluid to start out filling the tube, or if you want to progressively pour it inside. If it's the former, use a voxel mesh emitter and "burst" emission mode. You have an example of this in the included Whiskey Bottle sample scene.

If it's the latter, any mesh emitter shape will do, and you can use "stream" emission mode for fluid to be poured in a faucet-like fashion. See:
http://obi.virtualmethodstudio.com/manua...tters.html

kind regards,
Reply
#7
(25-11-2022, 04:56 PM)josemendez Wrote: You're welcome Sonrisa

Depends on whether you want fluid to start out filling the tube, or if you want to progressively pour it inside. If it's the former, use a voxel mesh emitter and "burst" emission mode. You have an example of this in the included Whiskey Bottle sample scene.

If it's the latter, any mesh emitter shape will do, and you can use "stream" emission mode for fluid to be poured in a faucet-like fashion. See:
http://obi.virtualmethodstudio.com/manua...tters.html

kind regards,
Thank you man, it worked with a volume. But now I have a few more questions. First: is there a way to prevent particles go out of the limits of collider? Does thickness of the walls affect behaviour? Second: why do particles on an image behave like that? Need to change particle size/scale? on initialization they fill the tube and after that splash and make the line. Thank you for your help, appreciated
       
Reply
#8
(26-11-2022, 03:12 PM)kebab_traume Wrote: Second: why do particles on an image behave like that?

Hi!

Difficult to tell, since I have no idea what your settings are or how your setup looks like. What are your solver settings/fluid blueprint settings and how have you set up your collider?

(26-11-2022, 03:12 PM)kebab_traume Wrote: is there a way to prevent particles go out of the limits of collider?

Particles won't go out of the limits of a collider by default, that's what colliders do. Unless your collider is moving rapidly (relative to its size), in which case there's several solutions depending on what your use case is.

(26-11-2022, 03:12 PM)kebab_traume Wrote: on initialization they fill the tube and after that splash and make the line.

If they make a single vertical column, that means they're too large for the space they have inside the collider. Decreasing solver scale should fix that.


kind regards,
Reply
#9
(25-11-2022, 04:56 PM)josemendez Wrote: You're welcome Sonrisa

Depends on whether you want fluid to start out filling the tube, or if you want to progressively pour it inside. If it's the former, use a voxel mesh emitter and "burst" emission mode. You have an example of this in the included Whiskey Bottle sample scene.

If it's the latter, any mesh emitter shape will do, and you can use "stream" emission mode for fluid to be poured in a faucet-like fashion. See:
http://obi.virtualmethodstudio.com/manua...tters.html

kind regards,
Hi Jose! Hope you still not tired of stupid questions. I almost got what I need, but few things I couldn't understood. How to use different settings of obi fluid renderer in one scene? If I need src alpha as a blend source on one emitter and src color on another? What about general parameters here? Now only they affect my particles. 
I wanted to achieve clear transparent fluid and only way I got it - by using color as a blending src.        
Reply
#10
(28-11-2022, 12:43 PM)kebab_traume Wrote: Hi Jose! Hope you still not tired of stupid questions. I almost got what I need, but few things I couldn't understood. How to use different settings of obi fluid renderer in one scene? If I need src alpha as a blend source on one emitter and src color on another? What about general parameters here? Now only they affect my particles. 
I wanted to achieve clear transparent fluid and only way I got it - by using color as a blending src.

Hi!

You can’t have fluids with different material rendering settings in the same scene in URP (see my reply to the other thread).

Clear/transparent fluid can be achieved by setting the emitter’s color to pure white. No need to change any setting in the renderer. Fluids use multiplicative blending by default, so white x background color = background color.

Using src color for source blending would result in the blending equation src color*scr color + dest color * whatever the dest blend is set to.
Reply