Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ColorVertex updateColor(ColorVertex v)
- {
- float rat;
- if (day)
- {
- rat = max(D3DXVec3Dot(&v._normal, &pNormSun), -1) + 1;
- }
- else
- {
- rat = max(D3DXVec3Dot(&v._normal, &pNormMoon), -1) + 1;
- }
- rat /= 2.0;
- rat = min(rat, 1.0);
- rat *= intensity;
- D3DXCOLOR newColor;
- newColor = v._baseColor;
- newColor = newColor * rat;
- newColor.a = 1.0;
- v._color = newColor;
- //v._color = v._color * ratio;
- return v;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement