Z-fighting

Demonstration of z-fighting with multiple colors and textures over a grey background

Z-fighting, also called stitching or planefighting, is a phenomenon in 3D rendering that occurs when two or more primitives have very similar distances to the camera. This would cause them to have near-similar or identical values in the z-buffer, which keeps track of depth. This then means that when a specific pixel is being rendered, it is ambiguous which one of the two primitives are drawn in that pixel because the z-buffer cannot distinguish precisely which one is farther from the other.[1] If one pixel was unambiguously closer, the less close one could be discarded. It is particularly prevalent with coplanar polygons, where two faces occupy essentially the same space, with neither in front. As a result, affected pixels are rendered with fragments from one polygon or the other arbitrarily, in a manner determined by the precision of the z-buffer. It can also vary as the scene or camera is changed, causing one polygon to "win" the z test, then another, and so on. The overall effect is flickering, noisy rasterization of two polygons which "fight" to color the screen pixels. This problem is usually caused by limited sub-pixel precision, floating point and fixed point round-off errors.

The more z-buffer precision one uses, the less likely it is that z-fighting will be encountered. But for coplanar polygons, the problem is inevitable unless corrective action is taken.

As the distance between near and far clip planes increases, and in particular the near plane is selected near the eye, the greater the likelihood exists that z-fighting between primitives will occur. With large virtual environments inevitably there is an inherent conflict between the need to resolve visibility in the distance and in the foreground, so for example in a space flight simulator, if a distant galaxy is drawn to scale, the viewer will not have the precision to resolve visibility on any cockpit geometry in the foreground (although even a numerical representation would present problems prior to z-buffered rendering). To mitigate these problems, z-buffer precision is weighted towards the near clip plane, but this is not the case with all visibility schemes and it is insufficient to eliminate all z-fighting issues.

Mitigation

The effect seen on two co-planar polygons.

Z-fighting can be reduced through the use of a higher resolution depth buffer, by z-buffering in some scenarios, or by simply moving the polygons further apart.[2] Z-fighting which cannot be entirely eliminated in this manner is often resolved by the use of a stencil buffer, or by applying a post-transformation screen space z-buffer offset to one polygon which does not affect the projected shape on screen but does affect the z-buffer value to eliminate the overlap during pixel interpolation and comparison. Where z-fighting is caused by different transformation paths in hardware for the same geometry (for example in a multi-pass rendering scheme) it can sometimes be resolved by requesting that the hardware use invariant vertex transformation.

Z-fighting that is caused by insufficient precision in the depth buffer can be resolved by simply reducing the visible distance in the world. This reduces the distance between the near and far planes and solves the precision issue. However, in certain virtual environments where long-distance visibility is essential or where reduced visibility would be unbelievable, such as a space simulator or a flight simulator, this is not possible. Alternative techniques exist in these cases. One of these techniques is to "simulate" the distance of objects far from the user without actually changing their position. For example, if the maximum safe view distance (beyond which z-fighting occurs) is 10,000 units, and an object to be rendered is 15,000 units away, that object could instead be rendered at 10,000 units but it could be scaled down in proportion to the distance that it was moved. So, an object that has been scaled down by half will look like it is twice as far as it actually is. If this is done only for objects that are already close to, or at, the maximum view distance, and objects close to the user are rendered normally, this technique should not be noticeable. Another technique that is utilized to reduce or completely eliminate Z-fighting is switching to a logarithmic Z-buffer, reversing Z. This technique is seen in the game Grand Theft Auto V. Due to the way they are encoded, floating-point numbers have much more precision when closer to 0. Here, reversing Z leads to more precision when storing the depth of very distant objects, hence greatly reducing Z-fighting.[3]

References

  1. ^ "LearnOpenGL - Depth testing". learnopengl.com. Retrieved 2021-07-01.
  2. ^ "Depth Buffer Precision - OpenGL Wiki". www.khronos.org. Retrieved 2021-06-30.
  3. ^ Courrèges, Adrian (2 November 2015). "GTA V - Graphics Study". AdrianCourreges.com. Retrieved 20 June 2018.

Read other articles:

American college football season 2009 Virginia Cavaliers footballConferenceAtlantic Coast ConferenceDivisionCoastalRecord3–9 (2–6 ACC)Head coachAl Groh (9th season)Offensive coordinatorGregg Brandon (1st season)Offensive schemeSpreadDefensive coordinatorAl Groh (1st season)Base defense3–4Home stadiumScott Stadium(Capacity: 61,500)UniformSeasons← 20082010 → 2009 Atlantic Coast Conference football standings vte Conf Overall Team   W...

 

Sex and the CityPembuatDarren StarPemeranSarah Jessica Parker Kristin Davis Cynthia Nixon Kim CattrallNegara asal Amerika SerikatJmlh. musim6Jmlh. episode94 (daftar episode)ProduksiProduser eksekutifMichael Patrick KingDarren StarSarah Jessica ParkerLokasi produksiNew York City, New YorkPengaturan kameraSingle camerasexDurasi29 menitRilisJaringan asliHBOFormat gambar480i SDTVFormat audioStereoRilis asli6 Juni 1998 –22 Februari 2004Pranala luarSitus web Sex and the City merupakan s...

 

Heidi Fleiss Heidi Lynne FleissInformación personalOtros nombres La Madam de HollywoodNacimiento 30 de diciembre de 1965Los Feliz, California,  Estados UnidosResidencia Pahrump Nacionalidad EstadounidenseLengua materna Inglés FamiliaPadre Paul M. Fleiss Pareja Dennis Hof (desde 2009) EducaciónEducada en John Marshall High School Información profesionalOcupación Actriz, prostituta, empresaria, madam y personalidad televisiva Seudónimo La Madam de HollywoodSitio web www.hei...

ANOS1 Наявні структури PDBПошук ортологів: PDBe RCSB Список кодів PDB 1ZLG Ідентифікатори Символи ANOS1, ADMLX, HH1, HHA, KAL, KALIG-1, KMS, WFDC19, KAL1, anosmin 1 Зовнішні ІД OMIM: 300836 HomoloGene: 55445 GeneCards: ANOS1 Пов'язані генетичні захворювання hypogonadotropic hypogonadism 1 with or without anosmia[1] Онтологія гена Молекулярна функція • pe...

 

خطوط الأنابيب الروسية لنقل النفط خطوط الأنابيب الروسية لنقل الغاز أكبر الدول المنتجة للنفط(مليون برميل يوميا) إنتاج الغاز الطبيعي الروسي (الأحمر) والصادرات (الأسود). إنتاج النفط الخام الروسي (أحمر) وصادرات النفط الخام (أسود). صناعة البترول في روسيا هي واحدة من أكبر الصناعات ا

 

Daftar keuskupan di Slowakia adalah sebuah daftar yang memuat dan menjabarkan pembagian terhadap wilayah administratif Gereja Katolik Roma yang dipimpin oleh seorang uskup ataupun ordinaris di Slowakia. Para uskup di wilayah Slowakia bergabung dalam Konferensi Waligereja Slowakia. Saat ini terdapat 12 buah yurisdiksi, di mana 1 merupakan metropolit, 2 merupakan keuskupan agung metropolit, 1 merupakan keuskupan agung, 7 merupakan keuskupan sufragan, dan 1 merupakan ordinariat militer. Daftar k...

بطل الاتحاد السوفيتيمعلومات عامةنوع الجائزة highest honors of the USSR (en) — قدوة البلد الاتحاد السوفيتي أول جائزة 16 أبريل 1934 العدد الممنوح 12٬776[1] تعديل - تعديل مصدري - تعديل ويكي بيانات وسام بطل الاتحاد السوفيتي بطل الاتحاد السوفيتي (بالروسية: Герой Советского Союза؛ جيروي سايڨتسك

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (سبتمبر 2017) متنزة جمشيدية الوطني متنزه جمشيدية الوطني في طهران البلد  إيران الموقع طهران منطقة نياوران أنشئت من قبل الأمير كاجار ومهندس جامشيد دافالو قاجار تعديل مص...

 

American feminist philosopher and theologian (1928–2010) For other people named Mary Daly, see Mary Daly (disambiguation). Mary DalyDaly c. 1970Born(1928-10-16)October 16, 1928Schenectady, New York, USDiedJanuary 3, 2010(2010-01-03) (aged 81)Gardner, Massachusetts, USAcademic backgroundAlma materCollege of Saint RoseCatholic University of AmericaSaint Mary's CollegeUniversity of FribourgInfluences Virginia Woolf Matilda Joslyn Gage[1] Paul Tillich Martin Buber Simone de B...

Metro and railway station in Tokyo, Japan Toyosu Station豊洲駅Exit 7 of the Tokyo Metro station in September 2011, with the end of the elevated Yurikamome tracks just visibleGeneral informationLocationToyosu, Kōtō City, TokyoJapanOperated by Tokyo Metro Yurikamome, Inc. Line(s) Y Yūrakuchō Line U Yurikamome Connections Bus terminalConstructionStructure typeElevatedHistoryOpened8 June 1988; 35 years ago (8 June 1988)LocationToyosu StationLocation within Special wards of Tok...

 

Art associated with a repository for the remains of the dead Tomb of Philippe Pot with life-sized hooded pleurants, c. 1477–80, now in the Louvre, Paris Korean tomb mound of King Sejong the Great, d. 1450 Türbe of Roxelana (d. 1558), Süleymaniye Mosque, Istanbul Funerary art is any work of art forming, or placed in, a repository for the remains of the dead. The term encompasses a wide variety of forms, including cenotaphs (empty tombs), tomb-like monuments which do not contain human remai...

 

Upper house of the bicameral legislature of the state of Telangana in India For the lower house, see Telangana Legislative Assembly. Telangana Legislative Councilతెలంగాణ శాసన మండలిTelaṅgāṇa Sāsana MaṇḍaliTypeTypeUpper house of the Telangana Legislature Term limits6 yearsHistoryFounded2 June 2014(9 years ago) (2014-06-02)LeadershipGovernor of TelanganaTamilisai Soundararajan, BJP since 08 September 2019 Chairperson of the HouseTBD, IN...

Greek chess player Dimitrios Mastrovasilis(2021)CountryGreeceBorn (1983-06-12) 12 June 1983 (age 40)TitleGrandmaster (2003)FIDE rating2577 (December 2023)Peak rating2631 (January 2012) Dimitrios Mastrovasilis (Greek: Δημήτριος Μαστροβασίλης; born 12 June 1983) is a Greek chess grandmaster. He competed in the FIDE World Chess Championship in 2004 and the FIDE World Cup in 2017. Career Mastrovasilis took the silver medal in the under 18 division at the Europ...

 

2004 studio album by Velvet RevolverContrabandStudio album by Velvet RevolverReleasedJune 8, 2004RecordedJune–December 2003StudioNRG and Pulse RecordingGenreHard rockLength56:47LabelRCAProducer Josh Abraham Velvet Revolver Nick Raskulinecz Velvet Revolver chronology Contraband(2004) Libertad(2007) Singles from Contraband Set Me FreeReleased: June 17, 2003 SlitherReleased: May 24, 2004 Fall to PiecesReleased: September 13, 2004 Dirty Little ThingReleased: September 13, 2004 Contraban...

 

Class of enzymes pyruvate synthasepyruvate synthase dimer, Desulfovibrio africanusIdentifiersEC no.1.2.7.1CAS no.9082-51-3 DatabasesIntEnzIntEnz viewBRENDABRENDA entryExPASyNiceZyme viewKEGGKEGG entryMetaCycmetabolic pathwayPRIAMprofilePDB structuresRCSB PDB PDBe PDBsumGene OntologyAmiGO / QuickGOSearchPMCarticlesPubMedarticlesNCBIproteins In enzymology, a pyruvate synthase (EC 1.2.7.1) is an enzyme that catalyzes the interconversion of pyruvate and acetyl-CoA. It is also called pyruvate:ferr...

This article is about an administrative district in Sarawak, Malaysia. For the city, see Miri. For the administrative division, see Miri Division. PlaceMiri District Districts of SarawakDistrict Office locationMiriLocal area government(s)Miri City Council (SCC) Subis District Council (SDC)Area[1] • Total4,707 km2 (1,817 sq mi)Population (2010)[2] • Total290,274 • Density62/km2 (160/sq mi)District OfficerBoniface Inta...

 

1902 SAFA premiership season26th SAFA seasonNorth Adelaide, premiersTeams7PremiersNorth Adelaide 2nd premiershipMinor premiersPort Adelaide 2nd minor premiershipMagarey MedallistTom MacKenzie West TorrensLeading goalkickerJack Kay South Adelaide (28 Goals)Matches played45Highest(Grand Final, North Adelaide vs. South Adelaide)← 19011903 → The 1902 South Australian Football Association season was the 26th season of the top-level Australian rules football competition in Sou...

 

Municipality in Zambales, Philippines This article is about the municipality. For the economic zone and freeport area, see Subic Special Economic and Freeport Zone. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Subic, Zambales – news · newspapers · books · scholar · JSTOR (February 2011) (Learn how and whe...

Mangum Mound Site22 CB 584Mangum MoundLocation within Mississippi todayLocationPort Gibson, Claiborne County, Mississippi,  USARegionClaiborne County, MississippiCoordinates31°59′30.3″N 90°53′59.14″W / 31.991750°N 90.8997611°W / 31.991750; -90.8997611HistoryPeriodsFoster PhaseCulturesPlaquemine cultureSite notesExcavation dates1936, 1951, 1963ArchaeologistsCharles F. BohannonResponsible body: State of Mississippi Mangum Mound Site (22 CB...

 

2004 video gameCrash Bandicoot Purple:Ripto's RampageSpyro Orange:The Cortex ConspiracyThe North American cover arts for Crash Bandicoot Purple: Ripto's Rampage and Spyro Orange: The Cortex ConspiracyDeveloper(s)Vicarious VisionsPublisher(s)Vivendi Universal Games[a]Producer(s)Caroline TrujilloDesigner(s)Jonathan RussellColin WilkinsonProgrammer(s)Sunbir GillJan-Erik SteelEric CarasziArtist(s)Brent GibsonChongguang ZhangRobyn PoirierJason HarlowComposer(s)Martin SchioelerSeriesCrash B...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!