Issues to note for mobile mapping

Source: Internet
Author: User

For example, a watermark picture affixed to a quad, and then let Quad each vertex of the s texture coordinate with the time increment, so that the flow effect, that is, the s coordinate of each vertex is calculated according to the following formula:

S=s0+time*speed

Where S0 is the initial s-coordinate value.

However, the problem is that shader in the texture coordinate v_texcoord precision is very limited, usually mediump float, so as time increases, the value of s will become very large, will soon cause v_texcoord overflow, when rendering effect will become abnormal, Usually the flow effect is stuck and accompanied by a mosaic, so we want to wrap the texture coordinates to a smaller range of values by adding the integer multiples of 1, and then passing in the shader.

But here's one thing to keep in mind, when we do wrap, we're going to quad all the vertices together, not the vertices individually, for example, if we want to reduce the s-coordinate of a vertex by 1, we must also subtract 1 of the other vertices synchronously. For example, after a little time, the quad texture coordinates become as follows:

The s of all vertices are reduced by 1, which becomes:

Both show the same result.

However, if you wrap the vertices individually, the following results may occur:

Obviously, it's not right.

Issues to note for mobile mapping

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.