Jump to content

Trouble with Position Pass (Post Effect)

Recommended Posts

Hello all!


Trying to up my compositing game and followed Chad from Greyscale Gorilla's otherwise excellent tutorial for getting proper motion and vector blur in an AE composite. https://greyscalegorilla.com/tutorials/your-depth-pass-is-wrong/


For non-artifacting edges (glowing/flaring) in a depth blur, the tutorial suggests using a non-anti-aliased depth pass, but rather than rendering this as a separate pass, the suggestion is to render a PostEffect/Position pass and extract the blue/Z channel from it to generate a non-anti-aliased depth pass, since the Position pass won't pick up whatever you have setup in your anti-aliasing-settings. 


I've set up a test scene to mimic Chad's file though my Position pass looks nothing like it ought to. Rather than resembling a depth pass, like it should, what I'm getting instead are some large color fields for each frame (see attached .exr file).


Trouble-shooting options I've tried thus far:

  • I assumed it might have to do with Position Pass's scale setting, though I tried some incrementations from a scale of 0.1 to a scale of 100, and none of those made any difference.
  • I also tried switching between Standard and Physical renderer though that made no difference
  • Finally, I gave a few of the OpenEXR file output options a try though this also made no difference. The setting suggested by the tutorial is "Lossy, 16 bit float, zip, in blocks of 16 scan lines".


I'm a bit stumped, I don't believe there's anything obstructing the camera, but there must be some setting somewhere that I've missed. I should add that I'm somewhat new to working with OpenEXR files. Hoping someone can point me in the right direction. I'm attaching a my C4D file as well as single frame from the Position Pass.


Many thanks!!







Share this post

Link to post
Share on other sites

Try a far smaller Position Pass scale i.e. 0.001 or 0.0001. As the scale gets smaller, it will look like it's gone to 0 in the dialog box, but it keeps the number.


You still have to experiment to get exactly what you need, ensuring your camera depth is as you want it first of course.

Render a test frame at 0.001 and you'll see a result you're expecting.


Chads example was scaled very differently from yours and not as much depth, mimicking a macro lens shot, and I assume that is why there is a big difference. Your scene scale is quite large in comparison.

  • Like 1

Share this post

Link to post
Share on other sites
  • Topic Author
  • @ABMotion - I really appreciate your reply and thanks for the tip!

    Cranking the scale setting way down did the trick.


    From MAXON's documentation:



    Scale [0..+∞]

    Use this setting to define the scaling for the coding.

    • A value of 1 represents a distance of 1cm in the Project in the Position Pass channel.
    • A value of 0.1 represents a distance of 1mm in the Project in the Position Pass channel.


    It's not obvious to me how this works - seems counter-intuitive to me that a scene who's dimensions are small (like Chad's coffee-bean scene) would warrant a larger scale setting, though I'd guess it's like this:  In the case of using the Camera Space setting, I'd suppose that the luminance value of each pixel is rendered based on distance from the camera's node point. I guess the Scale value multiplies the distance span, yielding a more visible gradient by compressing the span of the gradient into a smaller distance, so smaller number would yield an apparent shorter span.


    Or is the opposite true? Does the smaller number spread the distance of the gradient outward rather than inward? 


    Also, a hypothetical question: is this Scale setting an absolute setting, or is it relative to the scene's units scale?


    Just thinking out loud here, so don't feel obligated to respond unless you feel like it.

    In any event, thank you again!






    Share this post

    Link to post
    Share on other sites

    If you listen to Chad in that tutorial, he says you need to experiment and does not explain how he derived it. I think it's the combination of the maths of everything you have referred to. So it's scene scale, camera focal length/depth and lens distance to objects and then object size. So I think you're right in that the scale needs to be smaller for a larger scale scene as the position pass is a fixed distance if that makes sense. So it needs to scale down the actual scene to match the final Position Pass scale. That's my interpretation anyway.


    In the settings you used for the Position Pass, the type is set to Camera, so the calculation is made using the camera’s coordinate system outwards.


    With things like this, my mind sounds like it works like yours does, in that I like to understand why things work like they do, but in this case, I think it's too much to calculate the maths and how it works for the number of times you'll need to do it. Originally, I think you experimented the way I did in this case, you just didn't go far enough the other way and stopped at .1


    It doesn't happen often, but in situations where it doesn't make sense like this, I push the envelope with the maths in large jumps until I get close to what I'm expecting and go from there.


    Not a nice mathematical/logical response to you, but an honest one.

    Share this post

    Link to post
    Share on other sites
  • Topic Author
  • Just found my way back here as this particular came up in my workflow and realized I never responded to you, so sending apologies for absent-mindedness which I hope didn't come off as rudeness. In any event looking at your words above and nodding in agreement - many thanks for helping me make more sense of this obscure but useful product feature!




    Share this post

    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    • Recently Browsing   0 members

      No registered users viewing this page.



    C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :)
    • Create New...