Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering progress preview with tev #142

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
.idea
*.lock
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ blend_info = "0.2.9"
byteorder = "1.4.3"
crossbeam = "0.8.2"
crossbeam-channel = "0.5.6"
crossbeam-utils = "0.8.5"
hexf = "0.2.1"
image = "0.24.3"
impl_ops = "0.1.1"
lazy_static = "1.4.0"
num = "0.4.0"
num_cpus = "1.13.1"
murmurhash64 = "0.3.1"
pbr = "1.0.4"
pest = "2.3.0"
pest_derive = "2.3.0"
Expand All @@ -36,6 +38,7 @@ structopt = "0.3.26"
strum = "0.24.1"
strum_macros = "0.24.3"
typed-arena = "2.0.1"
tev_client = "0.5.2"

[[bin]]
name = "rs_pbrt"
Expand Down
2 changes: 1 addition & 1 deletion examples/parse_ass_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ fn main() -> std::io::Result<()> {
if let Some(mut integrator) = some_integrator {
let scene = make_scene(&primitives, lights);
let num_threads: u8 = num_cpus::get() as u8;
integrator.render(&scene, num_threads);
integrator.render(&scene, num_threads, None);
} else {
panic!("Unable to create integrator.");
}
Expand Down
4 changes: 2 additions & 2 deletions src/bin/parse_blend_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3543,7 +3543,7 @@ fn main() -> std::io::Result<()> {
if let Some(mut integrator) = some_integrator {
let scene = make_scene(&render_options.primitives, render_options.lights);
let num_threads: u8 = num_cpus::get() as u8;
integrator.render(&scene, num_threads);
integrator.render(&scene, num_threads, None);
} else {
panic!("Unable to create integrator.");
}
Expand All @@ -3570,7 +3570,7 @@ fn main() -> std::io::Result<()> {
if let Some(mut integrator) = some_integrator {
let scene = make_scene(&render_options.primitives, render_options.lights);
let num_threads: u8 = num_cpus::get() as u8;
integrator.render(&scene, num_threads);
integrator.render(&scene, num_threads, None);
} else {
panic!("Unable to create integrator.");
}
Expand Down
5 changes: 5 additions & 0 deletions src/bin/rs_pbrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ struct Cli {
/// The path to the file to read
#[structopt(parse(from_os_str))]
path: std::path::PathBuf,
/// The address and port of the display server
#[structopt(long = "--display-server")]
display_server: Option<String>,
}

// Accelerator
Expand Down Expand Up @@ -895,6 +898,7 @@ fn main() {
let cropx1: f32 = args.cropx1;
let cropy0: f32 = args.cropy0;
let cropy1: f32 = args.cropy1;
let display_server: Option<String> = args.display_server;
let num_cores = num_cpus::get();
let git_describe = option_env!("GIT_DESCRIBE").unwrap_or("unknown");
println!(
Expand All @@ -910,6 +914,7 @@ fn main() {
cropx1,
cropy0,
cropy1,
display_server
);
parse_file(
args.path.into_os_string().into_string().unwrap(),
Expand Down
7 changes: 6 additions & 1 deletion src/core/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub struct ApiState {
pushed_transforms: Vec<TransformSet>,
pushed_active_transform_bits: Vec<u8>,
param_set: ParamSet,
display_server: Option<String>,
}

impl Default for ApiState {
Expand Down Expand Up @@ -163,6 +164,7 @@ impl Default for ApiState {
pushed_transforms: Vec::new(),
pushed_active_transform_bits: Vec::new(),
param_set: ParamSet::default(),
display_server: None,
}
}
}
Expand Down Expand Up @@ -2346,6 +2348,7 @@ pub fn pbrt_init(
cropx1: f32,
cropy0: f32,
cropy1: f32,
display_server: Option<String>
) -> (ApiState, BsdfState) {
let mut api_state: ApiState = ApiState::default();
let bsdf_state: BsdfState = BsdfState::default();
Expand All @@ -2361,6 +2364,7 @@ pub fn pbrt_init(
y: clamp_t(cropy1.max(cropy0), 0.0, 1.0),
},
};
api_state.display_server = display_server;
(api_state, bsdf_state)
}

Expand All @@ -2381,7 +2385,8 @@ pub fn pbrt_cleanup(api_state: &ApiState, integrator_arg: &Option<String>) {
if let Some(mut integrator) = some_integrator {
let scene = api_state.render_options.make_scene();
let num_threads: u8 = api_state.number_of_threads;
integrator.render(&scene, num_threads);
let display_server = api_state.display_server.clone();
integrator.render(&scene, num_threads, display_server);
} else {
panic!("Unable to create integrator.");
}
Expand Down
Loading