Created
July 21, 2019 00:05
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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