sprockets Learn to keyframe animate chains of bones. Gerald's 2024 Advent Calendar! The Snowman is coming! Realistic head model by Dan Skelton Vintage character and mo-cap animation by Joe Williamsen Character animation exercise by Steve Shelton an Animated Puppet Parody by Mark R. Largent Sprite Explosion Effect with PRJ included from johnL3D
sprockets
Recent Posts | Unread Content
Jump to content
Hash, Inc. - Animation:Master

Recommended Posts

Posted

i wanted to use the null shader to render a depth map for adding DOF in post. the problem is that the null shader does not do what it´s supposed to... the null shader should overwrite all decals and materials, right? the only thing it does for me is rendering everything a lot darker.

i was able to render a good usable depth map by removing all the materials and decals, disable all lights and placing a material effector with a gradient from white to black in the focus area. this way it´s pretty easy to animate the focus... for testrenders it was ok to make an extra version of the project and remove all decals and materials manually from the few models... but if i imagine a complex scene with a lot of models this will be a bit of work, and i will have to do everything again, when i might have to change anything later.

 

i´ve tried it in v15 and latest (at least i think so ;) ) v16 on a mac. and yes, i enabled plugin-shaders >> diffuse render shaders >> null shader in the render dialogue.

 

it would be really great if i could get it to work properly.

 

thanks for your help....

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

Posted
i wanted to use the null shader to render a depth map for adding DOF in post. the problem is that the null shader does not do what it´s supposed to... the null shader should overwrite all decals and materials, right? the only thing it does for me is rendering everything a lot darker.

i was able to render a good usable depth map by removing all the materials and decals, disable all lights and placing a material effector with a gradient from white to black in the focus area. this way it´s pretty easy to animate the focus... for testrenders it was ok to make an extra version of the project and remove all decals and materials manually from the few models... but if i imagine a complex scene with a lot of models this will be a bit of work, and i will have to do everything again, when i might have to change anything later.

 

i´ve tried it in v15 and latest (at least i think so ;) ) v16 on a mac. and yes, i enabled plugin-shaders >> diffuse render shaders >> null shader in the render dialogue.

 

it would be really great if i could get it to work properly.

 

thanks for your help....

 

Did you try in 16beta5: set the render in output/buffers/depth=ON, save buffers =ON. You can render to png and have 2 separate files generated (color and depth), or you can render to Openexr format and all the buffers will be in 1 file.

Posted

yes, i tried... the problem here is that those depth maps are just partially correct, for example the character in my test has a white top, this still appears white, while the rest of the character is grey (it´s positioned in the middle of the scene)... and the biggest problem is that in those depth buffer renders the focus is always in the front (or back, depends on how you will use it later in post), but the material effector, which enables me to position my focus where ever i want doesn´t display in those depth buffers... it makes sense somehow, since the null shader overwrites all the materials, so i guess it overwrites the material effector, too. but i know mark (mtpeak) got it to work on his landscape scene, so there must be a way, which i just can´t see right now :huh:

Posted

I don`t know much about all this, but doesn`t the FakeAO render instead of the nullshader give you a depthmap as well?

 

So couldn`t you use a FakeAO only render to use its in post for your purpose?

 

What I do to activate the nullshader easily in each model is make a group with just the nullshader and put it on top of all materials groups,

thus overwriting all the others, to deactivate again I just drag these group on first place in the group branch.

The decals you can deactivate easily with the decalbottom. This way it won`t be that much work to get the nullshader going.

Posted
I don`t know much about all this, but doesn`t the FakeAO render instead of the nullshader give you a depthmap as well?

 

So couldn`t you use a FakeAO only render to use its in post for your purpose?

 

What I do to activate the nullshader easily in each model is make a group with just the nullshader and put it on top of all materials,

thus overwriting all the others, to deactivate again I just drag these group on first place in the group branch.

The decals you can deactivate easily with the decalbottom. This way it won`t be that much work to get the nullshader going.

 

i´ll have to try that goup thing, i´ve tried to set the null shader for the whole model before, that didn´t have any affect...

 

i´m a mac-user, so unfortunately fakeAO isn´t available for me yet (or is it??)...

  • Hash Fellow
Posted
yes, i tried... the problem here is that those depth maps are just partially correct, for example the character in my test has a white top, this still appears white, while the rest of the character is grey (it´s positioned in the middle of the scene)

 

Can you post that depth map?

Posted

the first one "depthtestnew-DepthBuffer0.jpg" is the png i rendered out like nancy suggested, with the top still white and with the material effector overwritten...

 

the second one "depthtest_materialeffector.jpg" is the one i rendered out by removing all materials and decals manually with the materialeffector working, and with the result i want to achieve...

 

ignore the leaves of the tree, i added them later to that model, so it has nothing to do with the shader or something ;)

depthtestnew_DepthBuffer0.jpg

depthtest_materialeffector.jpg

  • Hash Fellow
Posted
the first one "depthtestnew-DepthBuffer0.jpg" is the png i rendered out like nancy suggested, with the top still white and with the material effector overwritten...

 

that's very odd that the depth buffer is affected by a shader. It should be registering just distance from camera to surface.

 

But that's with the null shader on?

 

You don't need the null shader any more when what you want is a depth buffer and A:M can make depth buffers.

Posted

yes, but how would i animate the focus then? that´s why i thought the thing with the material effector would be a cool thing to be really flexible... this way i could animate the near/far focus and the focal point very easily...

 

or does the depth buffer react to the DOF setting of the camera??? i´ll have to try that...

 

and yes, that rendering was with the null shader on....

  • Hash Fellow
Posted
yes, but how would i animate the focus then? that´s why i thought the thing with the material effector would be a cool thing to be really flexible... this way i could animate the near/far focus and the focal point very easily...

 

Ah. An actual DOF filter will have settings to adjust the "focus" point without needing to alter the depth map.

 

If you are using a depth map to drive a more general purpose blur filter (less desirable) then you'd use something like Photoshop/AfterEffects "Curves" to remap the original grayscale to new values to move the white to black point to new values as needed.

Posted
yes, but how would i animate the focus then? that´s why i thought the thing with the material effector would be a cool thing to be really flexible... this way i could animate the near/far focus and the focal point very easily...

 

Ah. An actual DOF filter will have settings to adjust the "focus" point without needing to alter the depth map.

 

If you are using a depth map to drive a more general purpose blur filter (less desirable) then you'd use something like Photoshop/AfterEffects "Curves" to remap the original grayscale to new values to move the white to black point to new values as needed.

ok, didn´t get that because after effects built in DOF filter doesn´t have the feature to define the focus. there´s a plugin called lenscare from "frischluft" where you can adjust the focus, but ist´s 199 $... a little bit expensive for a DOF plugin i think :blink:

i´ve downloaded the demo, but there still is a problem, because a:m´s depth buffer is´n antialiased, so i get pixelated edges in some areas in focus after applying the DOF in after effects. i´ve googeld the issue, and it seems to be a common one. and i was really wondering why there is no general anti-alias filter available in after effects. there seem to be only one japanese plugin for that purpose out there, and that one is only for pc :angry: another solution would be ito render at 1440x1560 px with 5 or maybe even only 4 passes instead of 1280x720 px with 9 passes, and scale it down to 50% to get rid of the hard edges of the depthmap.

 

i was wondering if maybe someone here got a better solution for this....

  • Hash Fellow
Posted
ok, didn´t get that because after effects built in DOF filter doesn´t have the feature to define the focus.

 

That's weird. Does it expect you to place the white point manually?

 

there´s a plugin called lenscare from "frischluft" where you can adjust the focus, but ist´s 199 $... a little bit expensive for a DOF plugin i think

 

time or money... pick one. ;)

 

 

have you looked at this one?:

 

http://www.dofpro.com/index.htm

 

 

: another solution would be ito render at 1440x1560 px with 5 or maybe even only 4 passes instead of 1280x720 px with 9 passes, and scale it down to 50% to get rid of the hard edges of the depthmap.

 

rendering at double size with all the lights and shadows off just to get the depth map probably wouldn't take too long. If the depth map is never anti-aliased then you could render with just one pass and be no worse off.

Posted
: another solution would be ito render at 1440x1560 px with 5 or maybe even only 4 passes instead of 1280x720 px with 9 passes, and scale it down to 50% to get rid of the hard edges of the depthmap.

rendering at double size with all the lights and shadows off just to get the depth map probably wouldn't take too long. If the depth map is never anti-aliased then you could render with just one pass and be no worse off.

You could try rendering 1 pass (like Robert suggested) with the Blur Post Effect. That way you wouldn't have to do any extra processing to get aliased edges.

 

for example the character in my test has a white top, this still appears white, while the rest of the character is grey (it´s positioned in the middle of the scene).

This sounds like it might be a bug. Have you rendered a depth map without the null shader? Is the with top still white even though it is in the middle of the scene? If it is, please make a simple project the shows this and submit a bug report.

Posted

yeah it is weird... you can only choose if the focus will be in the front or back by inverting the depth-map, i couldn´t find any other option... other than that, lenscare does look a whole lot better, the blur is more accurate and it is able to automatically blend the brightness of heavily-blured parts of the image to the objects behind it. looks very natural i have to say..

 

i´ve already picked time ;) i´m not very patient, so i always pick the solution that saves time... that´s propably the reason i´ll never get rich :D ...throwing out money for software...

 

hmm, i don´t have to render it twice with the double-size solution, with v16 i can render my final and my depth-map at one time.. already checked the rendertimes and everything, and i´m pretty happy with the solution...

 

i have a outdoor-scene, with a lot of hairsystems, grass, the characters hair and birds feathers, and i´m down to 6 minutes per frame for 4 passes at 2560x1440px... and that´s on my macbook. i guess my 8core macpro will be able to render the a frame in 4 minutes or so... and everything is the way i want it to look like. :) i´m adding some smart SSAO ( http://www.adobe.com/cfusion/exchange/inde...6&loc=en_us ) later in post to get the final touch, also with the help of the depth map... i guess it works pretty much the same way as yenpy´s fakeAO.

 

i´ll make a WIP post when i´ve made some animation-progress....

Posted
: another solution would be ito render at 1440x1560 px with 5 or maybe even only 4 passes instead of 1280x720 px with 9 passes, and scale it down to 50% to get rid of the hard edges of the depthmap.

rendering at double size with all the lights and shadows off just to get the depth map probably wouldn't take too long. If the depth map is never anti-aliased then you could render with just one pass and be no worse off.

You could try rendering 1 pass (like Robert suggested) with the Blur Post Effect. That way you wouldn't have to do any extra processing to get aliased edges.

 

for example the character in my test has a white top, this still appears white, while the rest of the character is grey (it´s positioned in the middle of the scene).

This sounds like it might be a bug. Have you rendered a depth map without the null shader? Is the with top still white even though it is in the middle of the scene? If it is, please make a simple project the shows this and submit a bug report.

yes, it happens every time i´m trying to render a depthmap, even without the null shader. but i think i´ve already found out what it is with the white top. it has a transparency set of 10% and a decal on it. at first i just thought it was just the transparency, but the cornea of her eyes has transparency set, too... and it doesn´t happen with the eyes. so it only can be the combination of transparency and decal...

Posted

It sounds like yo already found a solution with the After Effects plugin, but here is a way to get what you want just using A:M with your idea to use a material effector and Nancy's idea to use a camera rotoscope with all the models set to "Front Projection target.".

 

*Make an image that is all black. It can be a small size like 256x256 or whatever.

*Import it into A:M and drag it onto the camera shortcut in the Chor as a camera rotoscope.

*In all your models, set Options > Front Projection Target to ON. In my test project, I set this in the models themselves, not the model shortcuts in the chor. But it will probably work either way.

*Make a new material named Ambiance, with only a single Attribute.

*In the Ambiance material, set the Ambiance Color to White and set the Ambiance Intensity to 100%.

*Make a new Material Effector and set its Falloff Softness to 100%.

*Drag the Ambiance material onto the Material Effector.

*Drag the Material Effector into the chor and adjust the position and Falloff size how you want.

 

This will work even on models that have decals.

Here is a normal render:

normal0.png

 

Here is a render with all Models as Front Projection Targets and the Material Effector in the chor:

fake_depth0.png

 

And here is a sample project file:

Depth_Buffer_Test.zip

Posted
yes, it happens every time i´m trying to render a depthmap, even without the null shader. but i think i´ve already found out what it is with the white top. it has a transparency set of 10% and a decal on it. at first i just thought it was just the transparency, but the cornea of her eyes has transparency set, too... and it doesn´t happen with the eyes. so it only can be the combination of transparency and decal...

 

I can not duplicate getting this result on PC, ver16rc1 32. I have tried with a simple sphere, decaled, with transparency, rendering to png, with alpha buffers both on or off. The depth buffer is always the same, and correct.

Posted
yes, it happens every time i´m trying to render a depthmap, even without the null shader. but i think i´ve already found out what it is with the white top. it has a transparency set of 10% and a decal on it. at first i just thought it was just the transparency, but the cornea of her eyes has transparency set, too... and it doesn´t happen with the eyes. so it only can be the combination of transparency and decal...

 

I can not duplicate getting this result on PC, ver16rc1 32. I have tried with a simple sphere, decaled, with transparency, rendering to png, with alpha buffers both on or off. The depth buffer is always the same, and correct.

 

CORRECTION: I do get a funny depth buffer when I render multipass with alpha buffer on (haven't tried with no alpha) - I do NOT get a funny depth buffer when I render Final/NO multipass

 

1st image is with no MP, 2nd is with 2 pass

 

EDIT: ps I like Holmes idea! tres bon!

2passall50withdecalwithalphadepthbuffertransparency_DepthBuffer0.png

all50withdecalwithalphadepthbuffertransparency_DepthBuffer0.png

Posted
It sounds like yo already found a solution with the After Effects plugin, but here is a way to get what you want just using A:M with your idea to use a material effector and Nancy's idea to use a camera rotoscope with all the models set to "Front Projection target.".

 

*Make an image that is all black. It can be a small size like 256x256 or whatever.

*Import it into A:M and drag it onto the camera shortcut in the Chor as a camera rotoscope.

*In all your models, set Options > Front Projection Target to ON. In my test project, I set this in the models themselves, not the model shortcuts in the chor. But it will probably work either way.

*Make a new material named Ambiance, with only a single Attribute.

*In the Ambiance material, set the Ambiance Color to White and set the Ambiance Intensity to 100%.

*Make a new Material Effector and set its Falloff Softness to 100%.

*Drag the Ambiance material onto the Material Effector.

*Drag the Material Effector into the chor and adjust the position and Falloff size how you want.

 

This will work even on models that have decals.

Here is a normal render:

normal0.png

 

Here is a render with all Models as Front Projection Targets and the Material Effector in the chor:

fake_depth0.png

 

And here is a sample project file:

Depth_Buffer_Test.zip

 

aaarrgghh.. that´s too great!!! my first attempt was with a material effector, but i wasn´t able to get rid of the decals with the null shader, and i didn´t want to make an extra project and delete all the decals manually. this would have been the solution... but it´s good to know anyway, that´s a great thing with the spherical fall-off to simulate some sort of extreme miniature tilt-shift optics...

 

thanks holmes...

Posted

@ nancy: hmmm... i have always had multipass turned on, so i guess it´s almost the same... only that your sphere doesn´t appear at all, while my top is rendering white... funny thing is that i have two characters with transparency set on the eyes cornea, but only one pair of eyes is rendering white in the depth buffer... i´ll have to do some more tests...

Posted
@ nancy: hmmm... i have always had multipass turned on, so i guess it´s almost the same... only that your sphere doesn´t appear at all, while my top is rendering white... funny thing is that i have two characters with transparency set on the eyes cornea, but only one pair of eyes is rendering white in the depth buffer... i´ll have to do some more tests...

 

I just tried a test - with no decal - with transparency =50%, rendered 2 pass, the depth buffer is wrong/funny. It is a combo of MP and transparency. I do not think the decal has anything to do with it.

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.

Guest
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.

×
×
  • Create New...