{"id":11042,"date":"2021-12-07T11:51:51","date_gmt":"2021-12-07T03:51:51","guid":{"rendered":"https:\/\/www.bookcard.net\/wordpress\/?p=11042"},"modified":"2021-12-08T00:53:51","modified_gmt":"2021-12-07T16:53:51","slug":"android_studio_ndk_opengl_es_alpha_glalphafunc","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_alpha_glalphafunc\/","title":{"rendered":"Android Studio NDK-OpenGL ES \u900f\u660eglAlphaFunc()"},"content":{"rendered":"<figure id=\"attachment_11043\" aria-describedby=\"caption-attachment-11043\" style=\"width: 1280px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_NDK_OpenGL_ES_Alpha_glAlphaFunc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-11043\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_NDK_OpenGL_ES_Alpha_glAlphaFunc.jpg\" alt=\"Android Studio NDK-OpenGL ES \u900f\u660eglAlphaFunc()\" width=\"1280\" height=\"800\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_NDK_OpenGL_ES_Alpha_glAlphaFunc.jpg 1280w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_NDK_OpenGL_ES_Alpha_glAlphaFunc-300x188.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_NDK_OpenGL_ES_Alpha_glAlphaFunc-768x480.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><figcaption id=\"caption-attachment-11043\" class=\"wp-caption-text\">Android Studio NDK-OpenGL ES \u900f\u660eglAlphaFunc()<\/figcaption><\/figure>\n<p>\u4fc22D\u6e38\u6232\u4f4d\u5716\u611b\u849e\u505a\u52d5\u756b, \u8981\u904e\u6ffe\u300e\u80cc\u666f\u8272\u300f, \u4fc2Android OpenGL ES\u7528alpha\u5c4f\u853d\u300e\u80cc\u666f\u8272\u300f, \u58f9\u6cd5\u4f4d\u5716\u300eA\u5206\u91cf\u300fAlpha = 0, \u8cb3\u6cd5\u9ed1\u8272\u5b9a\u70ba\u300e\u80cc\u666f\u8272\u300f\u4fc2\u8f09\u5165\u6642\u5c07\u300eA\u5206\u91cf\u300fAlpha = 0. \u6240\u4ee5\u5169\u6cd5\u8981\u4fc2\u300eGL_RGBA\u300f\u6a21\u5f0f\u904b\u904b\u4f5c.<\/p>\n<p>RGBA8888\u4f4d\u5716,RGB\u536024bit, Alpha \u503cA\u53608bit, \u900f\u660e\u5ea6\u7bc4\u570d\u300e0~255\u300f. \u300e0\u300f\u901a\u900f.\u300e 255\u300f\u5be6\u9ad4.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"215\">\u8a2dAlpha\u503c<\/td>\n<td width=\"180\">\u901a\u900f<\/td>\n<td width=\"180\">\u5be6\u9ad4<\/td>\n<\/tr>\n<tr>\n<td width=\"215\">glAlphaFunc()<\/td>\n<td width=\"180\">0.0<\/td>\n<td width=\"180\">1.0<\/td>\n<\/tr>\n<tr>\n<td width=\"215\">glAlphaFuncx()<\/td>\n<td width=\"180\">0<\/td>\n<td width=\"180\">255<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u82e5\u4f4d\u5716\u5187Alpha \u503c, OpenGL ES \u4fc2\u8f09\u5165\u6642\u5c07Alpha\u503c\u8a2d1.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"288\">BGRA8888\/ARGB8888<\/td>\n<td width=\"288\">Alpha = 0<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">RGB656,RGB888,index<\/td>\n<td width=\"288\">R=0,G=0,B=0, \u9ed1\u8272<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol>\n<li>\u00a0\u8f09\u5165\u7eb9\u7406\u5716\u5f62\u5361\u300eRAM\u300f, \u8a2dGL_RGBA\u6a21\u5f0f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width , height , 0, GL_RGBA, GL_UNSIGNED_BYTE, \u00a0image);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"2\">\n<li>\u5553\u7528\u900f\u660e\u6e2c\u8a66<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glEnable(GL_ALPHA_TEST);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"3\">\n<li>\u8a2dAlpha\u503c\u904e\u6ffe\u900f\u660e\u8272<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glAlphaFunc(GL_GREATER, 0);<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">glAlphaFuncx(GL_GREATER, 0);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fc22D\u6e38\u6232\u4f4d\u5716\u611b\u849e\u505a\u52d5\u756b, \u8981\u904e\u6ffe\u300e\u80cc\u666f\u8272\u300f, \u4fc2Android OpenGL ES\u7528alpha\u5c4f\u853d\u300e\u80cc\u666f\u8272\u300f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_alpha_glalphafunc\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">Android Studio NDK-OpenGL ES \u900f\u660eglAlphaFunc()<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,62],"tags":[],"class_list":["post-11042","post","type-post","status-publish","format-standard","hentry","category-android","category-opengl","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/comments?post=11042"}],"version-history":[{"count":1,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11042\/revisions"}],"predecessor-version":[{"id":11044,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11042\/revisions\/11044"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=11042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=11042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=11042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}