Home Unreal Engine

Post Process - Heat Effect

TheMetaMorphe
polycounter lvl 12
Offline / Send Message
TheMetaMorphe polycounter lvl 12
Hi,

I'm trying to achieve a sort of heat effect inside UDK.

The effect is done and present far away from the camera.

But I need to mask it on top of the player.

I mean when the player is looking up I want the effect to be off.

Heat.jpg

I've tried to put a Gradient Texture with a sort of reflection vector as UV. It works inside the mat editor but not in the game.

Is anyone got an idea to do that ?

Thanks by advance !

Replies

  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Mind doing a quick paintover in a scene of what you mean? I was thinking having a small sphere over your camera, set to additive, with a Z-Up Vector as your mask, set to be 'heaty' would be what you're looking for?

    But since you want it to be PP, I'm not sure if I there is an easy way.
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    How about something along the lines of using the inverse dot product of CameraVector and WorldUp to modulate the strength of the effect? So roughly,

    pow(1 - saturate(dot(CameraVector, UpVector)), 4)
  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    Ace-Angel : I want it in PP.

    Lotekk : That don't work. I think it's due to the fact that I'm using the emissive slot for the PP.

    I've also tried a simple up-Vector for masking the top of the scene but no luck.

    Thanks guys
  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    Ok well I found a way. I'm using an other depth pass, inverted it and multiplied it by the first one.

    Playing whit the value I've got my Heat only on the ground and far away.

    I'm close but it's not perfect.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    I also tried to achieve this effect a while back(mine was intended for a PP rain effect),but just couldn't get that up vector to work,but i'm sure there's a way to do this...in general there must be a way to separate the world space coordinates while in the screen apace...
  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    Maybe there is but not in the mat editor I think. I think there's some thing to do in code first to get acces to some feature in the mat editor.
  • dralex789
    Options
    Offline / Send Message
    dralex789 polycounter lvl 7
    Just wanted to weigh in with my attempt. I had something working pretty well in the material editor but any of the vectors don't seem to actually work when plugged into a post effect. I have run into this problem before and don't know a solution. However, since you are working with just distortion, you could always put a transluscent plane infront of the camera and throw the exact same effect on there, and it would even solve some of the issues you get with PP distortion near the edge of the screen, though that can usually just be masked out.

    I am unsure of how transluscency is handled in U3 100% so I am not super sure of the performance cost (it is probably more expensive than just doing it in PP). Finding a cheap solution Similar to what MetalMorphe did is my recomendation. If possible I would flip my depth vertically and add it too itself, but that doesn't help if you are looking up at the sky. Ultimately, like almost any post effect, UDK really locks you hard out of what you need. There may be a way to recapture those vector values via a custom hlsl node though. Could be worth poking around with.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    Thanks for chipping in dralex,the translucent plane method while viable,as you pointed out can be expensive(thought i'd like to know exactly how expensive,i suck at performance profiling),i've also heard that epic uses a cylinder around the player for those kind of things(so it shouldn't be that expensive if those guys are doing it,i guess),anyways the answer may very well be hidden in custom hlsl as always(but still have a feeling this can be done with the default nodes)...
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Anything done with HLSL can be done with Nodes, Custom HLSL is simply less optimized since UDK is unable to optimize them under the hood and access the lines directly.

    Example; In UDK, if you take your Normal Map, Mask RG, DeriveZ, Mask RG, DeriveZ again, and do so with a second Normal Map, and a Lerp to Control Hardness, you shouldn't see an increase in cost, at most by 1 point if using a second Normal Map which needs tiling from the original ALU count.

    However, Custom could eat upto 10-20 extra instructions per Normal map if you did the above.

    Anyhow, back to the question, I'm still confused as to what Heat Effect we're talking about here? Are we talking about heat effect as in Thermal Effect from the Up-Vector Sun? Or something more? Like a Zenith Horizon distortion? Or both?

    You could 'bend' a gradient texture so that it flattens in color upwards when you look up, although that would require some UV work with stuff like reflection and etc/
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    Minato wrote: »
    I also tried to achieve this effect a while back(mine was intended for a PP rain effect),but just couldn't get that up vector to work,but i'm sure there's a way to do this...in general there must be a way to separate the world space coordinates while in the screen apace...

    Post process doesn't have access to normals or position in post process. All you have is depth and color.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    I see,thanks for clearing that up for me,in other words there's no way to achieve something like that,even through a custom node,unless i misunderstood something.
Sign In or Register to comment.