63 lines
1.8 KiB
Rust
63 lines
1.8 KiB
Rust
use crate::core::bssrdf::BSSRDF;
|
|
use crate::core::bxdf::{
|
|
BSDF, BxDF, CoatedConductorBxDF, CoatedDiffuseBxDF, ConductorBxDF, DielectricBxDF, DiffuseBxDF,
|
|
HairBxDF,
|
|
};
|
|
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::RelPtr;
|
|
use crate::utils::math::clamp;
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug)]
|
|
pub struct ConductorMaterial {
|
|
pub displacement: RelPtr<GPUFloatTexture>,
|
|
pub eta: RelPtr<GPUSpectrumTexture>,
|
|
pub k: RelPtr<GPUSpectrumTexture>,
|
|
pub reflectance: RelPtr<GPUSpectrumTexture>,
|
|
pub u_roughness: RelPtr<GPUFloatTexture>,
|
|
pub v_roughness: RelPtr<GPUFloatTexture>,
|
|
pub remap_roughness: bool,
|
|
pub normal_map: *const 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) -> *const Image {
|
|
todo!()
|
|
}
|
|
|
|
fn get_displacement(&self) -> RelPtr<GPUFloatTexture> {
|
|
todo!()
|
|
}
|
|
|
|
fn has_subsurface_scattering(&self) -> bool {
|
|
todo!()
|
|
}
|
|
}
|