Add progress bars and argument parsing

This commit is contained in:
David 2021-08-29 21:24:17 +02:00
commit a45ae025d6
7 changed files with 4897 additions and 29 deletions

View file

@ -92,6 +92,11 @@ typedef vec3 color;
/* More overloads */
inline bool operator==(const vec3 &u, const vec3 &v)
{
return u.x == v.x && u.y == v.y && u.z == v.z;
}
// Straightforward vector sum
inline vec3 operator+(const vec3 &u, const vec3 &v)
{
@ -191,7 +196,7 @@ vec3 reflect(const vec3& v, const vec3 n)
return v - 2*dot(v,n)*n;
}
vec3 refract (const vec3& uv, const vec3& n, float etai_over_etat)
vec3 refract(const vec3& uv, const vec3& n, float etai_over_etat)
{
float cos_theta = fmin(dot(-uv, n), 1.0);
vec3 r_out_perp = etai_over_etat * (uv + cos_theta*n);