public CheckerTexture(BaseTexture _odd, BaseTexture _even, int _n = 50) { odd = _odd; even = _even; n = _n; }
public DefaultMaterial(BaseTexture _texture) { texture = _texture; }
private Vec3 diffuse;//散射系数或表面颜色,这里我作为表面颜色 public LambertianMaterial(Vec3 _diffuse, Vec3 _attenuation, BaseTexture _texture) { diffuse = _diffuse; //(1,1,1)表示(255,255,255). [0, 255]映射到[0, 1]区间 attenuation = _attenuation; //(0,0,0)到(1,1,1)区间的衰减系数 texture = _texture; }
private int phong_exp; //Phong exponent /// <summary> /// /// </summary> /// <param name="_diffuse">散射系数或表面颜色;(1,1,1)表示(255,255,255). [0, 255]映射到[0, 1]区间</param> /// <param name="_specular">高光系数或高光颜色;(1,1,1)表示(255,255,255). [0, 255]映射到[0, 1]区间</param> /// <param name="_phong_exp">Phong exponent</param> public PhongMaterial(Vec3 _diffuse, Vec3 _specular, int _phong_exp, Vec3 _attenuation, BaseTexture _texture) { diffuse = _diffuse; //(1,1,1)表示(255,255,255). [0, 255]映射到[0, 1]区间 specular = _specular; //同上 phong_exp = _phong_exp; attenuation = _attenuation; texture = _texture; }