fixed bug in util/Vector::reflect(), Phong shading getting much closer
git-svn-id: svn://anubis/fart/trunk@73 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
parent
41b4354d52
commit
6fbdf46122
@ -151,8 +151,6 @@ void Scene::renderPixel(int x, int y, unsigned char * pixel)
|
||||
}
|
||||
|
||||
/* take the average of all the samples as the final pixel value */
|
||||
if (finalColor.r > 1.0 || finalColor.g > 1.0 || finalColor.b > 1.0)
|
||||
cerr << "Error: " << finalColor << endl;
|
||||
pixel[BMP_RED] = (unsigned char)
|
||||
(0xFF * finalColor.r / m_multisample_level_squared);
|
||||
pixel[BMP_GREEN] = (unsigned char)
|
||||
|
@ -60,7 +60,7 @@ Vector Vector::reflect(const Vector & target) const
|
||||
{
|
||||
Vector projected = proj(target);
|
||||
Vector me_to_proj = projected - (*this);
|
||||
return projected + me_to_proj * 2.0;
|
||||
return (*this) + me_to_proj * 2.0;
|
||||
}
|
||||
|
||||
std::ostream & operator<<(std::ostream & out, const Vector & v)
|
||||
|
Loading…
x
Reference in New Issue
Block a user