CGTalk > Techniques > Compositing and Editing
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-18-2013, 06:22 PM   #1
mike_gauer
Ponderer
Mike Gauer
Canada
 
Join Date: Feb 2005
Posts: 52
Animated Z-Depth Focal Point

Hello all,

I've been searching all morning and haven't found a suitable solution for what should be a very simple problem to fix.

What I'd like, is for a render pass (or separate render completely), to provide a Z-Depth based on the camera target. I understand that Z-Depth is designed to be a linear flow from white to black, but what I'd like to do is have the focal object be the white or black extreme, and have the grayscale fall away based on distance from that object. I found a article where someone accomplished this in Maya ( http://www.djx.com.au/blog/2007/12/11/depth-of-field-pass-for-maya-or-mentalray/ ) using stock tools.

I'm using MAX 2013, and have a several thousand frame render coming up where the camera target is animating as well as the camera position, and ideally, I'd like to plunk that in After Effects to run the blur in post without also having to reanimate the focal point in post.

Is there anyone who knows how to recreate what that artist did for Maya in the link above? Also (and yes I know this is asking a lot), if it's possible to do this with stock MAX tools and shaders, as this will be a distributed backburner render.

Any help would be appreciated! Thanks in advance
 
Old 03-22-2013, 06:51 AM   #2
Funky Koval
______________
 
Funky Koval's Avatar
Funky Koval
Singapore, Singapore
 
Join Date: Nov 2005
Posts: 98
Render out a regular Z-Depth pass, import it into After Effects, apply Colorama to it, use Lightness as input phase, load the Ramp Gray preset, untick Modify Alpha and add keys on the wheel to specify the focus/focal distance. Depending on how you're blurring, you may need to pre-compose the layer.
 
Old 03-22-2013, 11:25 AM   #3
simply
PRO
 
Join Date: Aug 2002
Posts: 74
Nice! Funky Koval. Thanks
But i got some white edge issue along my foreground objects when i tried ur method. Any ideas how to avoid that?

Sorry Mike, dun mind me asking question in ur thread.
 
Old 04-06-2013, 05:33 PM   #4
mike_gauer
Ponderer
Mike Gauer
Canada
 
Join Date: Feb 2005
Posts: 52
Thanks for the replies, (sorry for my delayed reponse, I didn't get the notification I subscribed for).

I had the same edge issue as Simply. Also what I truly want is for the Zdepth to render in Max based on the camera target, and have it auto-update as my animation progresses.

So for example, if my target is 500 units from the camera at frame 0, and 1000 units from the camera at frame 100, the render would show the distance of the target as maximum white, and have the gradient fall to black from there and animate as the distance grows. So at 1000 units of distance, 1000 would be white, 2000 would be black and 0 would black. But at 500 units of target distance, 500=white 1000=black, 0=black. Am I explaining that right?

That way in AE, all I have to do is set the blur maximum value to black, and minimum value to white, and at worst, manually key in aperature if the target is super close or super far. But I have a 14800 frame render with a very dynamic camera, and I'd hate to have to re-animate the whole thing in AE.
 
Old 04-07-2013, 08:34 AM   #5
simply
PRO
 
Join Date: Aug 2002
Posts: 74
hi mike,
i think u could try applying a fully self illum shader, with a falloff map in the diffuse to everything in ur scene.

Set the type to distance blend, direction to object. Then create a dummy and pick that dummy in the falloff map as the object. Finally link the dummy to ur already animated camera target.

So when u render now, the dummy (camera target) position will be white and falloff to black in other objects u have in ur scene.

Hope it helps ur problem.

I still hope Funky Koval can help answer the edge issue problem i faced.
 
Old 04-07-2013, 11:28 PM   #6
mike_gauer
Ponderer
Mike Gauer
Canada
 
Join Date: Feb 2005
Posts: 52
Simply, I think you're the man.

Preliminary tests show that this will be very possible. I think I'll have to find a happy medium for near\far distances since my target ranges from 100 units to 700 units. Fast render times too. On frames that take 5-10 minutes, the ZDepth is completed in 6 seconds. I'll know in a bit if there will be the edge issue.
 
Old 04-13-2013, 07:54 PM   #7
mike_gauer
Ponderer
Mike Gauer
Canada
 
Join Date: Feb 2005
Posts: 52
Falloff Issue

I've discovered an issue that took me quite some time to isolate. I haven't found a fix for it yet.

The falloff map doesn't appear to be updating with each frame, it calculates on the first frame, and then leaves the material settings for the remainder of the render. This means that the camera flies past the 'in-focus' point and the rest of the render is black, unless the camera happens to catch the first frame's location in view in the distance. I have found a couple people having this same issue, but I haven't found a solution to it yet.


UPDATE: Okay, so I've found a less-than-ideal, but satisfying solution. It's not fully proven yet through the full 14800 frame project, but I did run a couple tests. The falloff map is most conveniently done in the render setup Global Material Override in Mental Ray.

Mental Ray does not (as far as I can find out) update the falloff coordinates each frame, however Scanline does. The problem with Scanline is that it doesn't have a material override option. So if anyone is reading this and has a several thousand object scene with hundreds of materials, save a copy of the scene under a new name, and then in that scene assign the falloff map to every object. Run the same render again under the scanline renderer, and the falloff map does update every frame. In my test scene, the update calculation was instantaneous, but in my big project, it was about 2-3 seconds per frame.

Hope this helps someone

Last edited by mike_gauer : 04-13-2013 at 08:32 PM.
 
Old 04-13-2013, 07:54 PM   #8
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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 10:03 AM.


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