GpuMatrix!

3×3 Matrix filter for the GPU in Nuke! Yay!


There’s two hidden nodes in Nuke, GpuOp and GpuFileShader, both are nodes that can run GLSL shaders realtime in the Nuke viewers.

I had a quick look at it eariler this year, one of the things that came out of it was a 3×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 :

  • Does not render
  • Only affects whats in the viewer (ie, results zoom dependent)
  • Memory limitations

But it does have some benefits like

  • Runtime dev environment
  • GpuOp node concatinates , can create complex effects
  • Shader code is portable

How to use it
Turn of any viewing lut and enable “use gpu whenever possible” in the prefs, download the shader and point the nuke GpuMatrix node to the text-file. As always, if you end up using the GpuMatrix in any form, you’re in beer-debt to me.

-theo

Nuke node below and click here to download the shader.

set cut_paste_input [stack 0]
version 6.1 v1
push $cut_paste_input
GPUFileShader {
shader_file “/net/homes/tgroeneb/Desktop/RND – theo projects/gpuMatrix.txt”
name GpuMatrix2
selected true
xpos -4664
ypos 2406
addUserKnob {20 User}
addUserKnob {26 Presets}
addUserKnob {22 Reset -STARTLINE T “this =nuke.toNode(‘this’)\nthis\[‘v1’].setValue(0)\nthis\[‘v2’].setValue(0)\nthis\[‘v3’].setValue(0)\n\nthis\[‘v4’].setValue(0)\nthis\[‘v5’].setValue(1)\nthis\[‘v6’].setValue(0)\n\nthis\[‘v7’].setValue(0)\nthis\[‘v8’].setValue(0)\nthis\[‘v9’].setValue(0)\n\nthis\[‘val’].setValue(1)”}
addUserKnob {22 Sharpen -STARTLINE T “this =nuke.toNode(‘this’)\nthis\[‘v1’].setValue(0)\nthis\[‘v2’].setValue(-1)\nthis\[‘v3’].setValue(0)\n\nthis\[‘v4’].setValue(-1)\nthis\[‘v5’].setValue(5)\nthis\[‘v6’].setValue(-1)\n\nthis\[‘v7’].setValue(0)\nthis\[‘v8’].setValue(-1)\nthis\[‘v9’].setValue(0)”}
addUserKnob {22 Blur -STARTLINE T “this =nuke.toNode(‘this’)\nthis\[‘v1’].setValue(1)\nthis\[‘v2’].setValue(1)\nthis\[‘v3’].setValue(1)\n\nthis\[‘v4’].setValue(1)\nthis\[‘v5’].setValue(1)\nthis\[‘v6’].setValue(1)\n\nthis\[‘v7’].setValue(1)\nthis\[‘v8’].setValue(1)\nthis\[‘v9’].setValue(1)\n\nthis\[‘norm’].setValue(1)”}
addUserKnob {22 EdgeDetect -STARTLINE T “this =nuke.toNode(‘this’)\nthis\[‘v1’].setValue(0)\nthis\[‘v2’].setValue(1)\nthis\[‘v3’].setValue(0)\n\nthis\[‘v4’].setValue(1)\nthis\[‘v5’].setValue(-4)\nthis\[‘v6’].setValue(1)\n\nthis\[‘v7’].setValue(0)\nthis\[‘v8’].setValue(1)\nthis\[‘v9’].setValue(0)\n\nthis\[‘norm’].setValue(0)”}
addUserKnob {22 Emboss -STARTLINE T “this =nuke.toNode(‘this’)\nthis\[‘v1’].setValue(-2)\nthis\[‘v2’].setValue(-1)\nthis\[‘v3’].setValue(0)\n\nthis\[‘v4’].setValue(-1)\nthis\[‘v5’].setValue(1)\nthis\[‘v6’].setValue(1)\n\nthis\[‘v7’].setValue(0)\nthis\[‘v8’].setValue(1)\nthis\[‘v9’].setValue(2)”}
addUserKnob {26 “”}
addUserKnob {6 norm l Normalize +STARTLINE}
norm true
addUserKnob {7 val l “Pixel Offset” R 0 50}
val 5.2
addUserKnob {26 Matrix}
addUserKnob {3 v1}
v1 1
addUserKnob {3 v2 -STARTLINE}
v2 1
addUserKnob {3 v3 -STARTLINE}
v3 1
addUserKnob {3 v4}
v4 1
addUserKnob {3 v5 -STARTLINE}
v5 1
addUserKnob {3 v6 -STARTLINE}
v6 1
addUserKnob {3 v7}
v7 1
addUserKnob {3 v8 -STARTLINE}
v8 1
addUserKnob {3 v9 -STARTLINE}
v9 1
addUserKnob {26 “”}
addUserKnob {26 About -STARTLINE T “GPUmatrix v0.1 \ntheo@euqahuba.com”}
}

11 thoughts on “GpuMatrix!

  1. Thanks Theo

    I work with Nuke 6.2 and the semantics input0_tex_width and input0_tex_height don’t work.
    There is a documentation of semantic GLSL used in Nuke?

    Thanks

  2. Hi Gerald, I’m not running 6.2 yet so can’t help you there. But keep in mind the GpuOp nodes are experimental and hidden for a reason :)

  3. I visited various web sites but the audio feature for audio songs current at this site is genuinely superb.

  4. Your style is unique in comparison to other people I have read stuff from.
    Thanks for posting when you have the opportunity, Guess I’ll just
    bookmark this site.

  5. I was suggested this web site via my cousin. I am not certain whether this post is written by him as no one else know such specified approximately my trouble.
    You’re incredible! Thanks!

    Here is my blog post download frozen

  6. Unquestionably imagine that which you stated. Your favourite reason appeared to be on the web
    the simplest factor to take into accout of. I say
    to you, I certainly get annoyed while people think about concerns that they plainly do not
    understand about. You managed to hit the nail upon the
    highest as smartly as outlined out the entire thing without having side effect , people could take a signal.

    Will probably be back to get more. Thank you

    Feel free to surf to my web page: hay day triche

  7. Hi there! I know this is kinda off topic but I was wondering if you knew where I could locate
    a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot!

    Here is my weblog … cheat garis 8 ball pool

Comments are closed.