Crave For Games


You are in the Article list. If you want a full list of the StoneDrop develompent log notes you can go to the DevLog page.
Interactive water surface shader (Unity3d)

This time I've tried to explain WaterSystem in a video.

video 1


Video 1

Some usefull links:

en.wikipedia.org/w...[1]

docs.unity3d.com/S...[2]

http.developer.nvi...[3]

forum.unity3d.com/...[4]

 

If you know any way to improve the system - please leave a comment!

 

UPD June 2016: based on a benchmark on mobile devices, the system works pretty well on the mid/top devices. For old Android smartphones the fallback with no tex2Dlod in vertex shader was created.

 

UPD May 2017: reflections rendering implementation is rather slow for real-time applications (here it's not noticeable because of small scene size, but in general it would be). First of all, Shader.globalMaximumLOD heavily uses FindObjectOfType under the hood (which you can behold in the profiler) and therefore introduces a large penalty on CPU usage. Another flaw is using GPU rendering results (reflected scene) in the same frame the rendering was initiated - in such case CPU just stalling during the whole GPU pipeline for reflected scene. The better approach for reflections should be using rendered reflections from a previous frame and some reprojection techniques during reflection texture sampling.

 

Link 1: https://en.wikipedia.org/wiki/Fresnel_equations

Link 2: http://docs.unity3d.com/ScriptReference/Graphics.Blit.html

Link 3: http://http.developer.nvidia.com/Cg/tex2Dlod.html

Link 4: http://forum.unity3d.com/threads/reflection-probes-in-custom-shader.322562/

This article in social networks: