Nuke Tips – Quick Texturing with Project3D

quicktexturing_header

Texturing with Project3D? Why not.

One of the handy feature of the Project3D node in Nuke is that we can quickly texture a geometry in Nuke through the use of camera projection.

Sounds familiar? I already covered this technique in depth in a prior post about Camera Projection.

Although this post focus on how we can use it for quick texture work if you don’t want to do another round trip with you preferred 3D authoring software.

Processing the texturing

First of all, you need to know the limitation of this technique as it is a quick way to get something textured by using the camera node to align the texture of your choice onto the 3D model.

Problem here is that precision is is rather difficult and I still recommend to unwrap it externally in software like 3dsmax, Modo, Maya, etc.

  1. Obviously you need to pipe in both the texture and camera into the Project3D node.
  2. Then connect the Project3D node into the geometry node that you want it to be textured.
  3. From there, align the camera to your best effort in getting the model textured properly.

You can also merge multiple textures and cameras onto a single geometry. To accomplish this, you need to make sure to use the MergeMat aka Merge Materials node to combine it into a single material which you can pipe it into the geometry node.

Also do take note the settings for Project On in the Project3D node. The viewer is buggy when you need to view your projected texture in 3D view (or maybe due to unforeseen limitations). For example, it will still show the back of the projected texture when you set it Front (see header image for the black smiley face). Rest assure it will appear correctly when you hook it up to the Scanline Render and view it from there.

Here’s a sample script for you to play in Nuke

quicktexturing_nodegraph

Hey it’s been awhile since I last put up a sample script. Copy and paste the following script into Nuke (preferably version 8 and newer to ensure maximum compatibility) and play around with the settings to see how I set it up.

set cut_paste_input [stack 0]
version 9.0 v3
Camera2 {
 inputs 0
 translate {{curve i x1 -1.934648156 x100 1.985827923 s0.1030000001} {curve i x1 0.06884080172 x100 0.06883656979} {curve i x1 2.77421546 x100 4.035419464 s-0.00680000009 t0}}
 rotate {{curve i x1 0 x100 0} {curve x1 -33.95877506 x100 26.14262772 s1.379999995 t0} {curve i x1 0 x100 0}}
 name CameraMAIN
 selected true
 xpos -138
 ypos 600
}
Camera2 {
 inputs 0
 translate {2.381999969 0 0.05499989167}
 rotate {0 90 0}
 focal 61.5
 name Camera4
 selected true
 xpos -420
 ypos 357
}
ColorWheel {
 inputs 0
 gamma 0.45
 name ColorWheel1
 selected true
 xpos -284
 ypos 225
}
Roto {
 output alpha
 curves {{{v x3f99999a}
  {f 0}
  {n
   {layer Root
    {f 0}
    {t x44800000 x44428000}
    {a pt1x 0 pt1y 0 pt2x 0 pt2y 0 pt3x 0 pt3y 0 pt4x 0 pt4y 0 ptex00 0 ptex01 0 ptex02 0 ptex03 0 ptex10 0 ptex11 0 ptex12 0 ptex13 0 ptex20 0 ptex21 0 ptex22 0 ptex23 0 ptex30 0 ptex31 0 ptex32 0 ptex33 0 ptof1x 0 ptof1y 0 ptof2x 0 ptof2y 0 ptof3x 0 ptof3y 0 ptof4x 0 ptof4y 0 pterr 0 ptrefset 0 ptmot x40800000 ptref 0}
    {curvegroup Bezier1 512 bezier
     {{cc
       {f 8192}
       {px x42ca0000
        {x42840000 xc3140000}
        {x43faa319 x441d2e74}
        {x436ab9ce xc35ab9d0}
        {xc3660000 xc2100000}
        {x44808000 x43c90000}
        {x43660000 x42100000}
        {xc2400000 xc2dc0000}
        {x44b50000 x44338000}
        {xc2e80000 xc3ca0000}
        {x42d88560 x40d37e40}
        {x4473fdf4 x43662954}
        {xc367f7d0 xc1629540}}}     idem}
     {tx x42ca0000 x447b6000 x43fd8000}
     {a osw x41200000 osf 0 str 1 spx x44800000 spy x44428000 sb 1 ltn x42ca0000 ltm x42ca0000 tt x40800000 a 0}}
    {curvegroup Ellipse2 512 bezier
     {{cc
       {f 8192}
       {px x42ca0000
        {xc251de40 0}
        {x449ee000 x44508000}
        {x4251de40 0}
        {0 xc2f88730}
        {x44aac000 x44846000}
        {0 x42f88730}
        {x4251de40 0}
        {x449ee000 x44a08000}
        {xc251de40 0}
        {0 x42f88730}
        {x44930000 x44846000}
        {0 xc2f88730}}}
      {cc
       {f 8192}
       {p
        {{{x42ca0000 xc251de40}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 x4251de40}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 xc2f88730}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 x42f88730}}}
        {{{x42ca0000 x4251de40}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 xc251de40}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 x42f88730}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 xc2f88730}}}}}}
     {tx x42ca0000 x449ee000 x44846000}
     {a a 0 osw x41200000 osf 0 str 1 spx x44800000 spy x44428000 sb 1 ltn x42ca0000 ltm x42ca0000 tt x40e00000}}
    {curvegroup Ellipse1 512 bezier
     {{cc
       {f 8192}
       {px x42ca0000
        {xc246d290 0}
        {x443a0000 x444c0000}
        {x4246d290 0}
        {0 xc2efb108}
        {x44508000 x44812000}
        {0 x42efb110}
        {x4246d290 0}
        {x443a0000 x449c4000}
        {xc246d290 0}
        {0 x42efb110}
        {x44238000 x44812000}
        {0 xc2efb108}}}
      {cc
       {f 8192}
       {p
        {{{x42ca0000 xc246d290}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 x4246d290}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 xc2efb108}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 x42efb110}}}
        {{{x42ca0000 x4246d290}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 xc246d290}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 x42efb110}}}
        {{{x42ca0000 0}}
      {{x42ca0000 0}}}
        {{{x42ca0000 0}}
      {{x42ca0000 xc2efb108}}}}}}
     {tx x42ca0000 x443a0000 x44812000}
     {a a 0 osw x41200000 osf 0 str 1 spx x44800000 spy x44428000 sb 1 ltn x42ca0000 ltm x42ca0000 tt x40e00000}}}}}}
 toolbox {selectAll {
  { selectAll str 1 ssx 1 ssy 1 sf 1 }
  { createBezier str 1 ssx 1 ssy 1 sf 1 sb 1 tt 4 }
  { createBezierCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { createBSpline str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { createEllipse str 1 ssx 1 ssy 1 sf 1 sb 1 tt 7 }
  { createRectangle str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { createRectangleCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { brush str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { eraser src 2 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { clone src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { reveal src 3 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { dodge src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { burn src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { blur src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { sharpen src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
  { smear src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
} }
 toolbar_brush_hardness 0.200000003
 toolbar_source_transform_scale {1 1}
 toolbar_source_transform_center {1024 778}
 color {1 1 1 0}
 colorOverlay {0 0 0 0}
 lifetime_type "all frames"
 lifetime_start 101
 lifetime_end 101
 motionblur_shutter_offset_type centred
 source_black_outside true
 name Roto1
 selected true
 xpos -284
 ypos 297
}
Premult {
 name Premult1
 selected true
 xpos -284
 ypos 335
}
Project3D2 {
 inputs 2
 project_on front
 occlusion_mode world
 name Project3D3
 selected true
 xpos -284
 ypos 377
}
Camera2 {
 inputs 0
 translate {0 0 2.048000097}
 name Camera3
 selected true
 xpos -342
 ypos 120
}
Text2 {
 inputs 0
 font_size_toolbar 100
 font_width_toolbar 100
 font_height_toolbar 100
 cliptype bbox
 message "Remember to use it sparingly or your node graph will quickly bloated up."
 old_message {{82 101 109 101 109 98 101 114 32 116 111 32 117 115 101 32 105 116 32 115 112 97 114 105 110 103 108 121 32 111 114 32 121 111 117 114 32 110 111 100 101 32 103 114 97 112 104 32 119 105 108 108 32 113 117 105 99 107 108 121 32 98 108 111 97 116 101 100 32 117 112 46}
   }
 box {0 1440 800 1556}
 transforms {{0 2}
   }
 cursor_position 72
 font {{ Arial : Regular : arial.ttf : 0 }}
 scale {1 1}
 cursor_initialised true
 autofit_bbox false
 initial_cursor_position {{0 1556}
   }
 group_animations {{0} imported: 0 selected: items: "root transform/"}
 animation_layers {{1 11 1024 778 0 0 1 1 0 0 0 0}
   }
 color {1 1 1 1}
 color_panelDropped true
 name Text2
 selected true
 xpos -180
 ypos 70
}
Crop {
 box {0 1036 834 1556}
 reformat true
 crop false
 name Crop2
 selected true
 xpos -180
 ypos 96
}
Project3D2 {
 inputs 2
 project_on front
 name Project3D4
 selected true
 xpos -180
 ypos 140
}
Camera2 {
 inputs 0
 translate {-1.460000038 0.09000000358 -0.05499993637}
 rotate {0 -90 0}
 name Camera2
 selected true
 xpos -296
 ypos -53
}
Text2 {
 inputs 0
 font_size_toolbar 100
 font_width_toolbar 100
 font_height_toolbar 100
 cliptype bbox
 message Texture
 old_message {{84 101 120 116 117 114 101}
   }
 box {0 1440 529 1556}
 transforms {{0 2}
   }
 cursor_position 7
 font {{ Arial : Regular : arial.ttf : 0 }}
 scale {1 1}
 cursor_initialised true
 autofit_bbox false
 initial_cursor_position {{0 1556}
   }
 group_animations {{0} imported: 0 selected: items: "root transform/"}
 animation_layers {{1 11 1024 778 0 0 1 1 0 0 0 0}
   }
 color {0.705009 1 0 1}
 color_panelDropped true
 name Text1
 selected true
 xpos -176
 ypos -121
}
Crop {
 box {0 1449 529 1556}
 reformat true
 crop false
 name Crop1
 selected true
 xpos -176
 ypos -73
}
Project3D2 {
 inputs 2
 project_on front
 name Project3D2
 selected true
 xpos -176
 ypos -33
}
push $cut_paste_input
Camera2 {
 translate {0 0.04199999943 3.234999895}
 name Camera1
 selected true
 xpos -127
 ypos -206
}
ColorBars {
 inputs 0
 name ColorBars1
 selected true
 xpos -17
 ypos -298
}
Project3D2 {
 inputs 2
 name Project3D1
 selected true
 xpos -17
 ypos -186
}
MergeMat {
 inputs 2
 name MergeMat1
 selected true
 xpos -17
 ypos -33
}
MergeMat {
 inputs 2
 name MergeMat3
 selected true
 xpos -17
 ypos 140
}
MergeMat {
 inputs 2
 name MergeMat2
 selected true
 xpos -17
 ypos 377
}
Cube {
 name Cube1
 selected true
 xpos -17
 ypos 450
}
Scene {
 name Scene1
 selected true
 xpos -7
 ypos 527
}
push 0
ScanlineRender {
 inputs 3
 conservative_shader_sampling false
 motion_vectors_type distance
 name ScanlineRender1
 selected true
 xpos -17
 ypos 620
}

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.