Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 Material::Diffuse(const Coord2f * tex_coord) const
- {
- if (tex_coord)
- {
- Texture * texture = textures_[kDiffuseMapSlot];
- if (texture)
- {
- Color3f color = texture->get_texel(tex_coord->u, tex_coord->v);
- Vector3 dif;
- dif.x = color.r;
- dif.y = color.g;
- dif.z = color.b;
- return dif;
- }
- }
- return diffuse;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement