wahn/rs_pbrt

MakeMedium "heterogeneous"

wahn opened this issue · 1 comments

wahn commented

The Rust side can't handle a heterogeneous medium (yet):

$ pwd
/home/jan/Graphics/Rendering/PBRT/pbrt-v3-scenes/cloud
$ ~/git/self_hosted/Rust/pbrt/target/release/examples/rs_pbrt -i f15-4a.pbrt
...
thread 'main' panicked at 'TODO: make_medium("heterogeneous")', src/core/api.rs:597:9

The panic is caused by this line:

fn make_medium(api_state: &mut ApiState) {                                                              
...
    if medium_type == "homogeneous" {                                                                   
        some_medium = Some(Arc::new(HomogeneousMedium::new(&sig_a, &sig_s, g)));                        
    } else if medium_type == "heterogeneous" {                                                          
        panic!("TODO: make_medium(\"heterogeneous\")");                                                 
    } else {                                                                                            
        panic!("MakeMedium: unknown name {}", medium_type);                                             
    }                                                                                                   
...
}
> rg -trust heterogeneous
src/core/api.rs
596:    } else if medium_type == "heterogeneous" {
597:        panic!("TODO: make_medium(\"heterogeneous\")");

Lets add the missing code to handle such a medium ...

wahn commented

We also need a VolPathIntegrator (see issue #92) ...