<p>You can be both realistical and real-time. the secret is to change representation each time the information get under the Shannon-Nyquist (i.e. grid) scale: from geometry to normal maps to shading models. This paper is made for you: <a href="http://maverick.inria.fr/Publications/2010/BNH10/index.php">http://maverick.inria.fr/Publications/2010/BNH10/index.php</a> (see also Yoube videos)</p>

CC BY-SA 3.0
2015-11-06T15:49:43.377Z
2015-11-06T15:49:43.377Z
Fabrice NEYRET
<p>Some software like Maya, solve this by using a polar (or actually cartesian that turns polar at a distance) much in the same way as you grid centered on the camera position. This setup adds more detail where it counts most Then they rely on the shaders normal processing at further ranges. There is room for improvemenet offcourse. You cold modify this approach a bit, and have any other shape that increases the mesh density towards the camera. The benefit of this is you can stretch the  effect up to the horizon without worrying about the seam. </p>

<p>The trick to not get the displacenent jumbled up in this case is that you gradually reduce the displacement as you move further away. You then just use normal modification in the pixel shader as you get further. This is easier to filter than having to filter an accurate shiluette edge. Also if you can see that far away then your vawes are likely sufficiently flat anyway.</p>

CC BY-SA 3.0
2015-11-04T05:25:47.107Z
2015-11-04T21:52:47.867Z
2015-11-04T21:52:47.867Z
joojaa
<p>The technic what Benedikt mentioned
is explained in Section 2.4.1 of this thesis.</p>

<p><a href="http://fileadmin.cs.lth.se/graphics/theses/projects/projgrid/projgrid-lq.pdf" rel="nofollow noreferrer">http://fileadmin.cs.lth.se/graphics/theses/projects/projgrid/projgrid-lq.pdf</a></p>

<p>Implementing this should solve your problem.</p>

CC BY-SA 3.0
2017-02-10T15:40:13.627Z
2017-02-25T13:49:26.930Z
2017-02-25T13:49:26.930Z
TheXappy
<p>I believe a common solution is to split the camera transform used to project the grid from the camera transform that is used to render the grid. At perspectives close to top-down, the two cameras coincide, but as the viewing camera gets close to a horizontal perspective, the projection camera deviates and tries to keep a minimum inclination, i.e. it hovers somewhere above the view camera and looks down slightly.</p>

<p>The tricky bit is making sure that the field of view of the projection camera always covers the region of the scene seen from the render camera. I don't have a resource at hand that details how to compute the appropriate transforms, and it might be tedious to derive by hand.</p>

<p>A different solution is to grab the signal processing toolbox: The artifacts seen in your image are essentially aliasing, caused by insufficient sampling of the wave heightfield by the projected grid. Therefore, one solution is to filter the heightfield appropriately, depending on the projected area of a grid cell. I believe this is used in offline rendering of oceans, and it essentially makes sure that waves at the horizon go flat. However, I'm not sure how feasible this is in real-time rendering, since you would need high-quality anisotropic filtering to make this approach look reasonable.</p>

CC BY-SA 3.0
2015-11-05T18:52:22.637Z
Thanks for the advice, I chose the lazy solution for now. I use a function in the vertex shader that determines the wave attenuation from the distance from tha camera.
Gábor Szalóki
CC BY-SA 3.0
2015-11-04T02:55:53.690Z
2015-11-04T02:55:53.690Z
Benedikt Bitterli
<p>I'm trying to implement an ocean scene with C++ and DirectX11. Currently I have a projected grid, Gerstner waves and a basic shading. My problem is that when I aim my camera horizontally, so I can see the water horizon, in the distance, the projected grid becomes insufficient, even at high vertex numbers. These screenshots illustrate the problem:</p>

<p><a href="https://i.sstatic.net/F1Nqx.jpg"><img src="https://i.sstatic.net/F1Nqx.jpg" alt="shaded water surface"></a></p>

<p><a href="https://i.sstatic.net/1qsKc.jpg"><img src="https://i.sstatic.net/1qsKc.jpg" alt="wireframe water surface"></a></p>

<p>I know the cause of the problem is in the concept of the projected grid (the grid is detailed near the camera, rough far from it), but there has to be a best practice to solve this.</p>

<p>Any ideas?</p>

<real-time><geometry><c++><directx11><grid>
Projected grid water horizon detail
Gábor Szalóki
# Projected grid water horizon detail

(Asked by: username_0 on 2015-11-03)

I'm trying to implement an ocean scene with C++ and DirectX11. Currently I have a projected grid, Gerstner waves and a basic shading. My problem is that when I aim my camera horizontally, so I can see the water horizon, in the distance, the projected grid becomes insufficient, even at high vertex numbers. These screenshots illustrate the problem:

[![shaded water surface](https://i.sstatic.net/F1Nqx.jpg)](https://i.sstatic.net/F1Nqx.jpg)

[![wireframe water surface](https://i.sstatic.net/1qsKc.jpg)](https://i.sstatic.net/1qsKc.jpg)

I know the cause of the problem is in the concept of the projected grid (the grid is detailed near the camera, rough far from it), but there has to be a best practice to solve this.

Any ideas?

**Tags:** real-time, geometry, c++, directx11, grid


---

## 4 answers

### Answer by username_4 on 2015-11-04. Score: 7 | Accepted answer

I believe a common solution is to split the camera transform used to project the grid from the camera transform that is used to render the grid. At perspectives close to top-down, the two cameras coincide, but as the viewing camera gets close to a horizontal perspective, the projection camera deviates and tries to keep a minimum inclination, i.e. it hovers somewhere above the view camera and looks down slightly.

The tricky bit is making sure that the field of view of the projection camera always covers the region of the scene seen from the render camera. I don't have a resource at hand that details how to compute the appropriate transforms, and it might be tedious to derive by hand.

A different solution is to grab the signal processing toolbox: The artifacts seen in your image are essentially aliasing, caused by insufficient sampling of the wave heightfield by the projected grid. Therefore, one solution is to filter the heightfield appropriately, depending on the projected area of a grid cell. I believe this is used in offline rendering of oceans, and it essentially makes sure that waves at the horizon go flat. However, I'm not sure how feasible this is in real-time rendering, since you would need high-quality anisotropic filtering to make this approach look reasonable.

> **Comments:**
> **username_0**: Thanks for the advice, I chose the lazy solution for now. I use a function in the vertex shader that determines the wave attenuation from the distance from tha camera.  

---

### Answer by username_1 on 2015-11-06. Score: 6

You can be both realistical and real-time. the secret is to change representation each time the information get under the Shannon-Nyquist (i.e. grid) scale: from geometry to normal maps to shading models. This paper is made for you: <http://maverick.inria.fr/Publications/2010/BNH10/index.php> (see also Yoube videos)


---

### Answer by username_2 on 2015-11-04. Score: 3

Some software like Maya, solve this by using a polar (or actually cartesian that turns polar at a distance) much in the same way as you grid centered on the camera position. This setup adds more detail where it counts most Then they rely on the shaders normal processing at further ranges. There is room for improvemenet offcourse. You cold modify this approach a bit, and have any other shape that increases the mesh density towards the camera. The benefit of this is you can stretch the effect up to the horizon without worrying about the seam.

The trick to not get the displacenent jumbled up in this case is that you gradually reduce the displacement as you move further away. You then just use normal modification in the pixel shader as you get further. This is easier to filter than having to filter an accurate shiluette edge. Also if you can see that far away then your vawes are likely sufficiently flat anyway.


---

### Answer by username_3 on 2017-02-10. Score: 2

The technic what username_4 mentioned
is explained in Section 2.4.1 of this thesis.

<http://fileadmin.cs.lth.se/graphics/theses/projects/projgrid/projgrid-lq.pdf>

Implementing this should solve your problem.


---

