VFXTalk.com Register | Blogs | Wiki | Facilities | RSS  
Home Forums The Pad News Gallery Reels Jobs Talent Members List Social Groups Search Today's Posts Mark Forums Read

Get your copy of Taskwise Today!
Use the form below to log on to your account. Dont have a account? Sign Up Now! its free and easy and you will be a part of the largest VFX Commnity on the Planet!


Go Back   VFXTalk.com > Visual Effects Packages > NUKE from The Foundry
Reload this Page How do you premult with white?

Reply
 
Thread Tools Display Modes
How do you premult with white?
Old
  (#1)
theta is Offline
▌▌▌
 
theta's Avatar
 
Posts: 397
Join Date: Feb 2005
  Send a message via AIM to theta  
How do you premult with white? - February 4th, 2009, 09:52 AM

I got a .tga sequence with alpha, rendered on a white background. When I premult it, I get a really bad white border around the edges, so I'm just trying to figure out how to premult the image sequence using the alpha, but with white.

Thanks
VFXTalk VIP   
Reply With Quote
VFXTalk Sponsored Links
Old
  (#2)
beaker is Online
Certified User
 
beaker's Avatar
 
Posts: 963
Blog Entries: 1
Join Date: Apr 2003
 Send a message via ICQ to beaker Send a message via AIM to beaker Send a message via Yahoo to beaker  
February 4th, 2009, 02:51 PM

This should solve it. Just change the constant to whatever color the BG is. For now on tell your 3d and photoshop guys that they should always make the BG black.


set cut_paste_input [stack 0]
version 5.1200
push $cut_paste_input
Dot {
name Dot1
selected true
xpos 345
ypos -141
}
set N28375e50 [stack 0]
Dot {
name Dot2
selected true
xpos 479
ypos -141
}
push $N28375e50
push $N28375e50
Invert {
channels rgba
name Invert1
selected true
xpos 227
ypos -145
}
Constant {
inputs 0
channels rgb
color {1 0 0 0}
name BG_COLOR
selected true
xpos 168
ypos -238
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy1
selected true
xpos 168
ypos -108
}
Premult {
name Premult2
selected true
xpos 168
ypos -69
}
Merge2 {
inputs 2
operation minus
name Merge1
selected true
xpos 311
ypos -69
}
Dot {
name Dot3
selected true
xpos 345
ypos -6
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy2
selected true
xpos 445
ypos -16
}
Dot {
name Dot4
selected true
xpos 479
ypos 57
}
  
Reply With Quote
Old
  (#3)
theta is Offline
▌▌▌
 
theta's Avatar
 
Posts: 397
Join Date: Feb 2005
  Send a message via AIM to theta  
February 4th, 2009, 03:14 PM

Hey thanks Beaker, that worked really well. It's one button in After Effects, but I never understood the process behind it. Thanks again.
VFXTalk VIP   
Reply With Quote
Old
  (#4)
beaker is Online
Certified User
 
beaker's Avatar
 
Posts: 963
Blog Entries: 1
Join Date: Apr 2003
 Send a message via ICQ to beaker Send a message via AIM to beaker Send a message via Yahoo to beaker  
February 4th, 2009, 03:15 PM

I'm making it a gizmo and going to post it on highend3d
  
Reply With Quote
Old
  (#5)
kakubei is Offline
Certified User
 
Posts: 22
Join Date: Sep 2009
   
September 3rd, 2009, 09:49 AM

Hello, I'm new to Nuke, coming over from Shake and am very much interested in this solution. Could you explain how the magic works?

I have a bunch or renders that HAVE to have white backgrounds because of Final Gather render in Maya and need to avoid the white edges at comp time.

Thanks a lot.

PS
I also noticed a couple of things:

1. if you do any color correction to the image you will get some nasty outlines
2. how do you comp it? I've attached a Merge (Over) node to the last node you have (Copy2) but the background is not showing, even thought the alpha looks ok.

Last edited by kakubei; September 3rd, 2009 at 10:08 AM.
  
Reply With Quote
Old
  (#6)
forkazoo is Offline
Professional Bum
 
forkazoo's Avatar
 
Posts: 337
Join Date: Oct 2007
Location: Denver, Boston, Heading to LA
  Send a message via AIM to forkazoo Send a message via Skype™ to forkazoo 
September 3rd, 2009, 01:35 PM

It's not very magic. If you look at the provided node tree, and go through it step by step it should be pretty clear.

It takes the background color with the opposite of the image's alpha, and does a premult. This leaves the image with the background color wherever the original image was transparent. Black where the original image was opaque.

Then, it subtracts the matted background from the original image.

I'm not exactly sure why you feel you HAVE to have white backgrounds coming out of Maya. I'm not hyper experienced with Final Gather, but if you uncheck "primary visibility" for an object, it can still cast light for Final Gather, but you can render your main object against the standard black background.

1 - Read up on color correction and premultiplication. No real magic there, either. It's the same in any app.
2 - I didn't have any problem just using an ordinary merge/Over. Not sure what issue you were having.
  
Reply With Quote
Old
  (#7)
kakubei is Offline
Certified User
 
Posts: 22
Join Date: Sep 2009
   
September 4th, 2009, 08:29 AM

Thanks for the reply forkazoo,

Yes, I can read the nodes, but I was hoping for an explanation of why it worked, which you seemed to have offered. I know about premult but wasn't sure the best way to tackle this problem.

Regarding white on Final Gather and Maya:

1. Read up on Final Gather and how the background color of your camera (or anything in the scene) affects it. I have to have a white background for the camera so that I get the effect I want with Final Gather, the downside of course is the white background.

Anything else I might use in the scene to have that effect will not work if I turn off primary visibility.
  
Reply With Quote
Old
  (#8)
Diogo Girondi is Online
Radioactive Monkey
 
Diogo Girondi's Avatar
 
Posts: 1,140
Join Date: Sep 2004
Location: São Paulo - Brazil
  Send a message via Skype™ to Diogo Girondi 
September 4th, 2009, 01:17 PM

Read up on Final Gathering and you will see that you can hide that background in the final render while still getting the FG solution


dg | ••• | imdb
VFXTalk VIP   
Reply With Quote
Old
  (#9)
kakubei is Offline
Certified User
 
Posts: 22
Join Date: Sep 2009
   
September 5th, 2009, 03:54 AM

Quote:
Originally Posted by Diogo Girondi View Post
Read up on Final Gathering and you will see that you can hide that background in the final render while still getting the FG solution
He, he, you got me there.

But honestly, I've tried every which way to get rid of the white background of the camera environment and have not found a way which still lets Final Gather read the colour and act upon it. So I'm open to suggestions.
  
Reply With Quote
Old
  (#10)
Diogo Girondi is Online
Radioactive Monkey
 
Diogo Girondi's Avatar
 
Posts: 1,140
Join Date: Sep 2004
Location: São Paulo - Brazil
  Send a message via Skype™ to Diogo Girondi 
September 5th, 2009, 07:05 AM

I don't know in Maya but if you're using the environment stack with a environment shader you should have a option in there to set the background intensity. But you can also set that by using the nodes of the shader tree and visibility settings of a object.


dg | ••• | imdb
VFXTalk VIP   
Reply With Quote
Old
  (#11)
kakubei is Offline
Certified User
 
Posts: 22
Join Date: Sep 2009
   
September 5th, 2009, 07:25 AM

No, what I've found that works best is setting the Camera Environment (which just means the camera background color) to white. There is no separate control for the visibility of this attribute (like you find in objects under the Render attributes), so turning this off negates the FG benefit, turning it on will give you a white background. It's not a shader...
  
Reply With Quote
Old
  (#12)
Diogo Girondi is Online
Radioactive Monkey
 
Diogo Girondi's Avatar
 
Posts: 1,140
Join Date: Sep 2004
Location: São Paulo - Brazil
  Send a message via Skype™ to Diogo Girondi 
September 5th, 2009, 07:50 AM

Why not use a constant connected to to your environment shader set in a pass?


dg | ••• | imdb
VFXTalk VIP   
Reply With Quote
Old
  (#13)
kakubei is Offline
Certified User
 
Posts: 22
Join Date: Sep 2009
   
September 7th, 2009, 09:04 AM

Not sure I understand you. I can't find anything like a constant in HyperShade, but have to admit I'm not great with textures.

Maybe we're talking about 2 different things, I'm not using and environment shader at all, just the camera environment attribute (see attached picture).

  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
is premult necessary after channel merge/shuffle copy? vfxter112 NUKE from The Foundry 3 January 15th, 2009 05:12 AM
White alexl Gallery 3 November 30th, 2008 07:18 AM
Anonymous Shows Devotion for Shaun White Snowboarding CGnews Industry News 0 November 18th, 2008 07:23 AM
My video's show up white Redsandro Photoshop 2 October 24th, 2008 02:34 PM
All of my scenes turned white! vundergeist Maya 6 August 26th, 2008 06:10 PM


Get yo
ur copy Today!

Copyright © VFXTalk.com, 2009