Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fluid on black background
#1
Pregunta 
Hello!

I need the liquid to display on a dark background, but it feels like the liquid can reach maximum fury only on a white background
and other background colors absorb the color of the liquid

Is it so?
What should I do if I want a bright liquid on a black background?
Reply
#2
(04-06-2020, 12:01 PM)hromoyDron Wrote: Hello!

I need the liquid to display on a dark background, but it feels like the liquid can reach maximum fury only on a white background
and other background colors absorb the color of the liquid

Is it so?
What should I do if I want a bright liquid on a black background?

Hi there,

When light passes trough a transparent fluid, part of it is absorbed. So if you put any background color behind a fluid, the fluid can only darken it, it cannot possibly make it brighter. This is basically the reason why you can't see the bottom of the ocean. Sonrisa In Obi this is done using multiplicative color blending.

If you want a transparent fluid to "brighten" the background, then you must use additive blending. This is basic color theory. The DielectricFluid material has cloudiness controls that let you simulate suspended particles, which are added to the background color, instead of multiplied by it.

The alternative would be to use opaque fluids, of course. Depending on the exact effect you're after, you should go one way or the other.
Reply
#3
(04-06-2020, 12:16 PM)josemendez Wrote: Hi there,

When light passes trough a transparent fluid, part of it is absorbed. So if you put any background color behind a fluid, the fluid can only darken it, it cannot possibly make it brighter. This is basically the reason why you can't see the bottom of the ocean. Sonrisa In Obi this is done using multiplicative color blending.

If you want a transparent fluid to "brighten" the background, then you must use additive blending. This is basic color theory. The DielectricFluid material has cloudiness controls that let you simulate suspended particles, which are added to the background color, instead of multiplied by it.

The alternative would be to use opaque fluids, of course. Depending on the exact effect you're after, you should go one way or the other.

I need an opaque paint effect


Now I use ObiFluidRenderer 

1) 
with Color Material - FluidColorBlend/FluidColorOpaque (same results) all time fluid is transparent
with Fluid Material - SimpleFluid 

all result transparent

2)
with Color Material - FluidColorBlend/FluidColorOpaque (all time same results) 
with Fluid Material - DielectricFluid 

with cloudiness > 5 get good opaque result


But I need variant that is better for fps.
As I understand FluidColorOpaque + SimpleFluid is better.
How I can't make it real opaque?

* Fluid Material - Opaque Fluid not suits to my visual desing
Reply
#4
(04-06-2020, 01:30 PM)hromoyDron Wrote: I need an opaque paint effect


Now I use ObiFluidRenderer 

1) 
with Color Material - FluidColorBlend/FluidColorOpaque (same results) all time fluid is transparent
with Fluid Material - SimpleFluid 

all result transparent

2)
with Color Material - FluidColorBlend/FluidColorOpaque (all time same results) 
with Fluid Material - DielectricFluid 

with cloudiness > 5 get good opaque result


But I need variant that is better for fps.
As I understand FluidColorOpaque + SimpleFluid is better.
How I can't make it real opaque?

If you need an opaque paint effect, then just use the opaque materials as explained in the manual:
http://obi.virtualmethodstudio.com/tutor...ering.html

Color material - FluidColorOpaque
Fluid material - Opaque fluid

Quote:There are two different color materials/shaders included by default: FluidColorBlend and FluidColorOpaque:

FluidColorBlend uses multiplicative blending to accumulate the color of each particle.
FluidColorOpaque uses alpha blending to accumulate the color of each particle.

Also, there are two default materials/shaders to perform the final rendering step:

DielectricFluid uses reflection, refraction and transmission to render the fluid. Use this for transparent or semi-transparent fluids like water, honey or blood.
OpaqueFluid uses simple surface shading to render the fluid, similar to Unity's Standard shader. Use this for opaque fluids like ketchup or paint.
Reply
#5
(04-06-2020, 01:37 PM)josemendez Wrote: If you need an opaque paint effect, then just use the opaque materials as explained in the manual:
http://obi.virtualmethodstudio.com/tutor...ering.html

Color material - FluidColorOpaque
Fluid material - Opaque fluid

OpaqueFluid material is not suits to my visual style. 

Can I make SimpleFluid (Simple2DFluid shader) opaque?
Reply
#6
(04-06-2020, 01:52 PM)hromoyDron Wrote: OpaqueFluid material is not suits to my visual style. 

Then you'll have to modify/customize the shader yourself.

(04-06-2020, 01:52 PM)hromoyDron Wrote: Can I make SimpleFluid (Simple2DFluid shader) opaque?

Easiest way to make simple fluid shader opaque is to just return the fluid color, instead of multipliying it with the background. Change the last line of SimpleFluid.shader from this:
Code:
return output*_Color; // tint your fluid here.

to this:
Code:
return _Color;
This will result in opaque, flat fluid.
Reply
#7
josemendez, 
Thank you so much!
Reply