Hi, I want to extract the information of how metallic a surface is using: UMaterial.Metallic which returns a FScalarMaterialInput. As I understand it this should contain a value between 0 and 1, however I need it as a float to be able to do calculations on it.
Does anyone know how to extract the metallic property of a surface as a float?
My knowledge regarding getting these values programmatically is quite limited, so I will give you an alternative answer which I hope can point you in the right direction.
You are correct, the metallic value should be clamped between 0 to 1 and is a scalar / float value by default. As for retrieving the value, if you create a post process material you can use a scene texture with an ID called Metallic. This value returns a range from 0 to 1 of the metallic value of objects in the world.
If a texture has been used to determine the metallic areas, then returning a float value wouldn’t really make sense. If a scalar / float has been used to determine the metallic input you could basically turn the scalar / float into a parameter which can then be retrieved with these nodes: