pbrt-v3 source code now available

Practical and theoretical implementation discussion.
cozdas
Posts: 2
Joined: Wed Dec 14, 2011 10:57 pm

Re: pbrt-v3 source code now available

Postby cozdas » Sat Aug 08, 2015 1:54 am

Great news! Thanks for this book Matt, it's a real gem.

I've got one request though: It'd be great if you can release the book in "print replica" format. The format of the existing (v2) edition generates hard-to-follow page layouts with disproportional elements in the page (sample page attached to demonstrate my point). Realtime Rendering is a good example of the "print replica" format. With pbrt's larger pages and smaller texts it might be tricky to do but I'd appreciate if you at least consider that.
Attachments
Screen Shot 2015-08-07 at 18.46.50.png
Screen Shot 2015-08-07 at 18.46.50.png (672.18 KiB) Viewed 4757 times

ziu
Posts: 28
Joined: Sat Aug 17, 2013 8:46 pm

Re: pbrt-v3 source code now available

Postby ziu » Fri Aug 14, 2015 8:44 pm

Thanks a lot for the code Matt! I have been using the CPU HLBVH builder code and been throwing all test scenes at it and so far it seems to be holding ok. I only had an issue with scenes where I had infinite size primitives (e.g. half-spaces in an extension I added) so I ended up removing those prior to construction.

toxie
Posts: 118
Joined: Mon Nov 28, 2011 12:30 pm
Location: germany
Contact:

Re: pbrt-v3 source code now available

Postby toxie » Tue Aug 25, 2015 5:00 pm

In https://github.com/mmp/pbrt-v3/blob/mas ... brt.h#L235 and https://github.com/mmp/pbrt-v3/blob/mas ... brt.h#L249
the checks for +0.0 and -0.0 are not correct, as by IEEE754 +0.0 == -0.0 is true. So you want to check this special case with the uint you're getting below instead.

EDIT: oh, forget about it, the code of course still will do what is actually needed. time to stop staring at code now, i guess.. ;)
Better you leave here with your head still full of kitty cats and puppy dogs.

ziu
Posts: 28
Joined: Sat Aug 17, 2013 8:46 pm

Re: pbrt-v3 source code now available

Postby ziu » Wed Sep 02, 2015 11:09 am

I did a change to the code. I had issues with some scenes with abnormal bounding boxes (too small) blowing up the program by triggering this assert :

Code: Select all

Assert(centroidBounds.pMax[dim] != centroidBounds.pMin[dim]);

https://github.com/mmp/pbrt-v3/blob/mas ... h.cpp#L527

So I changed the code in BVHAccel::buildUpperSAH to be like this:

Code: Select all

int mid;
if (centroidBounds.pMax[dim] != centroidBounds.pMin[dim]) {
    // do the fancy split position finding method.
    mid = pmid - treelet_roots;
} else {
    mid = start + (end - start)/2;
}


I know its a bit of a hack, but at least it can still find a split point somewhere and generate a viable BVH.

Hope it helps,


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 2 guests