Jump to content


Photo

Position And Normal Relighting Macro


  • Please log in to reply
11 replies to this topic

#1 Nebukadhezer

Nebukadhezer

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 76 posts

Posted 02 November 2010 - 07:17 AM

Hi,

another macro we are using often. It is a normal falloff and usable for either normal or position passes.
I think there was or is a tool in after effects, I always liked the idea to click on the normal pass and this indicates the lighting direction...
Hope it helps.

Johannes

Attached Files


  • inuit likes this

#2 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 02 November 2010 - 12:49 PM

Nice idea!

I would mention that one should feed an image with normals in RGB channels to the macro's input.

"Light Size" works more like "Light Decay" or "Diffuse Light".

#3 Nebukadhezer

Nebukadhezer

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 76 posts

Posted 02 November 2010 - 01:42 PM

thanks gringo!
forgot to mention that, we are having all passes in rgba...
so:
Both passes have to be in the rgb channels and not in the additional slots!

I'll put it on vfx pedia.

johannes

#4 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 02 November 2010 - 03:58 PM

Hi Johannes, great macro! I'm not sure about the edge handling... if the normal pass is already premultiplied, I think r1, g1 and b1 need to be unpremultiplied first. In your screenshots, the position pass seems to be alright, though.

I don't know īthat much about the 3D side of this, but from experience it was always easier for the 3D dept. to render auxilliary passes that were anti-aliased and premultiplied (Mentalray, VRay...). Does Arnold spit out the position pass unpremultiplied?






#5 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 02 November 2010 - 04:09 PM

Wha? A premultiplied normal pass? First off, the normals should be, well, normalized. So the vector length should be 1. It's not about unpremultiplication, it's about normalization. And yeah, they shouldn't be premultiplied either. :)

#6 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 02 November 2010 - 04:18 PM

Well, yes, it shouldn't.

But apparently it's easier for the 3D departments I worked with to give every pass the same anti-aliasing/motion-blurring treatment that the beauty pass gets. It ends up anti-aliased...

The point you make about normalization sounds interesting. I'll check my passes tomorrow to see what I've been working with :-)



#7 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 02 November 2010 - 05:13 PM

Yeah, normal passes should be normalized (and if they aren't then you need to do that for those bums).

Motion blurred normal passes? Ickytastic... I can see LOTS of things going wrong there.

#8 Nebukadhezer

Nebukadhezer

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 76 posts

Posted 03 November 2010 - 03:55 AM

Hey Chad and Tilt,

well, the passes I get are not premultiplied by alpha. I am not sure to put that into the macro, hmm I think thats something people are capable of doing themselves ? unpremultiplying ? before?
But I will add it into the comments field.

@Chad I thought I was doing that with the whole min max formula ? But maybe I am wrong..
so all values get squashed between 0 and 1 ?
I am not a really into mathematics, I tend to copy and paste a lot and just try out...

we have rendered motion blur here and of course it breaks all passes, but we still use them... but the mattes need to be touched a lot (expanded eroded etc...)



Thanks for the input.

Johannes

#9 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 03 November 2010 - 04:23 AM

So what would be the solution? Don't render motion blur?

Normalizing the vectors would be done by dividing r,g and b by the vector's length.

#10 Nebukadhezer

Nebukadhezer

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 76 posts

Posted 03 November 2010 - 05:08 AM

So what would be the solution? Don't render motion blur?

Normalizing the vectors would be done by dividing r,g and b by the vector's length.



Hey thanks I will look into that later today :-)

I think rendered motion blur is better then 2d vector blur (which has a lot of issues too). We are on a stereoproject so 2d motionblur was not an option, although I think now it might have been possible with some research, but I am not capable of programming and we dont have someone to develop plugins here...

cheers
johannes

#11 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 03 November 2010 - 08:22 AM

From my experience, a non-problematic way is to have every 3D pass sampled and motionblurred the same way, even normals and zdepth. Unpremultiply them and you can work with them quite well. If normals are not motionblurred while the passes are, how can you use them to relight stuff?

#12 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 03 November 2010 - 08:25 AM


So what would be the solution? Don't render motion blur?

Normalizing the vectors would be done by dividing r,g and b by the vector's length.



Hey thanks I will look into that later today :-)


http://www.anatomica...cl-unit-vector/

As to not working with motion blur? No, you have to supersample temporally. For normal/position/etc, that's not an issue as the renders are silly fast. Then you combine the supersampled passes together using weighting from the shutter timing. If you see the samples (and can't afford to do more) you can try using a retime on them. But really, they're going to be silly fast renders.

- Chad




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users