Download

Fresnel Highlight Sun Direction

Hi all

I’m currently trying to develop a somewhat stylized look for a project I’m working on. I love the Fresnel effects but since the project I’m working on is a top down game with a moving light source (time of day) it doesn’t always give desired results. What I’d really like to do is figure out how to make the fresnel apply only from the direction the light is coming from. I’ve been searching and messing all day to try and get something like that working, and while using a fake light based on a vector gives ok results for static lighting it’s kinda useless for a light source that will be moving. I’ve been reading how to use blueprints to get a vector from light source, but being primarily an artist I have no real idea what I’m doing and the examples given in other posts relating to getting a light vector via blueprint and updating a vector parameter in a material have been next to useless to me since a lot of them assume you know what you’re doing.

So I guess in a way it’s like inverting fresnel? I’m not sure on the code/BP side of things :confused:

Any (idiot proof) help would be great! Cheers :slight_smile:

This might help?

EDIT: you should be able to hook the values up to a parameter collection which you can feed the sun direction in via BP :wink:

Cheers!

Thanks Daedalus I’ll give it a try. Judging from the video it doesn’t give the effect I’m after but I’ll give it a shot. I literally just want the fresnel rim light to be on the opposite side to the shadows. So if the light hits from the left I want the highlight to be on the left as well and not in the shadow.

I wish I knew how - I used BP to make characters move around but I don’t have a clue how to get a light vector from it or how to update a parameter with that

There is no light vector, if you get the directional light direction in the BP, it outputs a vector 3 that you can use to feed into the fresnel function. It like with custom skydomes that have a sun disc in the material. To position the sun disc on the skydome, you have to hook up a vector 3 and tweak all the values until the disc shows up where the “source” of the directional light should be…or you feed in the parameter collection thats hooked up via directional light rotation. I think the default BP_Skysphere does something like this for the sun disk…so you can look at it and learn from it.

This video explains how to have the fresnel only from a certain direction…which is what you want. Now you just have to check out how to hook up the sun to drive that direction :wink: Its kind of a fake light vector^^

Cheers!

Finally managed to get it working thanks to these two videos that show the process pretty well:
https://youtube.com/watch?v=vq6Ftd8bziUhttps://www.youtube.com/watch?v=a32n6SI65ZQ

Still needs a lot of refining but it’ll do for now for sure. Cheers for the pointers :slight_smile: