{"id":70,"date":"2009-03-16T02:45:32","date_gmt":"2009-03-16T02:45:32","guid":{"rendered":"http:\/\/shultays.wordpress.com\/?p=70"},"modified":"2009-03-16T02:45:32","modified_gmt":"2009-03-16T02:45:32","slug":"z-fighting","status":"publish","type":"post","link":"https:\/\/enginmercan.com\/?p=70","title":{"rendered":"Z fighting"},"content":{"rendered":"<p>Opengl de bana ilgin\u00e7 bir an\u0131 ve \u015fu anda kulland\u0131\u011f\u0131m avatar\u0131m\u0131 vermi\u015f olan konu.<\/p>\n<p>Basit olarak anlatmak gerekirse 3d ile \u00e7izilen iki \u015feklin kameraya olan uzakl\u0131klar\u0131n\u0131n birbirine e\u015fit (veya \u00e7ok yak\u0131n) olmas\u0131 ile olu\u015fan, opengl in hangi \u015fekil \u00fcstte olmal\u0131 anlayamamas\u0131ndan olu\u015fur.<\/p>\n<p>En basit \u00e7\u00f6z\u00fcm\u00fc \u00fcstte g\u00f6r\u00fcn\u00fclmesi istenilen \u015feklin bir birim daha \u00f6ne kayd\u0131r\u0131lmas\u0131d\u0131r, ama e\u011fer bizim ba\u015fta\u00a0 &#8220;en fazla \u015fu kadar uzakl\u0131kta olan z lerin \u00e7izilmesine izin ver&#8221; diye verdi\u011fimiz de\u011fer \u00e7ok b\u00fcy\u00fckse bu yeterli olmayabilir.<\/p>\n<p>Di\u011fer bir \u00e7\u00f6z\u00fcmde stencil buffer kullanmak. \u00d6nce altta kalmas\u0131n\u0131 istedi\u011fimiz nesneyi hem ekrana hem de stencil buffer\u0131na \u00e7izeriz, daha sonrada \u00fcstte kalmas\u0131n\u0131 istedi\u011fimiz nesneyi e\u011fer stencil buffer 1 ise kesin \u00e7iz, 0 ise depth test yap \u00f6yle \u00e7iz deriz. \u015eu an da tam hangi de\u011ferleri verece\u011fiz akl\u0131mda olmad\u0131\u011f\u0131 i\u00e7in b\u00f6yle yar\u0131m yamalak bir tan\u0131m yapt\u0131m =)<\/p>\n<p>Neyse as\u0131l anlatmak istedi\u011fim bu z buffer \u0131n bana b\u0131rakt\u0131\u011f\u0131 ho\u015f an\u0131 =) 3 boyutlu engebeli bir gezegen yapmak istiyordum, ve onunla u\u011fra\u015f\u0131rken \u015fu \u015fekli ortaya \u00e7\u0131kard\u0131m.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-71\" title=\"interesting1\" src=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/interesting1.jpg\" alt=\"interesting1\" width=\"470\" height=\"470\" srcset=\"https:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/interesting1.jpg 512w, https:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/interesting1-150x150.jpg 150w, https:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/interesting1-300x300.jpg 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>Ne oldu\u011funu ba\u015fta \u00e7\u00f6zemedim, sonradan farkedebildim niye b\u00f6yle bir \u015fey \u00e7\u0131kt\u0131\u011f\u0131n\u0131. \u0130\u015fte z fighting sonucu ortaya \u00e7\u0131kan bir \u015fekil, do\u011frusu g\u00f6z\u00fcme \u00e7ok ho\u015f geldi ve avatar olarak kullanma karar\u0131 ald\u0131m =D \u0130lerde birileri sorunca avatar\u0131n ne diye &#8220;Kendisi bir bugt\u0131r&#8221; diyece\u011fim.<\/p>\n<p>Malesef program\u0131n o halini kaydetmemi\u015fim =( ama bir g\u00fcn tekrar ayn\u0131 &#8220;hata&#8221;y\u0131 ortaya \u00e7\u0131karmaya \u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-72\" title=\"gezegen\" src=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/gezegen.jpg\" alt=\"gezegen\" width=\"200\" height=\"200\" srcset=\"https:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/gezegen.jpg 200w, https:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/gezegen-150x150.jpg 150w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/p>\n<p>Bu da \u015feklin olmas\u0131 gerek \u015fey idi, malesef sadece \u00e7ok k\u00fc\u00e7\u00fck bir resmini tutmu\u015fum. Soldaki \u015fey engebeli bir gezegen asl\u0131nda, d\u00f6nd\u00fcr\u00fcnce falan ho\u015f duruyordu. \u0130leride tekrar u\u011fra\u015fabilirim, yapmak istedi\u011fim proje k\u00fcre \u015feklinde bir d\u00fcnya yaratmak ve u\u00e7arak bu d\u00fcnya \u00fczerinde gezine bilmek idi (Spore oynayanlar demek istedi\u011fimi anlayabilmi\u015ftir) hatta binalar falan eklerim diyordum ama sonunda (di\u011fer bir \u00e7ok projeye olan \u015fey gibi =D) yar\u0131m kald\u0131. \u015eu an dosyalar\u0131n\u0131 bile bulam\u0131yorum.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Opengl de bana ilgin\u00e7 bir an\u0131 ve \u015fu anda kulland\u0131\u011f\u0131m avatar\u0131m\u0131 vermi\u015f olan konu. Basit olarak anlatmak gerekirse 3d ile \u00e7izilen iki \u015feklin kameraya olan uzakl\u0131klar\u0131n\u0131n birbirine e\u015fit (veya \u00e7ok yak\u0131n) olmas\u0131 ile olu\u015fan, opengl in hangi \u015fekil \u00fcstte olmal\u0131 anlayamamas\u0131ndan olu\u015fur. En basit \u00e7\u00f6z\u00fcm\u00fc \u00fcstte g\u00f6r\u00fcn\u00fclmesi istenilen \u015feklin bir birim daha \u00f6ne kayd\u0131r\u0131lmas\u0131d\u0131r, ama [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-eglence"],"_links":{"self":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":0,"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"wp:attachment":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}