use crate::bxdfs::{
    CoatedConductorBxDF, CoatedDiffuseBxDF, ConductorBxDF, DielectricBxDF, DiffuseBxDF, HairBxDF,
};
use crate::core::bsdf::BSDF;
use crate::core::bssrdf::BSSRDF;
use crate::core::bxdf::BxDF;
use crate::core::image::Image;
use crate::core::material::{Material, MaterialEvalContext, MaterialTrait};
use crate::core::scattering::TrowbridgeReitzDistribution;
use crate::core::spectrum::{Spectrum, SpectrumTrait};
use crate::core::texture::{GPUFloatTexture, GPUSpectrumTexture, TextureEvaluator};
use crate::spectra::{SampledSpectrum, SampledWavelengths};
use crate::utils::Ptr;
use crate::utils::math::clamp;

#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConductorMaterial {
    pub displacement: Ptr<GPUFloatTexture>,
    pub eta: Ptr<GPUSpectrumTexture>,
    pub k: Ptr<GPUSpectrumTexture>,
    pub reflectance: Ptr<GPUSpectrumTexture>,
    pub u_roughness: Ptr<GPUFloatTexture>,
    pub v_roughness: Ptr<GPUFloatTexture>,
    pub remap_roughness: bool,
    pub normal_map: Ptr<Image>,
}

impl MaterialTrait for ConductorMaterial {
    fn get_bsdf<T: TextureEvaluator>(
        &self,
        _tex_eval: &T,
        _ctx: &MaterialEvalContext,
        _lambda: &SampledWavelengths,
    ) -> BSDF {
        todo!()
    }
    fn get_bssrdf<T>(
        &self,
        _tex_eval: &T,
        _ctx: &MaterialEvalContext,
        _lambda: &SampledWavelengths,
    ) -> Option<BSSRDF> {
        todo!()
    }
    fn can_evaluate_textures(&self, tex_eval: &dyn TextureEvaluator) -> bool {
        tex_eval.can_evaluate(
            &[self.u_roughness, self.v_roughness],
            &[self.eta, self.k, self.reflectance],
        )
    }

    fn get_normal_map(&self) -> Option<&Image> {
        todo!()
    }

    fn get_displacement(&self) -> Ptr<GPUFloatTexture> {
        todo!()
    }

    fn has_subsurface_scattering(&self) -> bool {
        todo!()
    }
}
