콘텐츠로 건너뛰기

# 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

summary.

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).

Water Mesh

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.

https://zh.wikipedia.org/wiki/%E9%87%8F%E5%8C%96_(%E4%BF%A1%E5%8F%B7%E5%A4%84%E7%90%86)

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.

태그: