New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of tweaks! #10

Merged
merged 10 commits into from Apr 12, 2018
Prev

More algebra! (120 Mrays/s -> 124 Mrays/s)

  • Loading branch information...
rygorous committed Apr 12, 2018
commit 66958597fbd388fdf395a692755496fae197a5ec
Copy path View file
@@ -109,8 +109,8 @@ static bool Scatter(const Material& mat, const Ray& r_in, const Hit& rec, float3
float cosA = 1.0f - eps1 + eps1 * cosAMax;
float sinA = sqrtf(1.0f - cosA*cosA);
float phi = 2 * kPI * eps2;
float3 l = su * cosf(phi) * sinA + sv * sin(phi) * sinA + sw * cosA;
l = normalize(l);
float3 l = su * (cosf(phi) * sinA) + sv * (sinf(phi) * sinA) + sw * cosA;
//l = normalize(l); // NOTE(fg): This is already normalized, by construction.
// shoot shadow ray
Hit lightHit;
ProTip! Use n and p to navigate between commits in a pull request.