add Lambertian material
This commit is contained in:
parent
3296ea3e81
commit
b3c47a914f
7 changed files with 85 additions and 19 deletions
|
@ -1,12 +1,14 @@
|
|||
const Point3 = @import("vec3.zig").Point3;
|
||||
const Vec3 = @import("vec3.zig").Vec3;
|
||||
const Ray = @import("ray.zig").Ray;
|
||||
const Material = @import("material.zig").Material;
|
||||
|
||||
pub const HitRecord = struct {
|
||||
p: Point3,
|
||||
normal: Vec3,
|
||||
t: f32,
|
||||
front_face: bool,
|
||||
material: Material,
|
||||
|
||||
pub fn setFaceNormal(hit: *HitRecord, ray: Ray, outward_normal: Vec3) void {
|
||||
const front_face = Vec3.dot(ray.direction, outward_normal) < 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue