Skip to content

Commit

Permalink
bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
flomonster committed Jul 29, 2024
1 parent 98d42c1 commit 7bdaf28
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ authors = [
"Florian Amsallem <[email protected]>",
"Alexandre Lamure <[email protected]>",
]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cgmath = "0.18.0"
clap = { version = "4.1.4", features = ["derive", "env"] }
clap = { version = "4.5.11", features = ["derive", "env"] }
derivative = "2.2.0"
easy-gltf = "1.0.0"
image = "0.24.5"
easy-gltf = "1.1.2"
image = "0.25.2"
kdtree-ray = "1.2.0"
once_cell = "1.17.0"
pbr = "1.0.4"
rand = "0.8.5"
rayon = "1.6.1"
serde = { version = "1.0.152", features = ["derive"] }
serde_yaml = "0.9.17"
serde_json = "1.0.91"
sfml = "0.16.0"
serde = { version = "1.0.204", features = ["derive"] }
serde_yaml = "0.9.34+deprecated"
serde_json = "1.0.121"
sfml = "0.20.0"
sha-1 = "0.10.1"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ This project is an implementation of Monte Carlo path tracing in **Rust**.
![](readme/ps5_b5_s128.png "PS5 5bounces, 128samples")


## Requirements

- [SFML 2.5](https://www.sfml-dev.org/download.php)

## How to use ?

The renderer takes a custom Internal Scene Format (isf) as input.
Expand All @@ -32,7 +36,7 @@ path-tracer render scene.isf -o my-render.png -p profile.yml # Render a scene wi

## Profile

Profile files are used to configure the renderer behaviour.
Profile files are used to configure the renderer behaviour.

| Option | Description | Default |
|------------|----------------|-------------------|
Expand Down
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@
nativeBuildInputs = [
rustChan
mold-wrapped
sfml
csfml
];
buildInputs =
[
# Tools
cargo-watch
taplo

# Libs
sfml
csfml

# Nix formatter
alejandra.defaultPackage.${system}
];
Expand Down
9 changes: 5 additions & 4 deletions src/renderer/viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ fn run(resolution: Resolution, recv: ReceiverPixel) {
&Default::default(),
);
let mut image = Image::new(resolution.width, resolution.height);
let mut texture = Texture::new(resolution.width, resolution.height).unwrap();
let mut view = View::from_rect(&FloatRect::new(
let mut texture = Texture::new().unwrap();
assert!(texture.create(resolution.width, resolution.height));
let mut view = View::from_rect(FloatRect::new(
0.,
0.,
resolution.width as f32,
Expand Down Expand Up @@ -82,7 +83,7 @@ fn run(resolution: Resolution, recv: ReceiverPixel) {

let start = Instant::now();
for (pos_x, pos_y, color) in recv.try_iter() {
image.set_pixel(pos_x, pos_y, color);
unsafe { image.set_pixel(pos_x, pos_y, color) };
if start.elapsed() > Duration::from_secs(1) / 60 {
break;
}
Expand All @@ -91,7 +92,7 @@ fn run(resolution: Resolution, recv: ReceiverPixel) {
// Draw the image
window.clear(Color::BLACK);
window.set_view(&view);
texture.update_from_image(&image, 0, 0);
unsafe { texture.update_from_image(&image, 0, 0) };
let sprite = Sprite::with_texture(&texture);
window.draw(&sprite);

Expand Down
6 changes: 1 addition & 5 deletions src/scene/gltf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,7 @@ impl From<easy_gltf::Camera> for Camera {

impl From<easy_gltf::model::Triangle> for Triangle {
fn from(triangle: easy_gltf::model::Triangle) -> Self {
Self(
triangle[0].clone().into(),
triangle[1].clone().into(),
triangle[2].clone().into(),
)
Self(triangle[0].into(), triangle[1].into(), triangle[2].into())
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/scene/internal/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ pub struct Camera {
pub fov: Rad<f32>,

/// The distance to the far clipping plane.
#[allow(dead_code)]
pub zfar: f32,

/// The distance to the near clipping plane.
#[allow(dead_code)]
pub znear: f32,
}

Expand Down
1 change: 1 addition & 0 deletions src/scene/internal/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub enum Light {
Point {
position: Vector3<f32>,
color: Vector3<f32>,
#[allow(dead_code)]
size: f32,
},
Directional {
Expand Down

0 comments on commit 7bdaf28

Please sign in to comment.