Home Unreal Engine

Opacity mask / distortion shader query

polycounter lvl 8
Offline / Send Message
danshewan polycounter lvl 8
So I've started getting my hands dirty with UDK materials, and I'm encountering a situation that I'm not sure about.

I'm trying to add a glass effect to the windows of my scene. I'm trying to add some subtle distortion to the glass, but I don't think I'm doing it right.

Here's the (very simple) setup - I've used a difference clouds texture with a glass distortion filter as a test image to define the distortion effect, and an alpha of my diffuse texture to function as the opacity mask to define the transparent glass areas of the windows.


glassshader.jpg


I'm wondering if it's working at all, or if I need to apply another node in order to see the effect more clearly in the editor? Or is the setup completely wrong?

Anyways, back to work I go - thanks in advance for any tips and suggestions.

Replies

  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    you need a normal map to drive the distortion and not a greyscale image.
    i don't think masked blend mode supports distortion. you'll most likely have to use translucent in your situation. other modes support it too but might not be the best choice if you want other surfaces in the same material.
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    divi wrote: »
    you need a normal map to drive the distortion and not a greyscale image.
    i don't think masked blend mode supports distortion. you'll most likely have to use translucent in your situation. other modes support it too but might not be the best choice if you want other surfaces in the same material.

    Really? I was using this tutorial by Hourences to refer from, and although it's for an older version of the engine, it doesn't mention anything about normal maps to control distortion.

    Also using that same page as reference, I was using masked as opposed to translucent blending as the glass needs to be lit by the internal lights of the scene, which apparently translucency doesn't support - has this changed in the recent builds of UDK?
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    mh. maybe you can use a greyscale image to drive the distortion, only ever used normal maps. and yes, lit translucency is supported for quite some time now. just not sure about dynamically lit translucency.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Check out DM_Deck stuff, Im certain they have some distorted glass material...
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    as far as i know, you cant distort anything that is using Blend_Masked. It either needs to be translucent or additive. there is a setting (ill have to look it up) to get translucent objects to not render through themselves (so that you dont see geometry inside or behind it even with a white alpha). but pretty much set it to translucent and that will have displacement work. :D
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    Oniram wrote: »
    as far as i know, you cant distort anything that is using Blend_Masked. It either needs to be translucent or additive. there is a setting (ill have to look it up) to get translucent objects to not render through themselves (so that you dont see geometry inside or behind it even with a white alpha). but pretty much set it to translucent and that will have displacement work. :D

    Thanks, Oniram, that did the trick. The glass is distorting quite well now that the blending is set to translucent, though I'd be interested to see the settings to only apply the transparency and distortion to the alpha and not the rest of the diffuse, but at least I'm on the right path.

    Thanks again!
Sign In or Register to comment.