Welcome to WSL!

New to the forum? Please read this and this.

[DEV] DCTL Convolve Bokeh Fuse

Where the future is being made, today.

Welcome to the WSL development corner!

In this forum, please post your development projects. You get kudos and feedback here.
Topics ideally have preset prefixes, and this is what they (might) mean:

  • [DEV] - very much work in progress, don't build a business on this, could go anywhere
  • [BETA] - should kinda do what it's supposed to do, please test, give feedback
  • [RC] - this may end up in Reactor soon, polishing up, now's the time for last minute thoughts
  • [ABD] - died a premature death, sadness, will not see the light of day ever (unless someone picks up the scraps)

Once a development project has been released (hurray), topics can be marked as - you guessed it - [RELEASED] :cheer:

Development topics only, please. For generic questions, how-to's, questions and inquiries about existing tools etc, please go to the appropriate other forums.
User avatar
Millolab
Fusionista
Posts: 824
Joined: Wed Oct 24, 2018 6:26 am
Answers: 6
Been thanked: 29 times
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#16

Post by Millolab »

@tida this is running smoother than the previous one!
Thanks for this!
One thing you should try and do is to make this resolution indipendent.
The convolution seems to depend on both the BG resolution and the Bokeh texture resolution.
also, I can still see some of the pattern formation...

Image

lastly, I really find the "Amplify" slider to be rather not useful. This kind of setup gives better (and faster) results
td_Bokeh_example.comp
You do not have the required permissions to view the files attached to this post.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#17

Post by tida »

To receive Bokeh without any pattern formation, you need to put the Size slider of this fuse to a whole number (not a fractional number). Did not make it as an integer as should be also used for smooth transitions.
td_Bokeh.fuse
You do not have the required permissions to view the files attached to this post.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#18

Post by tida »

Interesting, Video is categorized 18+ years because of "SUCK LESS". They track down even a Bokeh.

User avatar
Millolab
Fusionista
Posts: 824
Joined: Wed Oct 24, 2018 6:26 am
Answers: 6
Been thanked: 29 times
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#19

Post by Millolab »

@tida i still think that Amplify is kind of useless.
Also, as said before, the brightness of the image depends on the bokeh texture you use. And that's something (imho) you don't want.
I think you should allow textures bigger than 100px... Otherwise it's a nice toy but not really usable in the real world...
Anyway, thanks for your efforts! Very appreciated!

E.

User avatar
phoenixart
Fusioneer
Posts: 61
Joined: Fri Sep 25, 2020 3:49 pm
Answers: 1
Been thanked: 1 time
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#20

Post by phoenixart »

Millolab wrote: Tue Feb 23, 2021 3:37 amthe brightness of the image depends on the bokeh texture you use. And that's something (imho) you don't want.
Though I wonder if that's how it's supposed to behave. As far as I remember I get the same kind of result when I use a custom bokeh in Redshift and Cycles: in both cases, the type of bokeh affect the brightness — if I'm not mistaken, Redshift is a little more forgiving with an option to override it, but then again Redshift is a biased render.

User avatar
TerryPXM
Fusioneer
Posts: 86
Joined: Mon Oct 30, 2017 3:53 am
Location: Medellin, Colombia.
Been thanked: 1 time

Re: [DEV] DCTL Convolve Bokeh Fuse

#21

Post by TerryPXM »

@tida Dude this is an amazing tool, it's already pretty nice for a lot of creative effects and the latest performance tweaks are very welcome.
I think Millolab is being overly harsh on his remarks.

Now I would say that definitely need some improvements, I'll elaborate more on those in a later post but I think for now if you take the Channel1 and instead of putting on a hard-coded cap of 100px you do the scaling inside the Fuse to 100px or whatever number and according to the Size parameter of the Fuse you start to bring back the original resolution we would find a balance between performance and quality, that way if you have a really small size the internal scaling could be even lower than 100px but as we bring up the Size parameter the internal scaling goes to 1 (meaning no scaling and maximum quality) and also we could have a Bias parameter to control this transition.

Thank you very much for putting this together.

PD: The grid pattern that shows up as the Size increases also needs to be addressed.

User avatar
Millolab
Fusionista
Posts: 824
Joined: Wed Oct 24, 2018 6:26 am
Answers: 6
Been thanked: 29 times
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#22

Post by Millolab »

TerryPXM wrote: Tue Feb 23, 2021 1:05 pmI think Millolab is being overly harsh on his remarks.
I can assure you i'm just trying to give some constructive feedback.
Remember that english is not my native language and that written words can be misinterpreted (or badly expressed).
If my words sounded harsh... well that was not my intention!
Let me make clearer if i can: With 100px of max resolution, the purpose of having a texture driven convolve is kinda lost... With 100px you barely have any detail...
The amplify slider makes rendering way too slow... and (imho) you get a better result with the setup i posted above as an alternative to the "Amplify" slider
(the setup kinda replicate the one inside the defocus node). In that setup i posted, i was suggesting to downscale the BG image before convolving (if needed), that could add some speed.

In the end, sadly, all the above doesn't mean much if the grid pattern keeps showing... That makes this fuse not very suitable for some (most, in my case) kind of real world application.

i wish i could be able to help with some coding... but, well.. it's beyond my abilities :)

I thought i did thank @tida, but if that was badly expressed, i am grateful for his work!

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#23

Post by tida »

td_Bokeh.fuse
@Millolab and @TerryPXM thanks both of you for giving me the feedback. Sorry, for these many steps in development to get improvements. I think the following fuse should come close to most expectations and closer to a real-world toy.

I realized, that the Gaussian filter had some nasty bugs :evil: and got rid of them now. As a result, you should receive a pattern-free bokeh at every bokeh size. Just in case not, you can increase the Mix Gaussian slider a little bit.
Due to the bugfix, the depth mapping works as well - hopefully pretty well.....

Furthermore, the bokeh display size is now kept constant, independent of whether the bokeh input size changes or the video input size changes as @Millolab suggested. (This is also possible now because of mentioned bugfix - otherwise, the former pattern issue would have been more dominat)

The Amplify slider just increases the contrast of the bokeh whether the overall luminance changes are now compensated by a luminance calibrated function. (look at the waveform monitor what's happening - the highlights :idea: should be kept safe by now automatically)

And finally, the Max Size slider lets you give the freedom to use higher pixel resolutions of up to 10.000.000 pixels (from 10^2 to 10^7). Keep it small just for safety reasons that your computer will not calculate forever in case you increase the bokeh size input too much by accident.


(Input: FastNoise, Text+, Ellipse)
You do not have the required permissions to view the files attached to this post.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#24

Post by tida »

Just integrating a similar technique as shown in this video at 8:50 for chromatic abberration concerning bokeh image. The upcoming version will also rotate the symmetrically spread R,G,B-images. Due to this technique, the overall color tint is not influenced.

Would be happy if somebody has some additional ideas to share...


User avatar
TerryPXM
Fusioneer
Posts: 86
Joined: Mon Oct 30, 2017 3:53 am
Location: Medellin, Colombia.
Been thanked: 1 time

Re: [DEV] DCTL Convolve Bokeh Fuse

#25

Post by TerryPXM »

Thanks for the update @tida this is awesome, I'll try this right away and share my feedback.

By the way, do you know about this plugin? maybe it could be a great source for ideas. I know this plugin is extremely advance but just sharing.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#26

Post by tida »

@TerryPXM Thanks for the link, it's an impressive website and seems to be a very nice tool for After Effects. Meanwhile, I have implemented Chromatic Aberration functionality. Furthermore, you have an additional option to switch to the Bokeh Image.

Would really be happy to receive further feedback.
td_Bokeh.fuse

very nice presentation:
https://www.siliconstudio.co.jp/rd/pres ... ase_EN.pdf
You do not have the required permissions to view the files attached to this post.

User avatar
thibaud
Fusioneer
Posts: 214
Joined: Thu Sep 04, 2014 1:23 am
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#27

Post by thibaud »

Just chiming in to provide the requested feedback here :)

Here's my first experience with it:
I wasn't sure which entry was doing what and what should I feed at which entry.
I Wasn't able to get the fuse to output anything unless the max size was set to 5 or above.
I wasn't able to figure out what most of the controls would do without trying them out.
I wasn't able to figure out what most of the controls should do after even trying them out.

So the good news is that there's room to improve the user experience, a lot that can be done by re-aming the entries, re-naming the controls avoiding abbreviations, grouping controls, etc.. but I'm not sure that's the feedback you're looking for at this stage.

"Mix gaussian" It's not clear what this control does exactly. I understand it might not be required as a control.
"Amplify" simple and useful, I did get very nice and creamy results as soon as the amplify slider was pushed above 2.5. I must say the default 1.0 value was outputting mostly deceptive results in my test case.
"Max size" should definitely not be included as a control. the fuse should work independently of any bokeh input size.
you could have the bokeh input be resampled to an optimal size when the input exceed a certain threshold and propose a switch "high-res bokeh" that bypass the resampling and use the provided bokeh input size.

Bokeh controls: Chromatic Aberration is nice to have at the bokeh entry level, But I'm not sure the advanced controls you're providing here are necessary or even relevant to be included in a convolve fuse. A bokeh creator fuse or macro with advanced controls and chromatic aberration might make more sense.
I also noticed that the "show bokeh image" would display a cropped result of the bokeh when increasing the CA_dist. I'm not sure if that's just a display limitation or not.
Last edited by thibaud on Sat Feb 27, 2021 7:42 am, edited 2 times in total.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#28

Post by tida »

@thibaud This is great, that you took so much effort into reviewing the fuse.

Here's my first experience with it:
I wasn't sure which entry was doing what and what should I feed at which entry.
I can give the entries a name like Video (yellow),Bokeh (green) ,Depth (pink) instead of Channel1,2,3
I Wasn't able to get the fuse to output anything unless the max size was set to 5 or above.
usually, I would set in front of the Bokeh input a Resize node that controls the quality/speed. It means you can work with a high-resolution Bokeh image but control the quality and speed by resizing. The MaxSize function just makes it black as soon as you increase above. But yes, a checkbox for LQ/HQ is more practical
I wasn't able to figure out what most of the controls would do without trying them out.
maybe a similar naming like it's done in DOF Pro for After Effects would be better

... re-naming the entries, re-naming the controls avoiding abbreviations, grouping controls, ...
I will melt down the functionality to just things that will otherwise decelerate the processing. I think, at the end of the day this fuse needs to be integrated into a well-thought macro that cares about the bokeh appearance. Don't see a fuse for bokeh as processing would not give a headache. I would hope that somebody like @Millolab would take this part.

User avatar
tida
Fusionista
Posts: 257
Joined: Mon Jan 27, 2020 4:37 am
Answers: 1
Real name: none
Been thanked: 41 times

Re: [DEV] DCTL Convolve Bokeh Fuse

#29

Post by tida »

Just on the development of an additional Fuse which should turn a depth map into a focus map.

User avatar
phoenixart
Fusioneer
Posts: 61
Joined: Fri Sep 25, 2020 3:49 pm
Answers: 1
Been thanked: 1 time
Contact:

Re: [DEV] DCTL Convolve Bokeh Fuse

#30

Post by phoenixart »

tida wrote: [...]
Hey Tida,

The previous versions worked well here, but with the latest, I'm getting these errors:

Code: Select all

RT kernel TwoPassBlurKernel failed to build:
Failed to build program.
Build Status: -2
Build Options:  -w -DDEVICE_IS_OPENCL -DCOMPILER_IS_DVIP_RT -DVENDOR_IS_NVIDIA
Build Log: <kernel>:1639:18: error: call to 'native_powr' is ambiguous
                        float coeff = _powf(3.0,-0.5f * i * i / (sigma * sigma));
                                      ^~~~~
<kernel>:515:28: note: expanded from macro '_powf'
    #define _powf          native_powr
                           ^~~~~~~~~~~
cl_kernel.h:4659:24: note: candidate function
float __OVERLOADABLE__ native_powr(float, float);
                       ^
cl_kernel.h:4671:25: note: candidate function
double __OVERLOADABLE__ native_powr(double, double);
                        ^
cl_kernel.h:4661:25: note: candidate function
float2 __OVERLOADABLE__ native_powr(float2, float2); 
                        ^
cl_kernel.h:4663:25: note: candidate function
float3 __OVERLOADABLE__ native_powr(float3, float3); 
                        ^
cl_kernel.h:4665:25: note: candidate function
float4 __OVERLOADABLE__ native_powr(float4, float4); 
                        ^
cl_kernel.h:4666:25: note: candidate function
float8 __OVERLOADABLE__ native_powr(float8, float8); 
                        ^
cl_kernel.h:4667:26: note: candidate function
float16 __OVERLOADABLE__ native_powr(float16, float16); 
                         ^
cl_kernel.h:4672:26: note: candidate function
double2 __OVERLOADABLE__ native_powr(double2, double2);
                         ^
cl_kernel.h:4674:26: note: candidate function
double3 __OVERLOADABLE__ native_powr(double3, double3);
                         ^
cl_kernel.h:4676:26: note: candidate function
double4 __OVERLOADABLE__ native_powr(double4, double4);
                         ^
cl_kernel.h:4677:26: note: candidate function
double8 __OVERLOADABLE__ native_powr(double8, double8);
                         ^
cl_kernel.h:4678:27: note: candidate function
double16 __OVERLOADABLE__ native_powr(double16, double16);
                          ^


RT kernel TwoPassBlurKernel failed to build:
Failed to build program.
Build Status: -2
Build Options:  -w -DDEVICE_IS_OPENCL -DCOMPILER_IS_DVIP_RT -DVENDOR_IS_NVIDIA
Build Log: <kernel>:1639:18: error: call to 'native_powr' is ambiguous
                        float coeff = _powf(3.0,-0.5f * i * i / (sigma * sigma));
                                      ^~~~~
<kernel>:515:28: note: expanded from macro '_powf'
    #define _powf          native_powr
                           ^~~~~~~~~~~
cl_kernel.h:4659:24: note: candidate function
float __OVERLOADABLE__ native_powr(float, float);
                       ^
cl_kernel.h:4671:25: note: candidate function
double __OVERLOADABLE__ native_powr(double, double);
                        ^
cl_kernel.h:4661:25: note: candidate function
float2 __OVERLOADABLE__ native_powr(float2, float2); 
                        ^
cl_kernel.h:4663:25: note: candidate function
float3 __OVERLOADABLE__ native_powr(float3, float3); 
                        ^
cl_kernel.h:4665:25: note: candidate function
float4 __OVERLOADABLE__ native_powr(float4, float4); 
                        ^
cl_kernel.h:4666:25: note: candidate function
float8 __OVERLOADABLE__ native_powr(float8, float8); 
                        ^
cl_kernel.h:4667:26: note: candidate function
float16 __OVERLOADABLE__ native_powr(float16, float16); 
                         ^
cl_kernel.h:4672:26: note: candidate function
double2 __OVERLOADABLE__ native_powr(double2, double2);
                         ^
cl_kernel.h:4674:26: note: candidate function
double3 __OVERLOADABLE__ native_powr(double3, double3);
                         ^
cl_kernel.h:4676:26: note: candidate function
double4 __OVERLOADABLE__ native_powr(double4, double4);
                         ^
cl_kernel.h:4677:26: note: candidate function
double8 __OVERLOADABLE__ native_powr(double8, double8);
                         ^
cl_kernel.h:4678:27: note: candidate function
double16 __OVERLOADABLE__ native_powr(double16, double16);
                          ^