Clean up renderer classes
This commit is contained in:
parent
24bf8753b2
commit
ba2d853319
4 changed files with 16 additions and 64 deletions
|
|
@ -1,29 +1,17 @@
|
|||
use ray_tracing_core::{camera::Camera, prelude::*, renderer::ClassicalRenderer, scene::Scene};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct DepthRenderer<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
pub struct DepthRenderer {
|
||||
width: u32,
|
||||
height: u32,
|
||||
rng: PhantomData<R>,
|
||||
}
|
||||
|
||||
impl<R> DepthRenderer<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
impl DepthRenderer {
|
||||
pub fn new(width: u32, height: u32) -> Self {
|
||||
Self {
|
||||
rng: PhantomData {},
|
||||
width,
|
||||
height,
|
||||
}
|
||||
Self { width, height }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for DepthRenderer<R>
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for DepthRenderer
|
||||
where
|
||||
S: Scene<R>,
|
||||
C: Camera<R>,
|
||||
|
|
|
|||
|
|
@ -1,29 +1,17 @@
|
|||
use ray_tracing_core::{camera::Camera, prelude::*, renderer::ClassicalRenderer, scene::Scene};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct NextEventEstimation<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
pub struct NextEventEstimation {
|
||||
width: u32,
|
||||
height: u32,
|
||||
rng: PhantomData<R>,
|
||||
}
|
||||
|
||||
impl<R> NextEventEstimation<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
impl NextEventEstimation {
|
||||
pub fn new(width: u32, height: u32) -> Self {
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
rng: PhantomData {},
|
||||
}
|
||||
Self { width, height }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for NextEventEstimation<R>
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for NextEventEstimation
|
||||
where
|
||||
S: Scene<R>,
|
||||
C: Camera<R>,
|
||||
|
|
|
|||
|
|
@ -1,29 +1,17 @@
|
|||
use ray_tracing_core::{camera::Camera, prelude::*, renderer::ClassicalRenderer, scene::Scene};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct PathTracer<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
pub struct PathTracer {
|
||||
width: u32,
|
||||
height: u32,
|
||||
rng: PhantomData<R>,
|
||||
}
|
||||
|
||||
impl<R> PathTracer<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
impl PathTracer {
|
||||
pub fn new(width: u32, height: u32) -> Self {
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
rng: PhantomData {},
|
||||
}
|
||||
Self { width, height }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for PathTracer<R>
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for PathTracer
|
||||
where
|
||||
S: Scene<R>,
|
||||
C: Camera<R>,
|
||||
|
|
|
|||
|
|
@ -1,29 +1,17 @@
|
|||
use ray_tracing_core::{camera::Camera, prelude::*, renderer::ClassicalRenderer, scene::Scene};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct PathTracerImportance<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
pub struct PathTracerImportance {
|
||||
width: u32,
|
||||
height: u32,
|
||||
rng: PhantomData<R>,
|
||||
}
|
||||
|
||||
impl<R> PathTracerImportance<R>
|
||||
where
|
||||
R: Rng,
|
||||
{
|
||||
impl PathTracerImportance {
|
||||
pub fn new(width: u32, height: u32) -> Self {
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
rng: PhantomData {},
|
||||
}
|
||||
Self { width, height }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for PathTracerImportance<R>
|
||||
impl<S, C, R> ClassicalRenderer<R, S, C> for PathTracerImportance
|
||||
where
|
||||
S: Scene<R>,
|
||||
C: Camera<R>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue