class PhongMaterial extends Material { /* * Creates an instance of PhongMaterial. * @param {vec3f} color The material color * @param {Texture} colorMap The texture object of the material * @param {vec3f} specular The material specular coefficient * @param {float} intensity The light intensity * @member of PhongMaterial */ constructor(color,colorMap,specular,intensity) { let textureSample = 0; if( colorMap != null) { textureSample = 1; super({ 'uTextureSampler': {type:'li',value:textureSample}, 'uSampler' : {type:'texture',value:colorMap}, 'uKd' : {type:'3fv',value : color}, 'uKs' : {type:'3fv',value: specular}, 'uLightIntensity' : {type:'lf',value:intensity} },[],PhongVertexShader,PhongFragmentShader); }else{ console.log(color); super({ 'uTextureSampler': {type:'li',value:textureSample}, 'uKd' : {type:'3fv',value : color}, 'uKs' : {type:'3fv',value: specular}, 'uLightIntensity' : {type:'lf',value:intensity} },[],PhongVertexShader,PhongFragmentShader); } } }