06-11-2019, 10:49 AM
(This post was last modified: 06-11-2019, 10:51 AM by josemendez.)
(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.