Jump to content

Recommended Posts

Hello, I really like this software.   ;)  :) I'm a 3D artist and I need to know if it is possible to load a black and white picture (the z-depth channel created in the 3d software) and load it into a channel or a slection or something else in order to create a depth of field. Like this https://www.youtube.com/watch?v=tEntwpYYKHE

Share this post


Link to post
Share on other sites

Whil I can't see why it would be a problem to load a B&W file, I can't see an option to use the mask as z-depth.

Though you may try just leaving the mask as is on a layer with filter applied. Then doing some fun with a curve after loading the mask (like U or V shaped curve, such that middle will not be affected but black (far) and white (close) will be affected).


"I'm a lumberjack and I'm OK, I sleep all night, and I work all day..."

Share this post


Link to post
Share on other sites

What he does in the video? Totally, yep. Whether that's a real field of view effect, that'd be another story. But all he does is load the greyscale image, load as a mask/selection, then apply a lens blur. You have lens blur in AP, just with less settings, but you can substitute, like always, certain effects with some clever operations with masks and filters or other actions.


AD, AP and APub.  Ryzen 9 3900X, 32 GB RAM, GTX 1650 4GB, 500GB m.2 SSD, 1TB HDD 7200rpm. Wacom Intuos 4 XL.

Share this post


Link to post
Share on other sites

Hi There,

I'm a CG Generalist. I am really happy how Affinity Photo handle HDR images (32 bit/channel, linear). Way better than how PS does.

But the z-depth map is the most crucial part of the compositing workflow.
For simple compositing tasks Affinity Photo looks almost perfect.

Is there any way to use a z-depth map (grayscale 32 bit/channel) inside the Lens Blur filter?

 

Cheers, D

Share this post


Link to post
Share on other sites

You can load the z-depth pass as you would normally do in other compositing apps.

That said, I've noticed that currently, AP does something weird when I add a mask to the lens blur filter.

It seems that the transition between gray values is not being interpolated properly, in fact, I get a sort of diffuse result right where the transition from white to black takes place:

 

zdepth_test.jpg


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

A quick test in After Effects with Frischluft:

 

zdepth_test_0000_00000.jpg

 

Let's disregard the different colors and the intensity of the blur.

The real difference is how the zdepth pass is being interpolated, an area where Photo needs improvement.


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

If you simply mask the lens blur filter that is not correct.

You created a blurred layer (via the filter) and masked it. It is not the right way.

In After Effects or Photoshop the built-in lens blur effect or the Firchluft version of it or any other DOF generator (NUKE, Fusion, etc.) effect works differently.
Please, don't do that.

Cheers, D

Share this post


Link to post
Share on other sites

You don't mask, you use it as a matte layer.

 

At first, I thought you meant to create masks within AP (which, after all, would also work).

So, mask or matte it doesn't matter, it'll work anyway.

 

In PS you do the same thing, as well as in other comping apps.

 

Edit: for the record, if you load an alpha channel in frischluft/PS, it will do just fine.


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

So (deep breath...), the question remains:
How do you use z-depth maps for lens blur (aka DOF effect) in Affinity Designer?

Please, write down the steps!
If you think you know, but you are wrong, that's also help - for you at least.

Cheers, D

Share this post


Link to post
Share on other sites

ddankhazi,

 

I'm not sure to understand your question.

I already explained the basic use of the z-depth. I'd love to hear your method though, perhaps you know a better way to do it (always interested in other options...).


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

@ddankhazi I think what you request is somethink like this and as far as I know this can not be replicated in affinity as of now.

https://forum.affinity.serif.com/index.php?/topic/18882-blur-filter-with-radius-based-on-a-bw-layer/

 

Thanks. That's what I think. And that is the same result what verysame get. It's not "not as good" It's totally wrong.

 

Cheers, D

Share this post


Link to post
Share on other sites

ddankhazi,

 

Can you explain? Do you mean that the method is wrong, or that the current AP's interpretation of the depth value is wrong?

Since you said before that loading the zdepth as an alpha channel is a no-no, would you explain what would be the best way to do it?


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites
On 11/27/2016 at 10:47 AM, verysame said:

ddankhazi,

 

Can you explain? Do you mean that the method is wrong, or that the current AP's interpretation of the depth value is wrong?

Since you said before that loading the zdepth as an alpha channel is a no-no, would you explain what would be the best way to do it?

 

I never said that. I said "If you simply mask the lens blur filter".

That's equivalent (as result) with: duplicating the image, blurring it, and put a mask on it.

That is not how the DOF works.

 

As you see in your image as well: there is the unblurred version and the blurred version in the same time, at the same area. It' looks like as I described it above.

You also recognized it with this: "It seems that the transition between gray values is not being interpolated properly, in fact, I get a sort of diffuse result right where the transition from white to black takes place"

I think that's not an interpolation problem.

 

If you can load the z-depth map as data source (form Channels as an Alpha or from Layers as an image, it doesn't matter if you implementing correctly.) that's totally fine for me.

 

Here is a proper multi-channel 32 bit/channel EXR render (Maya, Arnold):

https://www.dropbox.com/s/5c07khi2lldwcx4/shader_ball_02_no_DOF.exr?dl=0

 

What you need is the RGB and the Z.RGB layer. You can delete the others.

The Z.RGB is not white (you can verify that: put an exposure adjustment on it, exposure: -8.5).

 

The goal is: use the Z.RGB layer as data in the Lens Blur Filter.

 

The Photoshop way (list only from the horrible and necessary steps):

- Out of the box Photoshop doesn't understand multi-channel EXR files. 

- You have to correct the z-deth map with an exposure filter, because PS usually don't recognize the true 32 bit data in the z-depth image.

- You have to convert your 32 bit/channel image to 16 bit/channel if you want to use the Lens Blur Filter at all.

- You have to copy the z-depth image into an alpha channel. 

 

After that:

- Select your image layer

- Choose the Lens Blur Filter

- Select the alpha channel which contains the z-depth data (after you do all that steps - above)

- Adjust the settings, apply.

So it is super slow and dumb.

 

I really want to have a better solution.

Affinity Photo almost there:

Multi-channel EXR: check

All effect works in 32 bit: check

Lens Blur Filter with z-depth map: :(

 

When I first open (ever) Affinity Photo I create my compositing less time than in PS.

Here is the result (in this case the DOF is rendered):
https://www.dropbox.com/s/htnu89o5k2qcuez/shader_ball_01_affinity.jpg?dl=0

 

So the path is right. Keep up the good work.

 

Cheers, D

Edited by ddankhazi
updated links

Share this post


Link to post
Share on other sites

ddankhazi,

 

We are doing the same thing, perhaps I haven't explained it clearly enough.

I load the z-depth channel and in PS you can do it with the awful built-in lens blur filter or with an alternative plugin, for instance frischluft.

They both work by loading the z-depth as an alpha channel.

 

 

 

If you can load the z-depth map as data source (form Channels as an Alpha or from Layers as an image, it doesn't matter if you implementing correctly.) that's totally fine for me.

 

^ that and

 

 

 

- Select the alpha channel which contains the z-depth data (after you do all that steps - above)

 

^ that - your method is the same

 

In fact, if you would follow your own steps, you would wind up with my exact situation, with a soft interpolation (I have no better word to describe it).

All the techniques come down to the same principle: 

 

I hoped you had a better way to do it, but unless we CG people rely on a proper plugin (either sapphire z-defocus, frischluft, Nuke built-in Zblur, you name it), there is no other way to do it.


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

Yes, that's almost the same thing (the only different he load the z-depth map form the layer's mask - which is an alpha channel - and not from a layer independent channel.)
That's not the question.

 

Do you realize, you did not not answered my question?

How you do this in Affinity?
Please consider me as a total starter in Affinity (which I am).

 

Cheers, D

Share this post


Link to post
Share on other sites
  • Load your z-depth channel.
  • Right click on one of the RGB channels, say Blue, and choose Create Spare Channel.
  • On the layers panel, if the layer is selected, press the ESC key to select none.
  • Create a Lens Blur Live Filter.
  • In the channels panel, right click on the Spare Channel you saved earlier.
  • At this point, you have two choices: Load to Lens Blur Alpha, which will not give a good result or Load to Pixel Selection, pick this one.
  • Now that you have your selection and the Lens Blur Live Filter still active, simply click Mask Layer icon in the layers panel.
  • As you start increasing the Radius, you'll notice the edge of the layer will become slightly transparent.
  • If that's the case, in the Lens Blur options check the option at the very top "Preserve Alpha", which most likely wasn't available before the mask.

 

Hope that makes sense.


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

The pixel selection also just defines how much percentage of each pixel is included and thus should give you the very same result as a mask as far as I'm concerned


 

 

Share this post


Link to post
Share on other sites

The pixel selection also just defines how much percentage of each pixel is included and thus should give you the very same result as a mask as far as I'm concerned

 

That's what I thought, but I've got different results.

With the pixel selection, the transition in the gray values holds up better.


Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Share this post


Link to post
Share on other sites

Although the workflow is not working with 32 bit images and it is a very important feature (for CG artists) to create a cool looking DOF effects (with the option to set the focus point dynamically) I bought Affinity Photo today.
I want to support the company.
Good luck for the further developments.

 

Denes Dankhazi
https://ddankhaziportfolio.wordpress.com/

Share this post


Link to post
Share on other sites

I really hope that Affinity Photo will have this feature in next releases. I´m an MODO user an DOF driven by Z-Map is essential for me. 

 

I love Affinity Photo cause it´s the first real alternative for PS !!


Technical illustrator, Digital Artist and graphic enthusiast... since Amiga ´89

Affinity Designer | Affinity Photo | Modo | 3ds max | SolidWorks | AfterEffects ... all on Windows ( and i like it ). Waiting for Affinity Publisher and an Affinity-version of AfterEffects 

Visit my private (german) website : http://www.3dpeek.videospielgeschichten.de/

Share this post


Link to post
Share on other sites

Is there any changes to that topic? I would like to use 32 bit depth map to get proper DOF. If it`s not possible in Affinity Photo, so maybe you can offer me some third party plugin which will work well with Affinity Photo?

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.

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

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.