World Position Tool Kit v1.3


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Ivan Kokov
Website: lnkd.in/yDEUQH
World Position Tool Kit is set of instruments to operate with World Position Data Pass. Which allow you to get various masks, textures and even project images using data position from 3D renders. In new version Lambert Shader added and some bugs fixed.
Requirements:
7.0 or later
Linux, Mac, Windows
24 Mar 2015
4994

World Position Tool Kit is set of instrument to operate with World Position Data Pass. Which allow you to get various masks, textures and even project images using data position from 3D renders.

World Position Pass

World Position Pass is a data pass which you can ask to render for your 3D guys or make by yourself in 3DS Max, Maya or any other 3d software, and also within Nuke. This Data Pass also known as Point Position, Point Cloud, XYZ pass, xyzWPP and so on. Its main idea is to represent 3D position of point on surfaces as a data in pixel. So as fact these colorful images you gets as render result is not a picture, but some kind of data base.

For example, you see pixel of color R, G, B in coordinate X2d,Y2don your 2D render. This means that object appeared in X2d,Y2d coordinates on flat 2D picture situated in position X3d=R, Y3d=R, Z3d=B in 3D scene of Maya or 3DS MAX.

Still this is not a straight rule and here some variations are possible. For example - Object Position Pass designed to represents position of surface points relatively to some object. This can be very useful in work with animated bodies. But still this is 3D position data, only difference here is center of coordinates, - for moving objects it will follow the animation path.

Tools Description

At the moment I designed few tools which helps me a lot in my work with any kind of 3D renders. Basically one of the main problem of 3D for compositors can be described in few word: “it looks not as I like”. And roughly our task is to make it looks great. To do so we always have to select some areas on renders and modify it somehow. That means tons of roto, tracking, 3D reconcile, projection and other tweaks in order to get nice mask nailed to 3D surfaces.

Most part of WPTK tools are designed to do this part of job automatically. Let's take a closer look.

Mask3DCubical_ik

This gizmo creates a cubical 3D matte based on a World position pass. Feed it as input, place center of selection by picking color on WP pass, then adjust softness and rotation.

Can be useful for matting human made stuff such as buildings, boxes and other object with rectangular shaped edges.

It output matte into Alpha channel by default. It's very easy to control position of mask by picking color and displaying alpha channel in viewer.

Mask3DSpherical_ik

Same as Mask3DCubical_ik, but designed to make mattes more soft and organic. Workflow is exactly the same.

Mask3DGradient_ik

Makes a gradient matte between two point in 3D space based on a World position pass. Imagine two flat surfaces parallel to each other in your 3D scene. Everything behind first one becomes 0, everything behind second – 1, and soft gradient between them. Just place From and To points by picking colors on WPP.

*Avoid using same values for 'From' and 'To'. This may divide your universe to zero!

TransformWorld_ik

TransformWorld_ik gizmo stand a bit aside of previous group of tools. It doesn't create masks nor produces anything clearly visible. It does much better. It modifies 3D data in WPP. This gizmo can translate, rotate, scale and squeeze whole your 3D world.

This can be very useful in various situations. For example, you made a nice matte, but now you need to move it to another position. With TransformWorld_ik you can do it easily. Just place gizmo before your Masking nodes and play with sliders. Another simple example is animated mask for moving light, with this gismo you can easily move your bright spot from moving flashlight over 3D scene without any extra renders.

With some practice you can find a lot of other ways how to use this guy. I used it to simulate light from futuristic engines of hover cars, for blinking light inside of damaged star-ship, for always moving shadow from leafs over CG arrows and so on. This is limited only by your imagination.

WorldPos_Texture_Projection_ik

With WorldPos_Texture_Projection_ik gizmo you don't need extra UV or heavy 3D scenes to project your texture over geometry. This tool creates parallel projection of texture over world position point. Place center of your projection, press “Bake Position”, adjust transformation and tilling options, enjoy!

WorldPos_Texture_Generator_ik

WorldPos_Texture_Generator create procedural texture over world position points. Choose type of texture, and adjust properties. To adjust scale and position use together with TransformWorld_ik gizmo.

WorldPos_Lambert_Shader_ik

This gizmo allow you to make simple lighting based on Lambert shading algorithm. At the moment only point light is supported but it should be enough for almost any situation. Connect your World Position and World Normals to inputs, adjust position of light and play with settings. All is pretty fast and interactive.

Limitation of World Position Workflow

Because of nature of Data Passes, WPP should be always rendered without anti-aliasing. Otherwise you will get artifacts on all aliased areas.

As result this means that all edges you get using WPP will be not aliased. There are many ways how to solve this issue. I usually intensively use object's and material's mattes from 3D guys, plus blur and erode filters. As fact each single edge demands own approach.

WPP also can not be rendered for transparent object because each pixel can display position of one only point. So this method is not applicable to fluid simulations, nor objects behind the glass, nor 3D motion blur.

How to install

Copy WPTK gizmos into your gizmo folder. For example:

C:\Users\Ivan\.nuke\_gizmos

Add path to read in your init.py file. Usually can find it in folder:

C:\Users\%username%\.nuke

Just add one string into there

nuke.pluginAddPath( './_gizmos' )

Create menu items in your menu.py by adding strings

toolbar = nuke.menu('Nuke')

wptkMenu = toolbar.addMenu('World Position Tool Kit')

wptkMenu.addCommand('Mask3DCubical_ik', 'nuke.createNode('Mask3DCubical_ik')')

wptkMenu.addCommand('Mask3DGradient_ik', 'nuke.createNode('Mask3DGradient_ik')')

wptkMenu.addCommand('Mask3DSpherical_ik', 'nuke.createNode('Mask3DSpherical_ik')')

wptkMenu.addCommand('TransformWorld_ik', 'nuke.createNode('TransformWorld_ik')')

wptkMenu.addCommand('WorldPos_Texture_Projection_ik', 'nuke.createNode('WorldPos_Texture_Projection_ik')')

wptkMenu.addCommand('WorldPos_Texture_Generator_ik', 'nuke.createNode('WorldPos_Texture_Generator_ik')')

wptkMenu.addCommand('WorldPos_Lambert_Shader_ik', 'nuke.createNode('WorldPos_Lambert_Shader_ik')')

Restart your nuke.

Or just ask your comp TD or system administrator for help.

Feel free to contact me in case of any questions!

[email protected]

Please login in order to download these files.

Comments   

 
+1 # Evan Ghigliotty 2014-03-07 23:23
Awesome tools! Thanks for making them

I was able to make the spherical mask more interactive by linking the position and radius of a nuke sphere to the position and softness attributes you had already created.

That in combination with a position to points node in nuke's 3d you can really place the mask very easily. I'll email the setup it to you.
 
 
+1 # Ivan Kokov 2014-03-10 03:49
Hi Evan
As first thank you very much for feedback! I really appreciate it a lot!
And thank you for sharing you setup, it's really interesting! Yes I like idea of using Nuke 3d stuff together with Point position data. This make whole process much more easy understandable, interactive and fun.
In other side Nuke 3d scene requires Camera, Position to Point node, Scene and Render. All these can slow down your script a lot. Especially Position to Point and Render. And I would prefer to keep it running as fast as possible.
For sake of interactivity I usually use one simple trick: I just switch to alpha channel in viewer, then activate position picker in my gizmo and pick position as color in viewer. And in alpha you will see the result automatically. Very vast, very interactive, don't need any extra 3D stuff at all. Try it!
Anyway I like your idea of 3D sphere as part of interface and I would add it in gizmo, but in this case I also need Camera always connected to the gizmo, which is not that convenient to me... but It's my personal choice :-)
 
 
0 # art beat 2015-06-12 23:42
Thanks for the Gizmo's!
 
 
0 # Raven Mohr 2016-11-16 07:54
Hey Ivan! This is awesome stuff!!! I was looking for a bunch of tools online and came across this again. Thank you :D
 
 
0 # timmy ng 2017-01-22 11:51
It's always give us error message like :
ERROR: WorldPos_Textur e_Projection_ik 4.Pick1.CenterP osition: unexpected '"' in ""unable to sample node for given channel (rgba.red) at current context""
ERROR: WorldPos_Textur e_Projection_ik 4.Pick1.CenterP osition: unexpected '"' in ""unable to sample node for given channel (rgba.green) at current context""
ERROR: WorldPos_Textur e_Projection_ik 4.Pick1.CenterP osition: unexpected '"' in ""unable to sample node for given channel (rgba.blue) at current context""

How can we fix it ?
 
 
0 # frederik-Andre Savard 2017-01-23 16:15
Hi !
in your software description, you say that you can generate wpp and opp within nuke:

"World Position Pass is a data pass which you can ask to render for your 3D guys or make by yourself in 3DS Max, Maya or any other 3d software, and also within Nuke"

Do you have some input on how you dit this ?
 
 
0 # Michael Clemens 2018-02-10 03:22
After installation, it seems to disable the viewer hotkeys (rgba) and the tab menu in the dag.
 

You have no rights to post comments

We have 3050 guests and 70 members online