Skip to content

Instantly share code, notes, and snippets.

@Uradamus
Created July 21, 2019 00:05
Show Gist options
  • Save Uradamus/acaf0d264c25151c00b4ff97f1b20478 to your computer and use it in GitHub Desktop.
Save Uradamus/acaf0d264c25151c00b4ff97f1b20478 to your computer and use it in GitHub Desktop.
A simple script for determining an approriate specular value to use with Blender's Principled BSDF shader for a given IOR value.
#!/usr/bin/env python3
from sys import argv
ior = float(argv[1])
specular = ((ior-1)/(ior+1))**2/0.08
print(round(specular, 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment