Home Unreal Engine

UDK - Material - Mask toward the 'outside', but not the mesh

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Heya peeps,

I was wondering if anyone knew a way to mask a mesh with an Alpha, and have it 'sample' the scene around it ONLY, based upon Camera Distance and Environment as opposed the mesh itself too.

For example;

-I have several pieces of paper intersecting each other.
-They belong to one mesh, but are under several material ID's.
-I would like to feather/jitter/abberate the edges each page.

Problem is, I'm extremely limited on what I can do so far. I used a 'SceneTexture' to capture background color for the edges so I can jitter/abberate them, but the SceneTexture is also taking into account the other pieces of papers and is overlaying the color unrealistically as an additive, essentially becoming a flash-bang around the edges.

I tried using a SceneDepth node, but it doesn't seem to work in this case, I guess I need to invert it, but it doesn't invert properly.

The cheapest solution I found it to Mul a basic Fresnel, but since I have extra instruction space to burn, I was wondering if there was an obvious node I'm missing which would allow the Jitter of the edges to be seen ONLY when looking at the environment and the overlapping pieces of the same mesh.

Oh, also, related to the camera issue, again, is there way to use the distance formula so that this 'jitter' occurs after only a certain distance? Again, I used the SceneDepth node, but it doesn't seem to be working.

This is all in PixelShader format BTW.

Replies

  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Ok, here is an image of what I'm asking for:


    sadme.png

    EDIT: Nevermind, found out UDK is not too fond of having the SceneTexture messed with at PixelShader level, it ends up destroying the color for some reason :/

    Case closed.
Sign In or Register to comment.