Any way to get iridescent-like material?

I want to create a material that reacts to the way light bounces off of it at different angles, so that the player might see shades of red when directly looking at it but it turns green otherwise.

The problem is i’m completely new to making materials in general.

These links seem to work it out pretty well:
https://forums.unrealengine.com/attachment.php?attachmentid=3297&d=1400533049
https://forums.unrealengine.com/attachment.php?attachmentid=3298&d=1400533094

I figured out how to copy most of the nodes into the material editor, but i can’t figure out how to bring in the node for “Light Source Position in world space”, which i’m fairly certain is what gives the different color reflections.

The concept is trying to get somewhat realistic but slightly cartoonish and alien looks out of the environment, and if i could just figure this one thing out i think i’d be set. I’m trying to export assets from Blender into UE4, but they both handle materials differently.
I don’t for the life of me know what’s going on in that Material map either, other than that it is messing with the specular shader. Looks like some logic base mixed with light and camera direction and whatever “phong” is.

Any help would be greatly appreciated.

I remember there being an example either in material or math hall content examples that changed when you were looking at it. Take a look at it

‘Light source position in world space’ looks like a Material parameter. I think that param is set from Level blueprint.

There is a Fresnel node in Material editor. It is not quite what you are looking for, but will help you get some fancy materials. It will letyou do some processing based on the surface-eye viewing angle

Sounds like what you want is the fresnel node, as Mindfane pointed out. Perhaps a better explanation of what exactly you are after would help you get a better answer.

I’ll try and answer your questions but it gets pretty complicated! Also, I hope I don’t get anything wrong >_<

So I think that the ‘light source position in world space’ would be something you’d create in your level blueprints. Essentially you need to create a 3-vector variable that’s keeping track of the position of an actor inside the level itself. It will probably end up looking something like this:

Except instead of ‘GetActorRotation’ it’ll be something like ‘GetActorLocation’ or ‘GetActorTransform’. Something to that effect. You then need to create a ‘material parameter collection’ and add one vector parameter to it. Give it a name. Then, go back to what you added in your level blueprint and in the dropdown box labeled ‘Parameter Name’ select the new variable you created.

Also, just so you know, ‘light source position in world space’ is not determining the color of anything. The reason that it looks light blue is because, in Unreal, the position of any object is represented with x,y, and z values. In a 3 vector variable (a variable with 3 inputs) these values can be visualized by turning X,Y and Z into RGB (red blue green).

FINALLY, to answer what the material is doing: I’m a bit too lazy to take a good long look at it, but here’s the gist. It’s actually not messing with specular at all. It’s purely using Unreal’s emissive trait, which is used to make a glowing effect, to make its own faked version of specular. This material is tracking the position of a light source and using that information to create a small highlight pointing towards that light source.

Hope this helped!!

EDIT: I just realized I answered a question that was years old… cool. Maybe it will help someone lol