Using blueprint only, I am trying to calculate an Objects Screen Size (Percentage: 0-1) in the material editor to drive a scalar parameter value for an alpha for a linear interpolation node. Basically, I want to adjust the brightness based on the objects screen size. I am using a Dynamic Material Instance, so I would be able to some calculations in the objects blueprint to help drive the value if everything cannot be calculated in the material editor alone. I would also like a value of 100% (or 1) to be black (0) and 0% to be White (1).
It is way too complex of a material to include all the nodes. This is the important part for what I am trying to accomplish, the result of these nodes is being fed into the emissive input. If I add a LERP with a=0 and b=1 and the result of these nodes as the alpha or try to use a 1- node to invert it, it just end up white and not fading.
For those who want to try it, it works, but there is a margin of error of 0.001 only when changing the screen percentage of the viewport. Maybe someone will be interested in posting a fix to that, but for me it wasn’t worth the time. Hope it works for you