This file contains hidden or 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
sideLength = 1; | |
differenceThreshold = 0; % show results that differ at most this much. | |
%differenceThreshold = 0.0000000001; | |
metallicCount = 1000000; % to be safe, make sure this is greater than sideLength * (the maximum value of n) | |
metallicRatios = zeros(1, metallicCount); | |
for ratioNumber = 1:metallicCount | |
metallicRatios(1, ratioNumber) = (ratioNumber + sqrt(4 + ratioNumber^2))/2; |
This file contains hidden or 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
Shader "Custom/Pearlescent" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_ColorDirect("Indirect Color", Color) = (1,1,1,1) | |
//_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
_Metallic ("Metallic", Range(0,1)) = 0.0 | |
_Iterations("Iridescence Function Iterations (Power)", Range(0,20)) = 5 | |
} | |
SubShader { |