{"id":182,"date":"2010-11-17T12:29:02","date_gmt":"2010-11-17T10:29:02","guid":{"rendered":"http:\/\/euqahuba.com\/blog\/?p=182"},"modified":"2013-01-17T12:31:53","modified_gmt":"2013-01-17T10:31:53","slug":"gpumatrix","status":"publish","type":"post","link":"https:\/\/euqahuba.com\/blog\/?p=182","title":{"rendered":"GpuMatrix!"},"content":{"rendered":"<p><a href=\"http:\/\/euqahuba.com\/blog\/wp-content\/uploads\/2010\/11\/gpumatrixSmall.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-201\" title=\"gpumatrixSmall\" src=\"http:\/\/euqahuba.com\/blog\/wp-content\/uploads\/2010\/11\/gpumatrixSmall.jpeg\" alt=\"\" width=\"600\" height=\"240\" \/><\/a><\/p>\n<p>3&#215;3 Matrix filter for the GPU in Nuke! Yay!<\/p>\n<p><!--more--><br \/>\nThere&#8217;s two <span style=\"text-decoration: underline;\">hidden <\/span>nodes in Nuke, GpuOp and GpuFileShader, both are nodes that can run <span style=\"text-decoration: underline;\">GLSL <\/span>shaders realtime in the Nuke viewers.<\/p>\n<p>I had a quick look at it eariler this year, one of the things that came out of it was a 3&#215;3 matrix filter. Pretty much identical to the built in matrix in Nuke. But realtime on the gpu. While this nodes is pretty awesome for prototyping effects and creating interesting LUTs, it has all the limitations of any GPU shader. Some of them are :<\/p>\n<ul>\n<li>Does not render<\/li>\n<li>Only affects whats in the viewer (ie, results zoom dependent)<\/li>\n<li>Memory limitations<\/li>\n<\/ul>\n<p>But it does have some benefits like<\/p>\n<ul>\n<li>Runtime dev environment<\/li>\n<li>GpuOp node concatinates , can create complex effects<\/li>\n<li>Shader code is portable<\/li>\n<\/ul>\n<p><strong>How to use it <\/strong><br \/>\nTurn of any viewing lut and enable &#8220;use gpu whenever possible&#8221; in the prefs, <a href=\"http:\/\/euqahuba.com\/blog\/wp-content\/uploads\/2010\/11\/gpuMatrix.txt\">download<\/a> the shader and point the nuke GpuMatrix node to the text-file. As always, if you end up using the GpuMatrix in any form, <span style=\"text-decoration: underline;\">you&#8217;re in beer-debt to me<\/span><strong>.<\/strong><\/p>\n<p>-theo<strong> <\/strong><\/p>\n<p>Nuke node below and <strong><a href=\"http:\/\/euqahuba.com\/blog\/wp-content\/uploads\/2010\/11\/gpuMatrix.txt\">click here to download the shader.<\/a><\/strong><\/p>\n<blockquote><p>\nset cut_paste_input [stack 0]<br \/>\nversion 6.1 v1<br \/>\npush $cut_paste_input<br \/>\nGPUFileShader {<br \/>\nshader_file &#8220;\/net\/homes\/tgroeneb\/Desktop\/RND &#8211; theo projects\/gpuMatrix.txt&#8221;<br \/>\nname GpuMatrix2<br \/>\nselected true<br \/>\nxpos -4664<br \/>\nypos 2406<br \/>\naddUserKnob {20 User}<br \/>\naddUserKnob {26 Presets}<br \/>\naddUserKnob {22 Reset -STARTLINE T &#8220;this =nuke.toNode(&#8216;this&#8217;)\\nthis\\[&#8216;v1&#8217;].setValue(0)\\nthis\\[&#8216;v2&#8217;].setValue(0)\\nthis\\[&#8216;v3&#8217;].setValue(0)\\n\\nthis\\[&#8216;v4&#8217;].setValue(0)\\nthis\\[&#8216;v5&#8217;].setValue(1)\\nthis\\[&#8216;v6&#8217;].setValue(0)\\n\\nthis\\[&#8216;v7&#8217;].setValue(0)\\nthis\\[&#8216;v8&#8217;].setValue(0)\\nthis\\[&#8216;v9&#8217;].setValue(0)\\n\\nthis\\[&#8216;val&#8217;].setValue(1)&#8221;}<br \/>\naddUserKnob {22 Sharpen -STARTLINE T &#8220;this =nuke.toNode(&#8216;this&#8217;)\\nthis\\[&#8216;v1&#8217;].setValue(0)\\nthis\\[&#8216;v2&#8217;].setValue(-1)\\nthis\\[&#8216;v3&#8217;].setValue(0)\\n\\nthis\\[&#8216;v4&#8217;].setValue(-1)\\nthis\\[&#8216;v5&#8217;].setValue(5)\\nthis\\[&#8216;v6&#8217;].setValue(-1)\\n\\nthis\\[&#8216;v7&#8217;].setValue(0)\\nthis\\[&#8216;v8&#8217;].setValue(-1)\\nthis\\[&#8216;v9&#8217;].setValue(0)&#8221;}<br \/>\naddUserKnob {22 Blur -STARTLINE T &#8220;this =nuke.toNode(&#8216;this&#8217;)\\nthis\\[&#8216;v1&#8217;].setValue(1)\\nthis\\[&#8216;v2&#8217;].setValue(1)\\nthis\\[&#8216;v3&#8217;].setValue(1)\\n\\nthis\\[&#8216;v4&#8217;].setValue(1)\\nthis\\[&#8216;v5&#8217;].setValue(1)\\nthis\\[&#8216;v6&#8217;].setValue(1)\\n\\nthis\\[&#8216;v7&#8217;].setValue(1)\\nthis\\[&#8216;v8&#8217;].setValue(1)\\nthis\\[&#8216;v9&#8217;].setValue(1)\\n\\nthis\\[&#8216;norm&#8217;].setValue(1)&#8221;}<br \/>\naddUserKnob {22 EdgeDetect -STARTLINE T &#8220;this =nuke.toNode(&#8216;this&#8217;)\\nthis\\[&#8216;v1&#8217;].setValue(0)\\nthis\\[&#8216;v2&#8217;].setValue(1)\\nthis\\[&#8216;v3&#8217;].setValue(0)\\n\\nthis\\[&#8216;v4&#8217;].setValue(1)\\nthis\\[&#8216;v5&#8217;].setValue(-4)\\nthis\\[&#8216;v6&#8217;].setValue(1)\\n\\nthis\\[&#8216;v7&#8217;].setValue(0)\\nthis\\[&#8216;v8&#8217;].setValue(1)\\nthis\\[&#8216;v9&#8217;].setValue(0)\\n\\nthis\\[&#8216;norm&#8217;].setValue(0)&#8221;}<br \/>\naddUserKnob {22 Emboss -STARTLINE T &#8220;this =nuke.toNode(&#8216;this&#8217;)\\nthis\\[&#8216;v1&#8217;].setValue(-2)\\nthis\\[&#8216;v2&#8217;].setValue(-1)\\nthis\\[&#8216;v3&#8217;].setValue(0)\\n\\nthis\\[&#8216;v4&#8217;].setValue(-1)\\nthis\\[&#8216;v5&#8217;].setValue(1)\\nthis\\[&#8216;v6&#8217;].setValue(1)\\n\\nthis\\[&#8216;v7&#8217;].setValue(0)\\nthis\\[&#8216;v8&#8217;].setValue(1)\\nthis\\[&#8216;v9&#8217;].setValue(2)&#8221;}<br \/>\naddUserKnob {26 &#8220;&#8221;}<br \/>\naddUserKnob {6 norm l Normalize +STARTLINE}<br \/>\nnorm true<br \/>\naddUserKnob {7 val l &#8220;Pixel Offset&#8221; R 0 50}<br \/>\nval 5.2<br \/>\naddUserKnob {26 Matrix}<br \/>\naddUserKnob {3 v1}<br \/>\nv1 1<br \/>\naddUserKnob {3 v2 -STARTLINE}<br \/>\nv2 1<br \/>\naddUserKnob {3 v3 -STARTLINE}<br \/>\nv3 1<br \/>\naddUserKnob {3 v4}<br \/>\nv4 1<br \/>\naddUserKnob {3 v5 -STARTLINE}<br \/>\nv5 1<br \/>\naddUserKnob {3 v6 -STARTLINE}<br \/>\nv6 1<br \/>\naddUserKnob {3 v7}<br \/>\nv7 1<br \/>\naddUserKnob {3 v8 -STARTLINE}<br \/>\nv8 1<br \/>\naddUserKnob {3 v9 -STARTLINE}<br \/>\nv9 1<br \/>\naddUserKnob {26 &#8220;&#8221;}<br \/>\naddUserKnob {26 About -STARTLINE T &#8220;GPUmatrix v0.1 \\ntheo@euqahuba.com&#8221;}<br \/>\n}\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>3&#215;3 Matrix filter for the GPU in Nuke! Yay!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,5],"tags":[43,39,40,44,26,32,41,42],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-compositing","category-tips","category-tools-development","tag-glsl","tag-gpu","tag-gpuop","tag-matrix","tag-nuke","tag-nukex","tag-realtime","tag-shader"],"_links":{"self":[{"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":43,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/euqahuba.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}