SQBVH

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Re: SQBVH

Postby bighouse » Mon Feb 27, 2012 2:26 am

I must have cloned the repository too soon. The fix was listed on the web page when I did it, but wasn't in the source on my machine. Everything works now.
bighouse
 
Posts: 22
Joined: Mon Sep 06, 2010 11:48 pm

Re: SQBVH

Postby J the Ninja » Mon Feb 27, 2012 2:57 am

When I tested it, I saw this message in the log, on more complex scenes a whole bunch of times in a row:

[2012-02-26 23:48:38 Warning: 12] A primitive used in a SQBVH isn't a triangle, falling back to 'object split'-only building

This message seems to come from any shape that is uses plymesh, even though the PLY loader triangulates everything by default? EDIT: Not everything that uses plymesh, some are ok. But why would it give this message on a mesh that contains only tris?


Also, several scenes including Luxball5 seem to produce a crash:

Code: Select all
Crashed Thread:  5

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000107e88b38

VM Regions Near 0x107e88b38:
    MALLOC_TINY            0000000107900000-0000000107a00000 [ 1024K] rw-/rwx SM=PRV 
--> mapped file            0000000107a00000-0000000107e89000 [ 4644K] r--/rwx SM=COW  /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/Resources/ArtFile.bin
    Stack                  0000000107e89000-0000000107e8a000 [    4K] ---/rwx SM=NUL 

Thread 5 Crashed:
0   liblux.dylib                     0x00000001002fef44 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 20
1   liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
2   liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
3   liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
4   liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
5   liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
6   liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
7   liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
8   liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
9   liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
10  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
11  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
12  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
13  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
14  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
15  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
16  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
17  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
18  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
19  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
20  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
21  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
22  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
23  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
24  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
25  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
26  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
27  liblux.dylib                     0x000000010030223e lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13070
28  liblux.dylib                     0x0000000100302210 lux::SQBVHAccel::BuildTree(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, std::vector<lux::BBox, std::allocator<lux::BBox> > const&, lux::BBox const&, int, int, int) + 13024
29  liblux.dylib                     0x0000000100302f59 lux::SQBVHAccel::CreateAccelerator(std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, lux::ParamSet const&) + 2889
30  liblux.dylib                     0x00000001001ea240 lux::MakeAccelerator(std::string const&, std::vector<boost::shared_ptr<lux::Primitive>, std::allocator<boost::shared_ptr<lux::Primitive> > > const&, lux::ParamSet const&) + 576
31  liblux.dylib                     0x00000001001dc224 lux::Context::RenderOptions::MakeScene() const + 2516
32  liblux.dylib                     0x00000001001daeac lux::Context::WorldEnd() + 1100
33  liblux.dylib                     0x0000000100183f27 yyparse() + 16071
34  liblux.dylib                     0x000000010018851b parseFile(char const*) + 347
35  liblux.dylib                     0x0000000100188667 luxParse + 23
36  org.luxrender.luxrender          0x0000000100036e11 0x100000000 + 224785
37  org.luxrender.luxrender          0x000000010004bf17 0x100000000 + 311063
38  org.luxrender.luxrender          0x000000010004be9a 0x100000000 + 310938
39  liblux.dylib                     0x000000010059ec60 thread_proxy + 160
40  libsystem_c.dylib                0x00007fff941298bf _pthread_start + 335
41  libsystem_c.dylib                0x00007fff9412cb75 thread_start + 13
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SQBVH

Postby J the Ninja » Mon Feb 27, 2012 3:09 am

An update to the above post: there seems to be some connection to loading a scene again? For some reason, rendering luxball5 with sqbvh works once, but then doesn't work again afterward???
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SQBVH

Postby SATtva » Mon Feb 27, 2012 5:19 am

J the Ninja wrote:When I tested it, I saw this message in the log, on more complex scenes a whole bunch of times in a row:

[2012-02-26 23:48:38 Warning: 12] A primitive used in a SQBVH isn't a triangle, falling back to 'object split'-only building

This message seems to come from any shape that is uses plymesh, even though the PLY loader triangulates everything by default? EDIT: Not everything that uses plymesh, some are ok. But why would it give this message on a mesh that contains only tris?

I can see these messages even without PLY objects at all with all geometry exported in Lux lxo format, even when there is no non-triangle geometry (e.g. microdisplacement) in the scene.

I can also clearly see some missing faces in the output:
part1-qbvh.jpg
QBVH
part1-sqbvh.jpg
SQBVH

part2-qbvh.jpg
QBVH
part2-sqbvh.jpg
SQBVH
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5496
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: SQBVH

Postby Dade » Mon Feb 27, 2012 11:28 am

J the Ninja wrote:When I tested it, I saw this message in the log, on more complex scenes a whole bunch of times in a row:

[2012-02-26 23:48:38 Warning: 12] A primitive used in a SQBVH isn't a triangle, falling back to 'object split'-only building

This message seems to come from any shape that is uses plymesh, even though the PLY loader triangulates everything by default? EDIT: Not everything that uses plymesh, some are ok. But why would it give this message on a mesh that contains only tris?


I should have fixed this problem, it was caused by AreaLightPrimitive. AreaLightPrimitive is just a container for another primitive (for instance a triangle) and the code has to extract the stored primitive in order to build the SQBVH.

Note: SBVH needs to be able to clip primitives with planes. While I'm not going to write the support for spheres, cones and other exotic primitives, anything polygon based should work. If it is doesn't, it is because a missed a polygonal Primitive type like above.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SQBVH

Postby jeanphi » Mon Feb 27, 2012 12:34 pm

Dade wrote:Note: SBVH needs to be able to clip primitives with planes. While I'm not going to write the support for spheres, cones and other exotic primitives, anything polygon based should work. If it is doesn't, it is because a missed a polygonal Primitive type like above.

Why don't you use the bounding box for unknown primitives as a fallback?

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: SQBVH

Postby Dade » Tue Feb 28, 2012 3:07 am

jeanphi wrote:
Dade wrote:Note: SBVH needs to be able to clip primitives with planes. While I'm not going to write the support for spheres, cones and other exotic primitives, anything polygon based should work. If it is doesn't, it is because a missed a polygonal Primitive type like above.

Why don't you use the bounding box for unknown primitives as a fallback?


It defeats a bit the porpoise of SBVH. It is based on the idea that the bbox of clipped primitive will be smaller (along all axis) than the clipped original bbox. At the moment, I'm falling back to old object-split if I find an unsupported primitive but your approach, even if not optimal, will provide better results anyway.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SQBVH

Postby J the Ninja » Wed Feb 29, 2012 3:01 am

Code: Select all
WARNING : 12] A primitive of type N3lux17InstancePrimitiveE, used in a SQBVH, isn't a triangle, falling back to 'object split'-only building


What is "N3lux17InstancePrimitiveE"? I'm seeing a lot of that message followed by a crash similar to the one I posted on the previous page.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SQBVH

Postby Dade » Wed Feb 29, 2012 3:34 am

J the Ninja wrote:
Code: Select all
WARNING : 12] A primitive of type N3lux17InstancePrimitiveE, used in a SQBVH, isn't a triangle, falling back to 'object split'-only building


What is "N3lux17InstancePrimitiveE"? I'm seeing a lot of that message followed by a crash similar to the one I posted on the previous page.


It is a C++ mangled symbol name, Linux has an utility to de-mangle the symbol:

c++filt -t N3lux17InstancePrimitiveE

Output:

lux::InstancePrimitive
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SQBVH

Postby J the Ninja » Thu Mar 15, 2012 3:04 am

Found an odd bug with sqbvh, using it with this scene causes the instanced objects (the lamp housings) to just disappear! :?

tunnel-sqbvh.zip
(187.22 KiB) Downloaded 13 times
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests