Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1.  
  2. ColorVertex updateColor(ColorVertex v)
  3. {
  4. float rat;
  5. if (day)
  6. {
  7. rat = max(D3DXVec3Dot(&v._normal, &pNormSun), -1) + 1;
  8. }
  9. else
  10. {
  11. rat = max(D3DXVec3Dot(&v._normal, &pNormMoon), -1) + 1;
  12.  
  13. }
  14. rat /= 2.0;
  15. rat = min(rat, 1.0);
  16. rat *= intensity;
  17. D3DXCOLOR newColor;
  18. newColor = v._baseColor;
  19. newColor = newColor * rat;
  20. newColor.a = 1.0;
  21. v._color = newColor;
  22. //v._color = v._color * ratio;
  23.  
  24.  
  25. return v;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement