-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for the raytracing. (#252)
* It closes #245, Increases the foreign-type version, Adds a new example for showing raytracing capabilities in metal 3. CI action version increase code improvement in foreign_obj_type macro. And adding several other needed features in the code. * Increases the version of the Rust * Build fix for mps module and a warning has been removed. * fixing the build for stable * cargo test fix * a little doc * All of the uniquely borrowed refrences removed. * several warning fixed in the ratracing example, it was due to the recent change in the API * All the modules now private again and only the mps one is public.
- Loading branch information
1 parent
27dc596
commit b710f05
Showing
39 changed files
with
2,082 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Raytracing | ||
|
||
A good showcase of Metal 3 raytracing features. | ||
|
||
![Screenshot of the final render](./screenshot.png) | ||
|
||
## To Run | ||
|
||
``` | ||
cargo run --example raytracing | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use glam::f32::Vec4; | ||
|
||
#[repr(C)] | ||
pub struct Camera { | ||
pub position: Vec4, | ||
pub right: Vec4, | ||
pub up: Vec4, | ||
pub forward: Vec4, | ||
} | ||
|
||
impl Camera { | ||
pub fn new() -> Self { | ||
Self { | ||
position: Vec4::new(0.0, 3.0, 10.0, 0.0), | ||
right: Vec4::new(1.0, 0.0, 0.0, 0.0), | ||
up: Vec4::new(0.0, 1.0, 0.0, 0.0), | ||
forward: Vec4::new(0.0, 0.0, -1.0, 0.0), | ||
} | ||
} | ||
} |
Oops, something went wrong.