Making A Gloss Shader

Hello.

I am trying to recreate a shader that I made with Blender in Unreal Engine but I’m having an issue with recreating one of the features.

I don’t want to use post-process materials for this so instead, I’m using a normal unlit material that receives light data from a material parameter collection and then calculates the shadows and “bakes” them into the emissive color.

The feature I’m having trouble making is this white glossiness on the edges of the mesh that moves with the camera:

I made it in blender by simply connecting a GlossyBSDF shader with the roughness set to 1 to a ColorRamp.

My issue is that I couldn’t find anything similar to GlossyBSDF that I can access from an unlit material and I don’t know how to make it by myself.

Hi,

if I understand correctly, you’re only working in the emissive, and you feed the shader with a variable for the light direction vector ? (and probably another one for the light colot I guess)
And if I keep on guessing, you’re using a dot product between the pixel normal and the light vector, and then transform the result to your liking. Like in the old days.

Is that so ?

If it is, you can probably use a fresnel to get this rim effect.
The fresnel will give you a glossy edge everywhere, then you can just multiply by the normal*light result to mask the effect, and remove it from the shadowed area.

Does that help, or did I miss something in your question ?

edit:
I provided a screen of a material example to explain better.
The principle works as intended, with rim lights only showing up in already lit areas, but of course, you’d need to make different tweaks than I did. I just played around with S-curve and power.

This is exactly what I was trying to create, thanks!

Cool.
On a more visual note, maybe you should consider inverting the mask (with a oneminus node), to have the fresnel be visible in the dark areas and not the bright ones. That would make your characters stand out more.
This is what a three point lighting method typically does.
try it in natural conditions (with character at a typical distance, and in a detailed environement) to see if what I said would apply.