Sword English to accompany you to play graphics (v) focus (draft)

Source: Internet
Author: User

Introduce a small effect today

Novice boot, we will need a full screen black out, only one area lit effect

Don't say much nonsense, look at the effect first

Http://lightszero.github.io/focuswin/focuswin.html

?

First, let's set up a basic test environment.

Establishment of two quad

Configure the camera like this

Configure the quad as such.

Configure the quadover as such.

This time quad is in the center of the screen, and the screen looks as high

That's what it looks like.

Make such a PNG image

I'll get a background picture.

Then give the background map a unlit material, give quad

Give Quadover a unlit transparent material, give quadover

That's what it looks like.

Let's add a script to quad to keep it full-screen at all times.

Second, let the hollow area move up

Let the hollow area move, so it is possible, this is the multiplication and addition of UV.

If you write a shader,tiling and offset, it should look like this.

You can get an effect like this

Smart you will find the problem, why so much.

Here to mention texture's filtermode, let's revise

This place unity is wrong again, this clamp is actually border, that is, when the UV is out of the 0~1 range, take the edge color of the map.

To adjust.

You get the

Such an effect

Three, drive the skeleton position and size

And then we're going to do a conversion, and calculate the corresponding tiling and offset according to the area we want.

Add the following script to Quadover

You can drag the cutout area with your mouse.

Use the mouse wheel to change the size of the cutout area

Sword English to accompany you to play graphics (v) focus (draft)

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.