Home Unreal Engine

Post process streched and squashed

polycounter lvl 10
Offline / Send Message
tuxmask75 polycounter lvl 10
Hi guys, i'm attempting to display a texture on screen for post process. In this case its a circle....
However the texture is stretched and squashed. It seems to take into account screen aspect. Is there any work around that will ignore the aspect ratio and allow the texture to display properly?

Replies

  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    Adjust the texcoords in such way to counteract the screen aspect ratio. You can use a 'TexelSize' or 'ScreenSize' node to make it atomatically work for various resolutions.

    Also change your textures AdressX/Y setting from 'Wrap' to 'Clamp' to avoid tiling.
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    mAlkAv!An wrote: »
    Adjust the texcoords in such way to counteract the screen aspect ratio. You can use a 'TexelSize' or 'ScreenSize' node to make it atomatically work for various resolutions.

    Also change your textures AdressX/Y setting from 'Wrap' to 'Clamp' to avoid tiling.
    Ahh man I cant seem to find any documentation on either of the nods you mentioned, you have time to toss together a quick example ?
  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    They have been ninja added quite some time ago, there is no info on UDN. You can find both in the vectors sub-menu.
    http://www.abload.de/img/pptexturetiling01f5u83.png
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Hmm,,, its not behaving very well at the moment.. let me play around some more. ( image is flipped upside down, and aspect is way off lol)
  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    My fault, just use a regular tex coord node.
    http://www.abload.de/img/pptexturetiling029qb07.png

    I've just tested it with a circle image and it's been some time when I did use textures for PPs :thumbdown:
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Ive got a clamped 512 x 256 texture and that shader stretches it so that its square. I guess we can only use square textures here? also it does not auto resize with the screen, not sure what is still missing here.
  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    You need to make the tiling a function of screen res, in the screenshot above the size is fixed. Try something like multiplying the tiling parameter by screen resolution x (or y, or x+y).
    Non-square textures should be fine, just change your texcoord node U/V tiling to (2,1).
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    how about the auto resize when the screen res changes?, I spent about 4 hours on this last night after the last post,, Its hair pulling frustrating... Basicly i'd like an image that can resize to fit the screen while keeping its pixel aspect.

    +Right now we have an image that keeps the pixel aspect ratio, but can not resize. sorry to be so much trouble.
  • Santewi
    Options
    Offline / Send Message
    Is this what you're wanting to do? (material)

    I don't exactly understand what you want, maybe you should draw a picture? :P
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Santewi wrote: »
    Is this what you're wanting to do? (material)

    I don't exactly understand what you want, maybe you should draw a picture? :P

    Actually yes that's what I was looking for ! Thanks a bunch man !

    Hmm but im also wondering how do I get it stay center of the screen when the resize happens, check out the pictures below...

    800 x 600
    0lyi.png

    400 x 600 ( notice how the top and bottom of the screen expands up and down while the door stays centered.
    4l2q.png
  • Santewi
    Options
    Offline / Send Message
    Could you show the postprocess and what happens to it when the screen's aspect ratio changes? I don't exactly understand what you are trying to achieve with the postprocess, so seeing what it is like and how it behaves would help a lot :P
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Santewi wrote: »
    Could you show the postprocess and what happens to it when the screen's aspect ratio changes? I don't exactly understand what you are trying to achieve with the postprocess, so seeing what it is like and how it behaves would help a lot :P
    Its the post process you posted above. but with a texture that is clamped.

    What I'm wanting to do is have the post process behave exactly the same as how the screen resize works when changing resolution and aspect.


    In this image, imagine that the red square is a texture in the center of the screen. notice the red arrows on the sides, they represent the amount of visual space between the image and the sides of the screen... also note the second image has the same visual distance to the sides even though the res and aspect have changed,, the only difference is the vertical, (which is different between the 2 images.)



    625e.png
    8krg.png
  • Santewi
    Options
    Offline / Send Message
    IK7FJ9Z.png



    Set the texture's X and Y address to "Clamp" in the texture properties if you don't want it to tile. The "Tiling" parameter controls how many times the image is tiled across the X axis of the screen.
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Santewi Dude! That's it ! That's exactly what I needed ! its perfect! thanks so much!! You just saved my life!
  • Santewi
    Options
    Offline / Send Message
    tuxmask75 wrote: »
    You just saved my life!

    Was someone pointing a gun at you and threatening to shoot unless you could do a postprocess or something? :P

    Anyway, no problem. I hope I'll find a use for the shader myself in the future too...
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    I'm planning to use it to position an underwater PP distortion effect.
Sign In or Register to comment.