#define MATERIAL_GUARDIAN

#ifndef MGML_GPU_GUARDIAN
  #include "MGML_GPU.h"
#endif

namespace RAYTR
{

struct Material
{

#ifndef __CUDACC__

  Material(){}

  Material(const MGML::Material& in_mat)
  {
    ka = in_mat.ka;
    kd = in_mat.kd;
    ks = in_mat.ks;
    power = in_mat.power;

    k_reflect = in_mat.k_reflect;
    k_refract = in_mat.k_refract;
    n = in_mat.n;
    BRDF_id = in_mat.BRDF_id;
  }

  Material& operator=(const MGML::Material& in_mat)
  {
    Material::Material(in_mat);
    return *this;
  }
#endif

  universal_call float GetReflection() const {return k_reflect;}
  universal_call float GetRefraction() const {return k_refract;}
  universal_call float3 GetColor() const { return ka + kd + ks; }

  // phong model
  float3 ka;
  float3 kd;
  float3 ks;
  float power;

  // simple ray tracing components
  float  k_reflect;	  // reflective component
  float  k_refract;	  // refractive component
  float  n;			      // refractive exponent
  int BRDF_id; // BRDF index if BRDF used. If not, BRDF_id must be -1
};






}

