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