{"id":1296,"date":"2011-01-30T16:34:02","date_gmt":"2011-01-30T08:34:02","guid":{"rendered":"http:\/\/www.hyzgame.org.cn\/?p=1296"},"modified":"2011-01-30T16:37:37","modified_gmt":"2011-01-30T08:37:37","slug":"%e6%96%b0%e6%b8%b2%e6%9f%93%e5%99%a8opengl-core-profile%e6%a8%a1%e5%bc%8f%e5%9f%ba%e7%a1%80%e7%89%a9%e7%bb%88%e4%ba%8e%e5%ae%8c%e6%88%90","status":"publish","type":"post","link":"http:\/\/www.hyzgame.com\/?p=1296","title":{"rendered":"\u65b0\u6e32\u67d3\u5668OpenGL Core Profile\u6a21\u5f0f\u57fa\u7840\u7269\u7ec8\u4e8e\u5b8c\u6210"},"content":{"rendered":"<p>\u540c\u4e0a\u7bc7\u7684\u4e09\u89d2\u5f62\u4e00\u6837\uff0c\u867d\u7136\u53ea\u662f2\u4e2a\u666e\u901a\u7684\u65b9\u5757\uff0c\u4f46\u5b83\u4eec\u786e\u9700\u8981\u5f88\u9ad8\u7aef\u7684\u663e\u5361\u3002\u5168OpenGL 3.3\/4.1 Core Profile\u7f16\u7a0b\uff0c\u6587\u672b\u9644Shader.<\/p>\n<p><a rel=\"attachment wp-att-1297\" href=\"http:\/\/www.hyzgame.org.cn\/?attachment_id=1297\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1297\" title=\"2Cube\" src=\"http:\/\/www.hyzgame.org.cn\/wp-content\/uploads\/2011\/01\/2Cube.png\" alt=\"\" width=\"640\" height=\"480\" srcset=\"http:\/\/www.hyzgame.com\/wp-content\/uploads\/2011\/01\/2Cube.png 640w, http:\/\/www.hyzgame.com\/wp-content\/uploads\/2011\/01\/2Cube-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\nvertex_shader:<\/p>\n<p style=\"padding-left: 30px;\">#version 330<\/p>\n<p>uniform mat4 projection_matrix;<br \/>\nuniform mat4 modelview_matrix;<\/p>\n<p>in vec3 Vertex;<br \/>\nin vec3 Normal;<\/p>\n<p>out vec3 fragment_normal;<\/p>\n<p>void main(void)<br \/>\n{<br \/>\nfragment_normal=(modelview_matrix*vec4(Normal,0.0)).xyz;<\/p>\n<p>gl_Position=projection_matrix*modelview_matrix*vec4(Vertex,1.0);<br \/>\n}<\/p>\n<p style=\"padding-left: 30px;\">\n<p>fragment_shader:<\/p>\n<p style=\"padding-left: 30px;\">#version 330<\/p>\n<p>in vec3 fragment_normal;<\/p>\n<p>uniform vec4 color;<\/p>\n<p>layout(location = 0, index = 0) out vec4 fragColor;<\/p>\n<p>void main(void)<br \/>\n{<br \/>\nfloat intensity=max(dot(fragment_normal,vec3(0.0,0.0,1.0)),0.0);<\/p>\n<p>fragColor=color*intensity;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u4e0a\u7bc7\u7684\u4e09\u89d2\u5f62\u4e00\u6837\uff0c\u867d\u7136\u53ea\u662f2\u4e2a\u666e\u901a\u7684\u65b9\u5757\uff0c\u4f46\u5b83\u4eec\u786e\u9700\u8981\u5f88\u9ad8\u7aef\u7684\u663e\u5361\u3002\u5168OpenGL 3.3\/4.1 Core [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1296","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/1296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1296"}],"version-history":[{"count":5,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/1296\/revisions"}],"predecessor-version":[{"id":1302,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/1296\/revisions\/1302"}],"wp:attachment":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1296"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}