Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  No specular highlights on mobile
#1
We recently bought Obi Fluid and are having a blast with it!
We are working on a mobile game and have tweaked the renderer and shaders for better performance.
However, we can't seem to get any specular highlight on mobile (A12 iPad for example).

Attached is one of your test scenes in both editor and device. That is the vanilla version with the built-in shaders and code. As you can see, there are no specular highlights. How can those be achieved on a mobile device?
Reply
#2
(06-11-2019, 10:25 AM)JyriKilpelainen Wrote: We recently bought Obi Fluid and are having a blast with it!
We are working on a mobile game and have tweaked the renderer and shaders for better performance.
However, we can't seem to get any specular highlight on mobile (A12 iPad for example).

Attached is one of your test scenes in both editor and device. That is the vanilla version with the built-in shaders and code. As you can see, there are no specular highlights. How can those be achieved on a mobile device?

Hi,

Glad you're enjoying it!

The default fluid renderer (which is not originally intended for mobile, as it is very performance intensive) uses sampler2D as the sampler type for all intermediate buffers. In mobile, this often translates to low-precision buffers. Since normals are extracted from depth, this lack of precision shows up as ladder-like artifacts in the surface of the fluid. Since the surface is not smooth, finer highlights do not appear (as they require a very smooth, continuous surface).

Switching depth and normal buffers to sampler2D_float in the fluid shaders (see https://docs.unity3d.com/Manual/SL-DataT...ision.html) will force the use of high-precision buffers in mobile devices, and allow finer highlights to appear.
Reply
#3
(06-11-2019, 10:49 AM)josemendez Wrote: Hi,

Glad you're enjoying it!

The default fluid renderer (which is not originally intended for mobile, as it is very performance intensive) uses sampler2D as the sampler type for all intermediate buffers. In mobile, this often translates to low-precision buffers. Since normals are extracted from depth, this lack of precision shows up as ladder-like artifacts in the surface of the fluid. Since the surface is not smooth, finer highlights do not appear (as they require a very smooth, continuous surface).

Switching depth and normal buffers to sampler2D_float in the fluid shaders (see https://docs.unity3d.com/Manual/SL-DataT...ision.html) will force the use of high-precision buffers in mobile devices, and allow finer highlights to appear.

Ok, I changed all sampler2D to sampler2D_float in both ObiFluids.cginc and DielectricFluidShader.shader. Specularity seems to work ok and looks pretty much identical to the editor view. Thank you!  Sonrisa
Reply