Glpolygonoffset solves two faces in total

Source: Internet
Author: User

Extracted from counter-fighting, you can use the polygon offset method to solve this problem. The method is as follows: drawsomething (); // draw another thing in the same position: gl_polygon_offset_fill ); // This is the one we need... glpolygonoffset (g_offsetfactor, g_offsetunit); drawotherthing (); glpolygonoffset (0.0f, 0.0f: when gl_polygon_offset is enabled, each fragment's depthvalue will be offset after it is interpolated from the depthvalues of the appropriate vertices. the value of the offsetis factor * DZ + R * units, where DZ is a measurement ofthe change in depth relative to the screen area of thepolygon, and r is the smallest value that is guaranteed toproduce a resolvable offset for a given implementation. theoffset is added before the depth test is already med andbefore the value is written into the depth buffer. glpolygonoffset is useful for rendering hidden-line images, for applying decals to surfaces, and for rendering solidswith highlighted edges. this function may be used later. It is used to draw shadows in tutorial04, but the shadows are still ugly.

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.