Home Unreal Engine

Sharpen Post Processing?

Is it possible to have a post process effect that sharpens up everything a bit, similar to what you can do with Xoliul's post process shaders for Max?

Replies

  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Ill try and take a stab at it. Need to head out for a bit and atleast it'll get me off my ass to do some shader/post processing work :P
  • Sean VanGorder
    Options
    Offline / Send Message
    That's some awesome work, but I don't really see anything that shows how he did it.
  • karera
    Options
    Offline / Send Message
    karera polygon
    Love that effect.
  • fearian
    Options
    Offline / Send Message
    fearian greentooth
    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
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    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.

    UnsharpMask.gif

    unsharpMask.jpg
    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.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    fearian wrote: »
    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...
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    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.
  • Sean VanGorder
    Options
    Offline / Send Message
    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?
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Sean_EG wrote: »
    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.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Sorry stuff came up but if you didnt manage to get it here ya go. Just a simple box blur filter.:

    BlurOffset.png
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    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.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Whoops. Gonna try that divide trick divi. Would it just be ([1/1920]/1080)*# of pixels? Wonder if UDK has something like viewport_inv_width.
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    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.
  • pixeldamage
    Options
    Offline / Send Message
    pixeldamage polycounter lvl 14
    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?

    shader.png
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Check "screen align" in every "Scene Texture Sample" node I guess. ;)

    Work fine for me, thank you guys :) :
    bd45ada406fae2c78feb8833c37e1.gif
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Froyok wrote: »
    Check "screen align" in every "Scene Texture Sample" node I guess. ;)

    Wouldnt believe how many times I have forgot to turn that on :P
  • pixeldamage
    Options
    Offline / Send Message
    pixeldamage polycounter lvl 14
    haha thanks that fixed it! :)
Sign In or Register to comment.