# How do I match old-style (Blender Internal) specular hardness with new-style (Cycles) Principled BSDF Roughness?

I am trying to match the specularity size of an old Internal material (controlled by a Hardness value) and a new Cycles material (controlled by a Roughness value).

As can be seen in the image, Internal Hardness is not nearly as linear as Cycles Roughness is. But I can't find out what sort of math to do to the hardness to make it match the roughness - the Blender source code from the 2.79 era is unsearchable because it's historical, and I can't find any other hints as to what the "Hardness" value logically represents that aren't dead links.

Notes:

• I'm not going for perfect accuracy. I just need the average person to look at the two rows here and think "yeah the shiny part looks the same size".
• The roughness numbers in the image are backwards because I'm actually working with gloss (the opposite).
• The max hardness in the image is 130 because that's what the Hardness texture input does at 1.0 power. I used the default CookTorr, but if one of the others is easier to work with or more accurate for this, that's fine.
• With what shader (Blinn, Phong, Cook-Torrence)? My guess is the 2.79 source code is this, which makes it look like Hardness corresponds to Phong shininess. Maybe see if this helps. Oct 6, 2022 at 4:37
• I mentioned using CookTorr in the notes, but that using something else is fine if the results turn out easier or better. That code looks weird because (if I understand it correctly) it seems to imply that hardness only takes effect in blocks of 2^n, I'll have to experiment with it. I'd seen that other question before but it's very generic and was hoping for a more Blender-specific answer. Oct 6, 2022 at 12:16
• If you mean spec(inp, hard), it's just doing inp^hard plus some clamping using unrolled exponentiation by doubling. I think you'll still have to do swatch matching though. Oct 6, 2022 at 13:18
• Ah so it is, this explains a lot. I might be able to self-answer this later. Oct 6, 2022 at 23:16

Based on the code linked to in the comments, Hardness is basically applied as an exponent to the specularity value. So I started to try some formulas and got internal ~= 130*cycles^2, or cycles ~= sqrt(internal/130).