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

Allow blackbody param type #32

Closed
wahn opened this issue Dec 5, 2017 · 1 comment
Closed

Allow blackbody param type #32

wahn opened this issue Dec 5, 2017 · 1 comment
Assignees
Labels

Comments

@wahn
Copy link
Owner

wahn commented Dec 5, 2017

The updated/new scene from the PBRT input file documentation contains a blackbody parameter:

http://www.pbrt.org/fileformat-v3.html#example

> rg blackbody assets/scenes/example.pbrt -B 1
17-LightSource "distant"  "point from" [ -30 40  100 ]
18:   "blackbody L" [3000 1.5]

Currently the parser can't handle it:

> ./target/release/examples/pest_test -i assets/scenes/example.pbrt 
FILE = assets/scenes/example.pbrt
search_directory is /home/jan/git/self_hosted/Rust/pbrt/assets/scenes
992 bytes read
thread 'main' panicked at '  --> 18:4
   |
18 |    "blackbody L" [3000 1.5]
   |    ^---
   |
   = expected statement, parameter, or last_statement', examples/pest_test.rs:1400:44
note: Run with `RUST_BACKTRACE=1` for a backtrace.

The task is to allow those parameters and to handle them before calling e.g. the constructor of a light.

@wahn wahn added the task label Dec 5, 2017
@wahn wahn self-assigned this Dec 5, 2017
@wahn
Copy link
Owner Author

wahn commented Dec 5, 2017

Commit 73b7666 resolves the issue.

The test scene renders fine now:

pbrt

> imf_diff -d -f simple.png pbrt.png diff.jpg
differing pixels:	  0.338% (541 of 160000)
average difference:	  2.137%
maximum difference:	  7.692%
Summary: Some pixels differ slightly.
== "simple.png" and "pbrt.png" are similar

There is a difference to the C++ version, but that's not too bad:

diff

@wahn wahn closed this as completed Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant