Skip to content

File RefractiveIndex.h

File List > Intern > rayx-core > src > Shader > RefractiveIndex.h

Go to the documentation of this file

#pragma once

#include "Complex.h"
#include "InvocationState.h"

namespace rayx {


struct PalikEntry {
    double m_energy;
    double m_n;
    double m_k;
};

struct NffEntry {
    double m_energy;

    // atomic scattering factors:
    double m_f1;
    double m_f2;
};

RAYX_FN_ACC int RAYX_API getPalikEntryCount(int material, const int* materialIndices);

RAYX_FN_ACC int RAYX_API getNffEntryCount(int material, const int* materialIndices);

RAYX_FN_ACC PalikEntry RAYX_API getPalikEntry(int index, int material, const int* materialIndices, const double* materialTable);

RAYX_FN_ACC NffEntry RAYX_API getNffEntry(int index, int material, const int* materialIndices, const double* materialTable);

// returns dvec2 to represent a complex number
RAYX_FN_ACC complex::Complex RAYX_API getRefractiveIndex(double energy, int material, const int* materialIndices, const double* materialTable);

// returns dvec2(atomic mass, density) extracted from materials.xmacro
RAYX_FN_ACC glm::dvec2 RAYX_API getAtomicMassAndRho(int material);

}  // namespace rayx