Skip to content

Commit c11534a

Browse files
committed
bump
1 parent c3d1c92 commit c11534a

File tree

11 files changed

+230
-277
lines changed

11 files changed

+230
-277
lines changed

Cargo.lock

Lines changed: 213 additions & 258 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#[tokio::main]
2-
async fn main() {
1+
fn main() {
32
#[cfg(feature = "oidn")]
43
{
5-
oidn::setup_oidn_environment().await;
4+
oidn::setup_oidn_environment();
65
}
76
}
87

default.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ pkgs ? import <nixpkgs> {} }:
2-
1+
{pkgs ? import <nixpkgs> {}}:
32
pkgs.mkShell {
43
buildInputs = with pkgs; [
54
openssl

renders/checkered_floor.png

-439 Bytes
Loading

renders/cornell_box.png

-3.28 KB
Loading

renders/mirror_ball.png

-1.25 KB
Loading

renders/red_ball.png

-4.72 KB
Loading

renders/scene.png

-3.48 MB
Loading

shell.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ pkgs ? import <nixpkgs> { } }:
2-
1+
{pkgs ? import <nixpkgs> {}}:
32
pkgs.mkShell {
43
buildInputs = with pkgs; [
54
openssl

src/material/mod.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,20 @@ impl Material {
128128

129129
pub fn color(&self, uv: &Option<Float2>) -> Float3 {
130130
if self.checkered {
131-
match uv {
132-
Some(uv) => {
133-
let u = uv.x();
134-
let v = uv.y();
135-
136-
// return Vec3::new([*u, *v, 0.0]);
137-
if (((u * 10.0).floor() as i32) + ((v * 10.0).floor() as i32)) % 2 == 0 {
138-
Float3::new([0.0, 0.0, 0.0])
139-
} else {
140-
Float3::new([1.0, 1.0, 1.0])
141-
}
131+
if let Some(uv) = uv {
132+
// Clamp coordinates to [0, 1)
133+
let u = uv.x().rem_euclid(1.0);
134+
let v = uv.y().rem_euclid(1.0);
135+
// Multiply to get grid cell index; these will be in a small range.
136+
let grid_u = (u * 10.0).floor() as i32;
137+
let grid_v = (v * 10.0).floor() as i32;
138+
if (grid_u + grid_v) % 2 == 0 {
139+
Float3::new([0.0, 0.0, 0.0])
140+
} else {
141+
Float3::new([1.0, 1.0, 1.0])
142142
}
143-
None => self.albedo,
143+
} else {
144+
self.albedo
144145
}
145146
} else {
146147
self.albedo

0 commit comments

Comments
 (0)