Invert bump offset for a realistic scope effect?

Hello everyone,

I am working on a realistic scope and try to simulate the black fade effect, so when you don’t look right in the center of the scope the view will turn black/fade out. I am using the RadialGradientExponential node to create the black circle with some fade and use the bump offset to move the black circle depending on the angle I look from.
Everything works except the bump offset direction, when I look at it from the side the black circle goes in the wrong direction and follows my angle, but I want it to go in the opposite direction, so when I look at it from the right the black circle should move away from my angle to the left. I tried to invert the bump offset, by using the bump offset advanced node and adding a one minus to the distortion, but I had no success with that, thats why I ask you guys for help.

My scope material:

The effect I am getting:

The effect I want:


Thanks in advanced!

Hey, have you finished this I’m looking for this one too can you help me with it?
Can you add me to Discord, please ?
CENSOR_1337#3992
Thank you.

and also maybe you needed to invert height
and maybe can I see full of materials too?
or drop it here will be really wonderful

I’ve already tried a lot of stuff, but nothing works like I want.

I achieved the affect by using some simple vector math. You just need your lens to be separate mesh.

Just get the difference between the object location and the camera location in local space. Normalize the result and add 0.5, you should get the result you’re looking for.

Something like this:

Offset = (ObjectLocation.LocalSpace - CameraLocation.LocalSpace).Normalize;
Offset += 0.5;

Now you can use Offset in the CenterPosition pin of a RadialGradienExponential.

Hope that helps!!

I did that by setting the bump offset height to a positive value around 30 and scale the circle to fit the scope, reason for 30 is that if you have negative or a too big positive value will result in the effect you described, which is useful but not in this case, so I will recommend trying bump height value from 0 to lets say 60, I left the other settings default, like the ratio at 0.05.