Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use textures for fluids?
#1
Hello,

Before I go any further I must congratulate You for making this piece of software. It is mostly impressive.

I have a question regarding usage of textures to make particles look good/cool. In stock particle materials there is a Shader property that allows to set a texture map.
Thing is that no matter what texture or map I put there nothing seems to happen with how the fluid looks Huh

Another thing is that I tried to swap stock shader in one of stock materials for another (Standard Unity Shader). It made game camera black. Thesame or something very similiar happen with every shader other than ones provided in OBI package.

What I'm doing wrong here ?


ps. I'm trying to achieve a soap foam like effect.
Reply
#2
(31-08-2018, 04:34 PM)Rad226 Wrote: Hello,

Before I go any further I must congratulate You for making this piece of software. It is mostly impressive.

I have a question regarding usage of textures to make particles look good/cool. In stock particle materials there is a Shader property that allows to set a texture map.
Thing is that no matter what texture or map I put there nothing seems to happen with how the fluid looks Huh

Another thing is that I tried to swap stock shader in one of stock materials for another (Standard Unity Shader). It made game camera black. Thesame or something very similiar happen with every shader other than ones provided in OBI package.

What I'm doing wrong here ?


ps. I'm trying to achieve a soap foam like effect.

Hi there,

Note that despite their name, not all shaders are meant to shade a surface, like the Standard Shader does. Shaders can be used for post processing effects, texture processing, physics, mesh manipulation, etc.

Obi uses screen-space ellipsoid splatting for fluid rendering. This is completely different from conventional triangle mesh rendering, the shaders it requires have little in common with "regular" shaders -meant to calculate lighting for a surface-. So if you swap the provided shaders (which are used by the fluid rendering pipeline) with a shader that's not conceived for the task, it will not work, as the pipeline expects to be able to use the shaders in a very specific way.

The manual contains a simplified description of the rendering pipeline:
http://obi.virtualmethodstudio.com/tutor...ering.html

Note that you can write your own shaders for the fluid pipeline, or even write an entirely custom pipeline (fluid renderer + shaders):
http://obi.virtualmethodstudio.com/tutor...ering.html

Fluid particles are blended together by the rendering pipeline to define a screen space surface, which is then lit in a deferred-like way. You cannot just provide a custom texture for each particle, as they need to splat an ellipsoidal surface patch during rendering, and nothing else. If you want to add detail to the surface of the fluid, or drive a regular particle system using the fluid simulation, you can use particle advection. This is what the FluidFoam sample scene uses to achieve its foam effect:

http://obi.virtualmethodstudio.com/tutor...ction.html
Reply
#3
(31-08-2018, 07:39 PM)josemendez Wrote: Hi there,

Note that despite their name, not all shaders are meant to shade a surface, like the Standard Shader does. Shaders can be used for post processing effects, texture processing, physics, mesh manipulation, etc.

Obi uses screen-space ellipsoid splatting for fluid rendering. This is completely different from conventional triangle mesh rendering, the shaders it requires have little in common with "regular" shaders -meant to calculate lighting for a surface-. So if you swap the provided shaders (which are used by the fluid rendering pipeline) with a shader that's not conceived for the task, it will not work, as the pipeline expects to be able to use the shaders in a very specific way.

The manual contains a simplified description of the rendering pipeline:
http://obi.virtualmethodstudio.com/tutor...ering.html

Note that you can write your own shaders for the fluid pipeline, or even write an entirely custom pipeline (fluid renderer + shaders):
http://obi.virtualmethodstudio.com/tutor...ering.html

Fluid particles are blended together by the rendering pipeline to define a screen space surface, which is then lit in a deferred-like way. You cannot just provide a custom texture for each particle, as they need to splat an ellipsoidal surface patch during rendering, and nothing else. If you want to add detail to the surface of the fluid, or drive a regular particle system using the fluid simulation, you can use particle advection. This is what the FluidFoam sample scene uses to achieve its foam effect:

http://obi.virtualmethodstudio.com/tutor...ction.html

Thank You for detailed information Sonrisa

If I may suggest something that may help spread this awesome asset. I heard voices that OBI assets have steap learning curve when it comes to scripting.
Consider making few tutorial videos or documents describing some real life, usefull examples of OBI fluid/rope/cloth code API usage, maybe even case-study examples.
This way You can show true potential of thiss asset presented not only in pre-defined example scenes.
"OBI coding" or something.
Reply