{"id":2040,"date":"2017-11-14T19:02:34","date_gmt":"2017-11-14T11:02:34","guid":{"rendered":"http:\/\/www.hyzgame.com.cn\/?p=2040"},"modified":"2017-11-14T19:02:34","modified_gmt":"2017-11-14T11:02:34","slug":"%e4%bb%a5%e7%94%bb%e7%82%b9%e6%96%b9%e5%bc%8f%e7%94%bb2d%e7%9f%a9%e5%bd%a2%ef%bc%8c%e5%87%8f%e5%b0%91%e6%95%b0%e6%8d%ae%e4%bc%a0%e8%be%93%e9%87%8f","status":"publish","type":"post","link":"http:\/\/www.hyzgame.com\/?p=2040","title":{"rendered":"\u4ee5\u753b\u70b9\u65b9\u5f0f\u753b2D\u77e9\u5f62\uff0c\u51cf\u5c11\u6570\u636e\u4f20\u8f93\u91cf"},"content":{"rendered":"<p>\u4e3b\u8981\u601d\u60f3\u662f\u4ee5\u753b\u70b9\u6a21\u5f0f\u7ed8\u56fe\uff0c\u5728\u4e00\u4e2a\u9876\u70b9\u6570\u636e\u4e0b\u4fdd\u5b58left,top,right,bottom\u56db\u4e2a\u6570\u636e\u3002\u5728Geometry shader\u4e2d\u8f6c\u6362\u6210Triangle Strip\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Vertex Shader<\/strong><\/span><br \/>\n#version 330 core<\/p>\n<p>uniform mat4 ModelViewProjectionMatrix;<br \/>\nlayout(location=0) in vec4 Vertex;<br \/>\nvoid main()<br \/>\n{<br \/>\nvec4 lt=vec4(Vertex.xy,vec2(0,1));<br \/>\nvec4 rb=vec4(Vertex.zw,vec2(0,1));<\/p>\n<p>vec4 lt_fin=lt*ModelViewProjectionMatrix;<br \/>\nvec4 rb_fin=rb*ModelViewProjectionMatrix;<\/p>\n<p>gl_Position=vec4(lt_fin.xy,rb_fin.xy);<br \/>\n}<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Geometry Shader<\/strong><\/span><br \/>\n#version 330 core<\/p>\n<p>layout (points) in;<br \/>\nlayout (triangle_strip,max_vertices=4) out;<\/p>\n<p>void main()<br \/>\n{<br \/>\nvec2 lt=gl_in[0].gl_Position.xy;<br \/>\nvec2 rb=gl_in[0].gl_Position.zw;<\/p>\n<p>gl_Position=vec4(lt, vec2(0,1));EmitVertex();<br \/>\ngl_Position=vec4(lt.x,rb.y, vec2(0,1));EmitVertex();<br \/>\ngl_Position=vec4(rb.x,lt.y, vec2(0,1));EmitVertex();<br \/>\ngl_Position=vec4(rb, vec2(0,1));EmitVertex();<\/p>\n<p>EndPrimitive();<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u8981\u601d\u60f3\u662f\u4ee5\u753b\u70b9\u6a21\u5f0f\u7ed8\u56fe\uff0c\u5728\u4e00\u4e2a\u9876\u70b9\u6570\u636e\u4e0b\u4fdd\u5b58left,top,right,bottom\u56db\u4e2a\u6570\u636e\u3002\u5728Geome [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-2040","post","type-post","status-publish","format-standard","hentry","category-opengl"],"_links":{"self":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/2040","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=2040"}],"version-history":[{"count":1,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/2040\/revisions"}],"predecessor-version":[{"id":2041,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/2040\/revisions\/2041"}],"wp:attachment":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2040"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}