Crave For Games


The text below is one of the notes from the StoneDrop development log. If you want a list of only technical articles you can go to the Articles page.
Progress

Just finished working on the reflections in my water:


Video 1

Firstly I've tried to implement them through ReflectionProbe using RenderProbe() each frame but have encountered some problems:

1. it's heavily impact the performance (especially on mobiles),

2. real-time ReflectionProbe updates have a bug in WebGL and iOS platforms (issuetracker.unity...[1]) and the bugfix will be only in the 5.4 version of Unity.

 

After the previous attempt I've looked at a standard water implementation in WaterPro prefab from the Standard Unity Assets. Eventually I've made the reflections with a similar technique:

1. render the scene by another camera that situated symmetrical to the main one relative to the water surface,

2. use the result RenderTexture as a texture to lookup (the texture coordinates are computed from the fragment screen-space position and the distortions from the normal vector deviations).

The resulting reflections are not physically correct (the distortions are not depend on the distance from the water) but look plausible.

UPD June 2016: there is a video explanation with more details video 2


Video 2

The alpha build on the web-site was updated, so you can check out the result at craveforgames.com/...[2]. Wave generation enables when you click on any cell to make a turn and without releasing the mouse button move it to another location above the water.

 

Link 1: https://issuetracker.unity3d.com/issues/realtimereflectionprobes-realtime-reflections-dont-work-on-some-platforms

Link 2: http://www.craveforgames.com/en/stonedrop.html

This article in social networks: