OpticSim.jl
OpticSim.jl copied to clipboard
extend GlassCat to support complex indices of refraction so metals will be properly simulated
OpticSim does not currently model reflection from metals properly. Adding support for complex indices of refraction to Glasscat and the various functions called by trace would address this problem. Would also require finding online sources of index data for metals, and adding them to the OpticSim GlassCat loader. Possible source of data here http://www.sspectra.com/sopra.html.
See https://github.com/stillyslalom/RefractiveIndex.jl
julia> Ag = RefractiveMaterial("https://refractiveindex.info/?shelf=main&book=Ag&page=McPeak")
"Ag (McPeak et al. 2015: n,k 0.3-1.7 µm)"
julia> Ag.dispersion.n(0.5)
0.041373355
julia> Ag.dispersion.k(0.5)
3.159400537
refractiveindex.info is focused on refraction, of course, and doesn't have all the data needed to populate every GlassCat field, but much of what's needed is there.
@BrianGun what in the code would have to be changed to support complex indices?
@alok the functions which deal with computing refracted ray directions would need modification. Fresnel.jl has a lot of this code, in particular the processintersection and the fresnel function. The Glass type would need to be changed to allow for complex indices. Currently the coefficients for the various index models, Sellmeier, etc. are explicitly declared float64. I don't know how these models should be extended to handle complex values. It would help to find a paper that described how to extend the conventional Sellmeier models to complex values.
I don't think the Sellmeier model can be extended to metals, e.g. see Cauchy and related Empirical Dispersion Formulae for Transparent Materials. I don't think the Fresnel equations etc. would be too difficult to adjust, but I think we would need to drop the Sellmeier models for something more appropriate.
Alternatives:
- BB model, wiki, paper, some data
- Orosco and Coimbra, more accurate, causal and Kramers-Kronig compliant, paper and data, paper 2.