How Do I Make a Distance-based Color Gradient Material?

I’m new to materials in general, and I find it incredibly difficult to navigate through the sea of nodes, and I do not believe nodes are a very good design choice for making materials. I know what I want to implement, but I don’t know how to in spite of how simple it is, even after browsing through all the nodes. I’m not even sure if I can make custom nodes, or if I can simply just write a shader myself which would be much simpler and easier for me to do, but I don’t want to touch C++ (as a C programmer).

I want to make a simple color gradient that increases saturation and lightness as the distance of a point on a quad face relative to the center of the face and the nearest edge such that the values on the edge are at or near a saturation and lightness of 1.0f and values close to the center of the quad are near 0.0f. The gradient pattern would be that of a squircle or rounded square whose dimensions and shape are similar to and bounded by the current quad. This would be used to create a nice, neon, translucent platform with glowing edges. This would be easy to implement in GLSL or HLSL, but I can’t find any tutorials on nodes, and I get lost in the UE documentation. What’s the best way to implement this?

One thing that I found might work is using a color mask, but if I make a simple square texture, and I make it a low resolution such as 3x3 pixels, can I force it to use a specific interpolation pattern to make the gradient, or do I have to waste texture space making a hires mask for a simple gradient? This is obviously very resource-inefficient; dynamically generating the gradient would be much cheaper.

Ah, this is perfect. Thank you!

You can type shader code directly into a custom node, if you want…

Also

Is there a way to get face and tri dimensions as width, height, and optionally depth in texels?

Oh, not that I know of…