Fake light shaded material

Hi! I need some help with a material I want to achieve.
I want to make an unlit material that emulates a directional light from a custom
angle and make it constant relative to the camera. That means that If I orbit with the camera, the light will rotate with the camera too making the light direction always fixed related to the camera.

I can just achieve the effect I want from a fixed view point but I cant figure out to fix the angle of the light with the angle of the camera view.

Any help?

this is the material I have:

and a video showing it:

Something like this?

Hi @illspiritx Thanks for you reply! :slight_smile:

I am using UE 4.26/ Somehow If I dont plug something on all RemapValueRange inputs It gives an error

Anyway I see its a remap, so all the previous part until dot value should give something and I get nothing If I plug. look:

I am doing domething wrong?

Dany

I started from scratch and I think A have a good one.
This one includes light/shadow/hardness/rim light control and highlight :slight_smile:
And finally it is fixed with the camera so I rotate the camera around and light is consistent.

here is a sample video (cam is orbiting the elements)

here is the material BP

You need to click the Transform node, and change the source to view space. I think this should work in 4.x.

The remap itself isn’t necessary really, I just stuck that in there to bring in the edges. Could do that with other nodes, but the values for the remap should be from 0.x to 1 on input.

Or just use the new material, as it looks better.

1 Like

Thanks! I will check it out!
Maybe I can mix stuff and make one better :slight_smile:

I updated the material using a bit of yours and a bit of my material and now I am super happy with the results.

Your approach works perfect for the main goal (shading from camera) but I noticed
Vivew aligned reflection works better for the specular highlight :slight_smile:
Thanks man!

image

Here is the updated final material

1 Like

Yea, the dot product part of my example was kinda bland. The spec reflection you added makes it pop.

1 Like

I dont know what happened with the SOLVED tag…is not here anynmore :frowning: