URP BoatAttack URP Research Report – Part3-Quantization(量化)Process

URP BoatAttack URP Research Report – Part3-Quantization(量化)Process

Origianl Resources from Unity3D with Unity Korea.

Documents Organizing by JP.Leeleegoonz@163.com


We analyze the features used for the rendering of the sea surface.The Unity version uses 2019.3.7.The sea implementation system has four major parts.

  1. A sea mesh that is quantized for moves along the camera.
  2. Sea mesh with different precision depending on distance.
  3. Implementation and concept of the Gerstner Wave.
  4. Be careful points when integrating Packages into other projects.

Let’s look at the moving GIF first.

You look closely, you can see that the Water Mesh keeps following the camera.

Look at the moving gif above, you can see that the Water Mesh following the camera is not always following the camera.

The Water Mesh structure is stored in the Boat Attack Water System / Scripts / Data folder.

The water mesh is pre-made in the DCC tool and is separated in this form.
This is a basic approach to rendering only the visible mesh using Camera Frustum culling.
In addition, the divided water mesh has the highest vertex density in the central part.
This is because the central part of the water mesh is rendered at the center of the camera screen (the center view of the player).

Let’s look at the code of how the Water Mesh follows the camera.

It is implemented in the BeginCameraRendering () function of Water.cs.

The water mesh is not followed by the origin of the camera, but a new position value is generated at the position of 10 positions in the forward direction from the camera origin.

Create a new position and assign the yOffset value of the Water mesh to the y value of the value, and applied it so that the Water Mesh can follow the camera from side to side when the camera moves left and right on the X and Z axes.
The peculiar part is not always followed, but the quantizeValue is used. Quantize Value in Chinese is quantitative.
Let’s take a look at the wiki to see what 量化 价值 is.


Let’s understand it more easily.
In the end, quantization is to create countless intervals of countless analog information that is infinite and use only meaningful information.

This would also be useful for sampling, but anyway, when we do quantization, we need to set an appropriate quantization value.

Finally, the value of the follow camera treatment of the water mesh was stored in the matrix variable, and then applied to all water mesh blocks with foreach.

If you look at the water mesh that follows the camera using the quantization value, there is no visual problem on the near side, but if you look closely at the far side from the center, you can see that a slight pop ping show up when the camera moves.
However, it is not a problem when developing a game because the user knows this in advance and can’t test it. When developing a mobile game, consider the Plausible effect as the core.

댓글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

%s에 연결하는 중