zauonlok/renderer

The code is great!

eigenbom opened this issue · 3 comments

I love how minimal and clean this code is. Do you have any other open source projects? I'd love to take a look.

Thanks! Currently, this is my only open source project. I'm looking forward to writing a raytracer from scratch. But I'm still learning basic ray tracing theory from PBRT.

@zauonlok while you are at it you may want to take a look at clang vector extensions.

https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors

they helped me with my raytracers and relieved me of writing a lot of vec3_operation functions

// definition
typedef float vec3 __attribute__((ext_vector_type(3)));
const float EPSILON = 0.0001f;

// some  simple usage  
ray->origin = hit.position + hit.normal * EPSILON;
ray->direction = vec3_reflect(&ray->direction, &hit.normal);

Thanks! Currently, this is my only open source project. I'm looking forward to writing a raytracer from scratch. But I'm still learning basic ray tracing theory from PBRT.

Okay, have fun!