Home Unreal Engine

Getting Fresnel effect to increase over distance

I'm still a newb to some of the more mathy operations in UDK's Mat editor, and even though I'm aware of the camera shader nodes, I am still quite unsure on how to implement them.
What I want to do here is increase the "reach" of the texturized linework around the sphere as the camera moves away. So if you get closer, the linework moves toward the edges, and then as you move far away, the linework reaches farther into the center.

So, here is my setup:
bDmBtMe.jpg

What kind of camera node setup do I need for that?

Also, any suggestions on having the texturized linework part be completely camera facing? so that it doesn't even follow the topology of the model and look almost like an overlay.

thanks.

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    try taking a "object world position" node, and a "camera world position" node, and hooking them up to the distance node, which will output the distance as a scaler value, than you will need to divide it by a pretty large number to try and get it near 0 to 1.

    Than you can use this to drive a lerp between 2 different Fresnel setups.
  • corrosion
    Options
    Offline / Send Message
    thank you sir! I will try that!
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    something like this for your Fresnel statement maybe.

    distanceBased01.jpg

    using worldSpace node instead of object world space could work too, and do it per pixel.

    you will have to play with the divider, and the exponets, i just tossed numbers in there.
  • corrosion
    Options
    Offline / Send Message
    Per your suggestion I went ahead and did this:

    G5QZYrh.jpg

    To be brutally honest let me just say: I have no idea what I'm doing. :poly136:
  • corrosion
    Options
    Offline / Send Message
    I'm gonna try your 2nd post suggestion. Thanks for the help, man!
  • corrosion
    Options
    Offline / Send Message
    Thanks to Passerby I am a lot closer to achieving what I want.

    iqKGXI5.jpg

    4ZsqfjA.jpg

    There is another layer of fresnel in this shader somewhere that is a black outline, yet I can't figure out how to make it be "on top" of the "line work" fresnel stuff (I guess because they're hooked up to emissive?) but I know someone out there knows how to set it up so that I can get both the linework fresnel stuff plus a thicker dark outline that will be on top of the lines instead of "under" it. That might be another post though.
Sign In or Register to comment.