the Depth of Field stuff he does is fantastic, especially for blurring the edge of meshes in the foreground with the blur behind them. Its exactly what Adam was looking for when he was doing his Evil Genius Base environment.
it's a rather easy effect. what you basicly do is blur the image, subtract the blurred from the original to get the difference and then add it to the original again.
marked in red is the "optional" mask part
not gonna go into the blurring algorithm since it's just the same scene texture offset once in all 4 directions by 1 pixel, added together and divided by the number of different versions ( don't forget the original :P).
you can go pretty fancy with the blur kernel if you feel like it, but I didn't.
the Depth of Field stuff he does is fantastic, especially for blurring the edge of meshes in the foreground with the blur behind them. Its exactly what Adam was looking for when he was doing his Evil Genius Base environment.
e: guy needs to make a tut. :P
I read through that thread. Makes me sad for not opening my shaders book more and doing more rendermonkey stuff
@Sean: I tried my hand and got some weird artifacts going on in mine. I used the sharpen filter matrix but failed Might take a look at what Xoliul has and just do that.
Edit: Divi got it. See where I went wrong. I was offsetting the texture but not adding it back with the original texture. Seems a lot like how edge dection works...
yeah, you could also use some advanced edge detection algorithms to get a nicer sharpen effect. sharpening is nothing more than increasing the contrast between adjacent pixels depending on how much contrast there is to begin with.
Oh wow, thanks a lot guys. This is exactly what I was looking for. It's nice and simple too. I was worried I would have to learn some HLSL in order to do this. Which isn't really a problem, but I wanted this effect for a school project.
Once again, Polycount unites to save my ass.
EDIT: divi - Just so I'm sure I'm not messing anything up, what is being input into the divide node there on the right?
Oh wow, thanks a lot guys. This is exactly what I was looking for. It's nice and simple too. I was worried I would have to learn some HLSL in order to do this. Which isn't really a problem, but I wanted this effect for a school project.
Once again, Polycount unites to save my ass.
EDIT: divi - Just so I'm sure I'm not messing anything up, what is being input into the divide node there on the right?
the input is a blurred scene texture sample 4 ways 1 pixel offset. Also he's dividing by the number of samples he did to blur the image. Need to write this paper fast haha so if Divi doesnt respond Ill post a network up.
you need to divide it by 5 :P
another thing that might be good to do but not actually necessary with a blur that small is to use the actual size of a pixel to offset or you get a squashed blur and "halo"ing effects. just divide 1 by the horizontal and vertical screen resolution and multiply the result by however many pixels you want it to be offset.
well, you have to use the horizontal size for the X and the vertical size for the Y eg. 1/1920 and 1/1080. it can become slightly confusing, especially when doing larger blurs for a bokeh but especially with those it gets realy obvious if you don't do it properly.
Hmm i've tried using the setups listed below and i've gotten the blur to kinda work but the sharpen effect gives a weird effect and i'm not sure where i'm going wrong. I've posted the shader setup, perhaps someone who knows more about it can help, please?
Replies
e: guy needs to make a tut. :P
marked in red is the "optional" mask part
not gonna go into the blurring algorithm since it's just the same scene texture offset once in all 4 directions by 1 pixel, added together and divided by the number of different versions ( don't forget the original :P).
you can go pretty fancy with the blur kernel if you feel like it, but I didn't.
I read through that thread. Makes me sad for not opening my shaders book more and doing more rendermonkey stuff
@Sean: I tried my hand and got some weird artifacts going on in mine. I used the sharpen filter matrix but failed Might take a look at what Xoliul has and just do that.
Edit: Divi got it. See where I went wrong. I was offsetting the texture but not adding it back with the original texture. Seems a lot like how edge dection works...
Once again, Polycount unites to save my ass.
EDIT: divi - Just so I'm sure I'm not messing anything up, what is being input into the divide node there on the right?
the input is a blurred scene texture sample 4 ways 1 pixel offset. Also he's dividing by the number of samples he did to blur the image. Need to write this paper fast haha so if Divi doesnt respond Ill post a network up.
another thing that might be good to do but not actually necessary with a blur that small is to use the actual size of a pixel to offset or you get a squashed blur and "halo"ing effects. just divide 1 by the horizontal and vertical screen resolution and multiply the result by however many pixels you want it to be offset.
Work fine for me, thank you guys :
Wouldnt believe how many times I have forgot to turn that on :P