The realization of Unity3d simulation view Cone

Source: Internet
Author: User

A standalone game Teleglitch uses a deceptive technique to simulate a cone of view, with the following effects:

The blogger looked at the tips

Actually, the line of sight shadows aren ' t do with perspective. They is just black polygons extruded from the walls away from the player. The math is similar to black 3d walls extruding towards the camera and if you really look at them, they aren ' t.

The principle and cartoon rendering extrude Edge is the same,

is to create a feeling of shadow by extruding a certain distance out of sight (player).

Bo Master did not adjust the distance before the implementation effect:


About the distance of the adjustment method, can not only adjust the distance of the extrusion, so that the shadow will be out of the object, Bo master according to the direction of sight to the object and the normal angle comparison, that is, dot product, to linearly change the distance, far away stretching long, near the basic motionless,

Final effect:



Also note that the comparison in the direction is the comparison of world space, which needs to change the vertex position of the object into the position of world space.

Blogger's recent renderings:

Recent renderings

----by wolf96

The realization of Unity3d simulation view Cone

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.