-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
seperate const generic vector types and hardcoded, we should profile …
…them later
- Loading branch information
Showing
31 changed files
with
632 additions
and
273 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#![feature(generic_const_exprs)] | ||
pub mod camera; | ||
pub mod light; | ||
pub mod material; | ||
|
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
use crate::{scene::FloatSize, utils::vector::Vec3}; | ||
use crate::{scene::Flooat, utils::vector::Float3}; | ||
|
||
use super::Light; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct Arealight {} | ||
|
||
impl Light for Arealight { | ||
fn illuminate(&self) -> Vec3<FloatSize> { | ||
fn illuminate(&self) -> Float3 { | ||
todo!() | ||
} | ||
|
||
fn position(&self) -> Vec3<FloatSize> { | ||
fn position(&self) -> Float3 { | ||
todo!() | ||
} | ||
|
||
fn intensity(&self) -> FloatSize { | ||
fn intensity(&self) -> Flooat { | ||
todo!() | ||
} | ||
|
||
fn color(&self) -> Vec3<FloatSize> { | ||
fn color(&self) -> Float3 { | ||
todo!() | ||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,32 @@ | ||
use crate::{scene::FloatSize, utils::vector::Vec3}; | ||
use crate::{scene::Flooat, utils::vector::Float3}; | ||
|
||
use super::Light; | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct PointLight { | ||
position: Vec3<FloatSize>, | ||
color: Vec3<FloatSize>, | ||
position: Float3, | ||
color: Float3, | ||
} | ||
|
||
impl PointLight { | ||
pub fn new(position: Vec3<FloatSize>, color: Vec3<FloatSize>) -> Self { | ||
pub fn new(position: Float3, color: Float3) -> Self { | ||
PointLight { position, color } | ||
} | ||
} | ||
|
||
impl Light for PointLight { | ||
fn illuminate(&self) -> Vec3<FloatSize> { | ||
fn illuminate(&self) -> Float3 { | ||
self.color | ||
} | ||
|
||
fn position(&self) -> Vec3<FloatSize> { | ||
fn position(&self) -> Float3 { | ||
self.position | ||
} | ||
|
||
fn intensity(&self) -> FloatSize { | ||
fn intensity(&self) -> Flooat { | ||
self.color.length() | ||
} | ||
|
||
fn color(&self) -> Vec3<FloatSize> { | ||
fn color(&self) -> Float3 { | ||
self.color | ||
} | ||
} |
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
Oops, something went wrong.