Changing the way specular is rendered in Real-Time

I’m looking to change the way specularity is rendered so that the fall-off follows a ramp with a limited set of constant values rather than being linear. I’d like to do this in real-time rather than use a post-process effect. I’m pretty sure I’d have to change the source-code to achieve this. Where inside the source should I start looking if I want to change how the PBR works, specularity specifically?