Add dielectric material

This commit is contained in:
2025-09-23 15:36:08 +01:00
parent cdc56a119f
commit 1eb8fd3067
7 changed files with 73 additions and 12 deletions

View File

@@ -49,9 +49,14 @@ vec3_t vec3_hadamard(vec3_t v, vec3_t u)
};
}
double vec3_len_squared(vec3_t v)
{
return v.x * v.x + v.y * v.y + v.z * v.z;
}
double vec3_len(vec3_t v)
{
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
return sqrt(vec3_len_squared(v));
}
vec3_t vec3_unit(vec3_t v)