merging multiple camera projections

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2012
merging multiple camera projections

Hi All,

I'm a long time AE user who has recently started using Nuke for compositing, so to say my head is a little bit melted by the process would be an understatement. However already I can see huge benefits in certain situations where AE projects would get messy.

I'm running in to problems understanding the workflow for merging multiple camera projections on to 3D cards, where the cards are overlapping. At the moment, I have say, 3 different cards piped in to the same scene with some rotopaint work done on them to remove elements.

I have used masks with soft edges to blend the projections on to the original footage (which is a 3d tracked scene). If I want to keep those cards where they are but not have the chatter i'm getting where some of them are directly in the same 3d space, should I be merging one over the other? The reason I didn't want to do this is I would see my script becoming large and a bit cumbersome. It made more sense to me to pipe everything in to one scene and try and figure out how to specify an order to which the cards are rendered from top to bottom.

I'm not sure if this makes sense - it's really a layering thing I'm trying to figure out, specific to 3d cards and projections.

Can anyone help point me in the right direction? Here's a screenie of my script with some labels. (Ignore the missing footage sequences, the drive the project referenced these is turned off!)


Last edited by judderman : 05 May 2012 at 09:56 AM.
 
  05 May 2012
I assume by chatter you mean something like the example below, the two cards are in the same spot, the only difference is that card2 has a blue tint and a 1 degree rotation on it so that one half is in front of and the other half is behind card1.

The chatter is caused by Nuke not knowing what card is in front of the other card. This happens when there is not enough precision in the zbuffer. There are a couple of things you can do to address this.

The first is to adjust your near and far clipping planes on the camera node so they tightly encompass all the objects in your 3d scene taking into account any animation on the camera or objects in the scene. Easiest way to do this is by viewing the scene in 3d using the default camera, you should be able to see the camera frustum change in the 3d view when you adjust the clipping plane values. You can animate the clipping plane values, but keep in mind that doing so changes the depth pass values, which can cause problems if your using the depth pass for other things such as the defocus and atmospheric depth.

Adjusting the clipping planes will fix most of your problems.

The second thing you can do is set the Z-Blend Mode and Z-Blend Range on the scanline renderer. This does a blend between any two objects which are within the same Z-Blend Range. If you have two objects which are intersecting (or really close to each other), instead of trying to figure out which one is in front of the other, this render both objects and blends between them.

I hope that helps.



If you want to have a go with the example I've used, copy/paste the following into Nuke and watch what happens when you change the clipping plane values on the camera from near=0.0001 & far=10000 to near=6 & far=12.


set cut_paste_input [stack 0]
version 6.2 v1
Camera2 {
 inputs 0
 translate {{curve x1 2.743004322 x10 4.357059956} {curve x1 1.942125559 x10 2.609518528} {curve x1 6.725532532 x10 7.896343231}}
 rotate {{curve x1 -12.79999924 x10 -13.59999847} {curve x1 20.80000305 x10 27.00003433} {curve x1 0 x10 0}}
 near 6
 far 12
 name Camera1
 selected true
 xpos 243
 ypos -551
}
CheckerBoard2 {
 inputs 0
 format "640 480 0 0 640 480 1 PC_Video"
 name CheckerBoard1
 selected true
 xpos 1
 ypos -589
}
set Ne482a40 [stack 0]
Card2 {
 scaling {4 1 10}
 control_points {3 3 3 6 

1 {-0.5 -0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0 0 0} 
1 {0 -0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0.5 0 0} 
1 {0.5 -0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {1 0 0} 
1 {-0.5 0 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0 0.5 0} 
1 {0 0 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0.5 0.5 0} 
1 {0.5 0 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {1 0.5 0} 
1 {-0.5 0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0 1 0} 
1 {0 0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0.5 1 0} 
1 {0.5 0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {1 1 0} }
 name Card1
 selected true
 xpos 140
 ypos -566
}
push $Ne482a40
EXPTool {
 mode Stops
 gang false
 red -5.683333397
 blue 4
 name EXPTool1
 selected true
 xpos 1
 ypos -494
}
Card2 {
 rotate {0 1 0}
 scaling {4 1 10}
 control_points {3 3 3 6 

1 {-0.5 -0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0 0 0} 
1 {0 -0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0.5 0 0} 
1 {0.5 -0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {1 0 0} 
1 {-0.5 0 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0 0.5 0} 
1 {0 0 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0.5 0.5 0} 
1 {0.5 0 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {1 0.5 0} 
1 {-0.5 0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0 1 0} 
1 {0 0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0.5 1 0} 
1 {0.5 0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {1 1 0} }
 name Card2
 selected true
 xpos 1
 ypos -431
}
Scene {
 inputs 2
 name Scene1
 selected true
 xpos 150
 ypos -451
}
push $cut_paste_input
Reformat {
 format "640 480 0 0 640 480 1 PC_Video"
 name Reformat1
 selected true
 xpos 421
 ypos -459
}
ScanlineRender {
 inputs 3
 antialiasing low
 zblend_mode smooth
 zblend_range 0.0001
 max_tessellation 1
 output_motion_vectors_type accurate
 name ScanlineRender1
 selected true
 xpos 233
 ypos -356
}
 
  05 May 2012
That's exactly what I mean earlyworm! A couple of my cards are actually occupying the same 3d space - I'll have a play with your suggestions and let you know how I get on

So is it okay to pipe multiple cards like I've been doing in to one scene like and using roto to soften the edges of the projections?

Just now that I'm figuring this out, say if I did want to specify a draw order of cards, would i do that using merge nodes?

Cheers!

Judderman.
 
  05 May 2012
There are plenty of ways you could do this. If you want to put everything onto one card you can use a MergeMat node to merge your Project3D nodes together before you apply them to the card/geometry (see example below). Another option is to output each card to it's own scanline renderer and then mask them that way. You could also set the scanline render projection mode to uv, do your masking on that and then apply it as a texture to your card.



set cut_paste_input [stack 0]
version 6.2 v1
Camera2 {
 inputs 0
 translate {-0.2243778408 0.08455203474 4.730125904}
 rotate {-1.400013328 -1.799991131 0}
 name Camera3
 selected true
 xpos 137
 ypos -262
}
Camera2 {
 inputs 0
 translate {2.317708731 1.441658735 5.613634109}
 rotate {-12.6000042 24.00000191 0}
 name Camera1
 selected true
 xpos -309
 ypos -334
}
Roto {
 inputs 0
 output alpha
 format "640 480 0 0 640 480 1 PC_Video"
 curves {AnimTree: "" {
 Version: 1.2
 Flag: 0
 RootNode: 1
 Node: {
  NodeName: "Root" {
   Flag: 512
   NodeType: 1
   Transform: 0 0 S 0 0 S 0 0 S 0 0 S 0 1 S 0 1 S 0 0 S 0 1024 S 0 778 
   NumOfAttributes: 10
   "vis" S 0 1 "opc" S 0 1 "mbo" S 0 1 "mb" S 0 1 "mbs" S 0 0.5 "fo" S 0 1 "fx" S 0 0 "fy" S 0 0 "ff" S 0 1 "ft" S 0 0 
  }
  NumOfChildren: 1
  Node: {
   NodeName: "BSpline1" {
	Flag: 512
	NodeType: 3
	CurveGroup: "" {
	 Transform: 0 0 S 1 1 0 S 1 1 0 S 1 1 0 S 1 1 1 S 1 1 1 S 1 1 0 S 1 1 275.778 S 1 1 262.222 
	 Flag: 0
	 NumOfCubicCurves: 2
	 CubicCurve: "" {
	  Type: 2 Flag: 8192 Dim: 2
	  NumOfPoints: 9
	  0 S 1 1 303 S 1 1 256 2 "t" S 1 1 0.968 "rp" S 1 1 1 0 S 1 1 288 S 1 1 218 2 "t" S 1 1 0.996 "rp" S 1 1 1 0 S 1 1 264 S 1 1 181 2 "t" S 1 1 1.056 "rp" S 1 1 1 0 S 1 1 330 S 1 1 146 2 "t" S 1 1 1.024 "rp" S 1 1 1 0 S 1 1 360 S 1 1 163 2 "t" S 1 1 1.008 "rp" S 1 1 1 0 S 1 1 371 S 1 1 204 2 "t" S 1 1 1 "rp" S 1 1 1 0 S 1 1 372 S 1 1 246 2 "t" S 1 1 1.004 "rp" S 1 1 1 0 S 1 1 366 S 1 1 288 2 "t" S 1 1 0.976 "rp" S 1 1 1 0 S 1 1 325 S 1 1 292 2 "t" S 1 1 0.976 "rp" S 1 1 1 
	 }
	 CubicCurve: "" {
	  Type: 2 Flag: 8192 Dim: 2
	  NumOfPoints: 9
	  0 S 1 1 0 S 1 1 0 2 "t" S 1 1 0.968 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 0.996 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 1.056 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 1.024 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 1.008 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 1 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 1.004 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 0.976 "rp" S 1 1 1 0 S 1 1 0 S 1 1 0 2 "t" S 1 1 0.976 "rp" S 1 1 1 
	 }
	 NumOfAttributes: 43
	 "vis" S 0 1 "r" S 0 1 "g" S 0 1 "b" S 0 1 "a" S 0 1 "ro" S 0 0 "go" S 0 0 "bo" S 0 0 "ao" S 0 0 "opc" S 0 1 "bm" S 0 0 "inv" S 0 1 "mbo" S 0 0 "mb" S 0 1 "mbs" S 0 0.5 "mbsot" S 0 0 "mbso" S 0 0 "fo" S 0 1 "fx" S 0 21.5 "fy" S 0 21.5 "ff" S 0 2.2 "ft" S 0 1 "src" S 0 0 "stx" S 0 0 "sty" S 0 0 "str" S 0 0 "sr" S 0 0 "ssx" S 0 1 "ssy" S 0 1 "ss" S 0 0 "spx" S 0 1024 "spy" S 0 778 "stot" S 0 0 "sto" S 0 0 "sv" S 0 0 "sf" S 0 1 "sb" S 0 1 "nv" S 0 1 "view1" S 0 1 "ltn" S 0 1 "ltm" S 0 1 "ltt" S 0 0 "tt" S 0 5 
	}
   }
   NumOfChildren: 0
  }
 }
}
}
 toolbox {selectAll {
  { selectAll ssx 1 ssy 1 sf 1 }
  { createBezier ssx 1 ssy 1 sf 1 sb 1 tt 4 }
  { createBSpline ssx 1 ssy 1 sf 1 sb 1 tt 5 }
  { createEllipse ssx 1 ssy 1 sf 1 sb 1 }
  { createRectangle ssx 1 ssy 1 sf 1 sb 1 }
  { brush ssx 1 ssy 1 sf 1 sb 1 }
  { eraser src 2 ssx 1 ssy 1 sf 1 sb 1 }
  { clone src 1 ssx 1 ssy 1 sf 1 sb 1 }
  { reveal src 3 ssx 1 ssy 1 sf 1 sb 1 }
  { dodge src 1 ssx 1 ssy 1 sf 1 sb 1 }
  { burn src 1 ssx 1 ssy 1 sf 1 sb 1 }
  { blur src 1 ssx 1 ssy 1 sf 1 sb 1 }
  { sharpen src 1 ssx 1 ssy 1 sf 1 sb 1 }
  { smear src 1 ssx 1 ssy 1 sf 1 sb 1 }
} }
 toolbar_brush_hardness 0.200000003
 toolbar_lifetime_type all
 toolbar_source_transform_scale {1 1}
 toolbar_source_transform_center {320 240}
 colorOverlay 0
 lifetime_type "all frames"
 view {}
 motionblur_on true
 motionblur_shutter_offset_type centred
 inverted true
 source_black_outside true
 name Roto1
 selected true
 xpos -86
 ypos -487
}
CheckerBoard2 {
 inputs 0
 format "640 480 0 0 640 480 1 PC_Video"
 name CheckerBoard1
 selected true
 xpos -201
 ypos -510
}
Copy {
 inputs 2
 from0 rgba.alpha
 to0 rgba.alpha
 name Copy1
 selected true
 xpos -201
 ypos -417
}
Premult {
 name Premult1
 selected true
 xpos -201
 ypos -379
}
Project3D {
 inputs 2
 name Project3D1
 selected true
 xpos -201
 ypos -314
}
Camera2 {
 inputs 0
 translate {-2.475984097 1.85165453 5.97120285}
 rotate {-15.00001431 -20.79999924 0}
 name Camera2
 selected true
 xpos -73
 ypos -344
}
CheckerBoard2 {
 inputs 0
 format "640 480 0 0 640 480 1 PC_Video"
 name CheckerBoard2
 selected true
 xpos 28
 ypos -465
}
EXPTool {
 mode Stops
 gang false
 red -5.683333127
 blue 5.683333127
 name EXPTool1
 selected true
 xpos 28
 ypos -393
}
Project3D {
 inputs 2
 name Project3D2
 selected true
 xpos 28
 ypos -324
}
MergeMat {
 inputs 2
 name MergeMat1
 selected true
 xpos -121
 ypos -208
}
Card2 {
 control_points {3 3 3 6 

1 {-0.5 -0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0 0 0} 
1 {0 -0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0.5 0 0} 
1 {0.5 -0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {1 0 0} 
1 {-0.5 0 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0 0.5 0} 
1 {0 0 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0.5 0.5 0} 
1 {0.5 0 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {1 0.5 0} 
1 {-0.5 0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0 1 0} 
1 {0 0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0.5 1 0} 
1 {0.5 0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {1 1 0} }
 name Card1
 selected true
 xpos -46
 ypos -134
}
push $cut_paste_input
Reformat {
 format "640 480 0 0 640 480 1 PC_Video"
 name Reformat1
 selected true
 xpos 259
 ypos -251
}
ScanlineRender {
 inputs 3
 output_motion_vectors_type accurate
 name ScanlineRender1
 selected true
 xpos 127
 ypos -134
}
 
  05 May 2012
Thanks so much! Very helpful

Regards,

Judderman.
 
  06 June 2012
Hi Earlyworm,

I have another question for you...all of what you've written so far makes sense. I've ran in to trouble when trying to combine more than 2 projections...mergemat only seems to be able to combine 2 - what's the flow look like if you want to combine >2 projections? Would it be multiple mergemats connected together or is there another way of doing it?

Cheers!

Cahal
 
  06 June 2012
Yep, multiple MergeMat's.
 
  06 June 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:26 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.