0
$\begingroup$

I've been looking into replicating shaders used in some Unity games for a while, and while I have found a solution for almost all the issues I ran into there is still one issue that stumps me.

Certain objects use a shader with an effect that is referred to as "Center Rim Lighting" and essentially functions as a glowing specular of sorts. The shader has a locked range of 0.5 to 50. At 0.5, the glow takes up almost the entire object, while at 50 it becomes extremely small and weak, but does not disappear entirely.

Demonstration of the Center Rim Lighting

I have been able to create a "fake" rim light effect for the edges of my models, but trying to invert the same method does not work at all. (I would post an image if my attempt even remotely resembled the screenshots from Unity, but what I tried literally looks nothing alike)

Every other component of my shader recreations all use Principled BSDF and Mix/Add Shaders to achieve what I've done so far, so I would prefer the solution to still use those shaders if possible. If it does require a different shader type though, then I guess I can still work with it as long as I can mix it with my preexisting setups well.

$\endgroup$
2
  • $\begingroup$ Hello and welcome. have you tried with the Fresnel Node? $\endgroup$
    – Emir
    Commented Jan 25, 2023 at 21:23
  • $\begingroup$ Hello! Yes, I have used the fresnel node for the blue outer rim. The emission strength is used to control its visibility and works as intended, but now I need to somehow do it from the center rather than the edges so that method doesn't seem to work with this effect. $\endgroup$
    – SSM0770
    Commented Jan 26, 2023 at 4:56

1 Answer 1

1
$\begingroup$

The best I can get is something like this - Use the From Min, To Min, and To Max on the Map Range node to control the density and spread of the purple specular reflection. The ColorRamp is there for even tighter control (optional):

Shader

Shader2

EDIT - try this - I swapped the glossy node for an emission, and mixed it with a transparent to lessen its affect. I also added a node chain to allow you to control the "rim" amount by using the values between 0-20 on the Value node on the left side. Also, setting the To Min manually closer to 1 makes the dot smaller/disappear and vice versa, if you want to start from a smaller or larger "center point":

Also, I just re-read your comment, I suppose to better suit your needs, it would make more sense to change the From Min and From Max on the first Map Range Node (after the Value node) to 50 and .5, respectively (instead of 20 and 0 - the positions are reversed compared to normal, so the purple grows as the number increases). After this, any value between .5 and 50 on the value node will influence the size of the purple "dot" (or "center Rim Power", as it's called).

Shade22

$\endgroup$
2
  • $\begingroup$ It's really close, I just wonder if there's a way to get it a little bit closer somehow. A: I need to make the .5-50 value range work somehow. There are multiple models I have that use the same base shader at different values, so I need to somehow make the numbers work as intended with all of them. B: This "Center Rim" is also supposed to be an emission. There is no light in the scene and the background lighting is set to pure black, that's why I'm getting so stuck on that part of the shader. I already have working Stars and Rim in the same manner Unity does it, so they're of no concern. $\endgroup$
    – SSM0770
    Commented Jan 26, 2023 at 5:09
  • $\begingroup$ Ok, I added another try, let me know if that's any better. $\endgroup$ Commented Jan 26, 2023 at 5:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .