[Blog recommendations] Unity3D mobile terminal real-time sea water Rendering

Source: Internet
Author: User

[Blog recommendations] Unity3D mobile terminal real-time sea water Rendering

This blog post is from the jxw167 blogger of BKJIA. If you have any questions, go to the blog homepage for an interactive discussion!

Blog: http://jxwgame.blog.51cto.com/943299/1597183

Real-time Simulation of sea water has always been a hot topic. The simulation of mobile-end sea water is hot. At present, there have been a lot of research in this area, but the results are not very satisfactory, here we will introduce an algorithm for real-time rendering on mobile terminals, which meets the running requirements of mobile terminals and can display highlights, reflections, and refraction effects on the sea surface, the rolling effect of the waves, the bubble effect on the sea, and the effect of the objects on the sea that are under and under the waves, truly simulate the formation of the waves.

The generation of waves at the mobile end is particularly limited. Here we use grid blocks to splice them to achieve infinite terrain. GPU rendering also needs to be able to run on the Mobile End. First, we will show it:

Reflection, refraction, and sea-level illumination are available, and the foam effect is achieved.

Next, we will analyze how it is implemented.

First, we need to customize the generation of grid blocks, and then splice them to generate a height chart, as shown in the grid.

The Code is as follows:

The following figure shows the rendering of the Sea highlight:

The Code is as follows:

Because the rendering of reflection and refraction involves the Shader programming, we implement the Code as follows:

The following shows how to roll and bubble the waves:

The implementation code is as follows:

The above code is implemented using the Fourier algorithm, and its direction is set through enumeration.

The rendering Shader is as follows:

The above shows the real-time simulation of the mobile terminal sea water, and finally shows the operation on the mobile phone:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.