Advertisement
Guest User

material funkce

a guest
Nov 14th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1.  
  2. Vector3 Material::Diffuse(const Coord2f * tex_coord) const
  3. {
  4. if (tex_coord)
  5. {
  6. Texture * texture = textures_[kDiffuseMapSlot];
  7. if (texture)
  8. {
  9. Color3f color = texture->get_texel(tex_coord->u, tex_coord->v);
  10. Vector3 dif;
  11. dif.x = color.r;
  12. dif.y = color.g;
  13. dif.z = color.b;
  14. return dif;
  15. }
  16. }
  17. return diffuse;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement