News for hackers. Stuff that matters.
Re:Photorealistic Path Tracer by duck2 on Sunday July 21, 2019 @06:43AM (#20490753)
The path tracer is impressive, doing it in a month's worth of work is impressive too :) I took a ray tracing course in second grade, and had to leave everything else and write ray tracers during the term.

And, as an item of nostalgia, here is some of my glossy mirror code:

  if(matl->t == M_GLOSSMIRROR){
      double θ0 = acos(cosθ), Δθ = M_PI * matl->rough / 2, lθ, dθ = 2*Δθ/ray->w, dφ = 2*dθ, θ, φ;
      lθ = (θ0 - Δθ) < 0 ? 0 : ((θ0 + Δθ) < M_PI ? (θ0 - Δθ) : (M_PI - 2*Δθ));
      θ = lθ + (p+RAND1)*dθ; φ = -2*Δθ + (q+RAND1)*dφ;
      v4 z = hit->n, x = norv4(subv4(ray->p, scv4(dotv4(ray->p, z), z))), y = crv4(x, z);
      ...
Re:Photorealistic Path Tracer by sfkdjf9j3j on Sunday July 21, 2019 @06:51AM (#20490769)
Now that is impressive. When I was in second grade I was still wrapping my head around addition and subtraction.
Re:Photorealistic Path Tracer by trishume on Sunday July 21, 2019 @09:48AM (#20491292)
I'm guessing that they're from a country where second grade means something different. That or I should have been looking for this school that teaches ray tracing in grade 2...
Re:Photorealistic Path Tracer by duck2 on Sunday July 21, 2019 @09:49AM (#20491295)
I meant second year in uni. Too much thinking in native language I guess.
Re:Photorealistic Path Tracer by CDSlice on Sunday July 21, 2019 @02:52PM (#20492990)
Still really impressive! I'm in my second year of college right now and I know I'd have a hard time with it even though I'd love to learn
Re:Photorealistic Path Tracer by duck2 on Saturday July 27, 2019 @12:04PM (#20542623)
It's simple to start! You can try writing a sphere-only, Blinn-Phong ray tracer already.