Adding Bezier patch for geometric smoothing

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

Moderators: jromang, tomb, zcott, coordinators

Re: Adding Bezier patch for geometric smoothing

Postby paco » Sun Oct 02, 2011 4:29 pm

Sounds like a good idea jeanphi. I've certainly learnt a lot by poking around in the code the last few days. I think that multiple UV sets would be a huge plus. Will think about it a bit more after I finish the bezier stuff.
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Adding Bezier patch for geometric smoothing

Postby jeanphi » Sun Oct 02, 2011 4:37 pm

Hi,

Sure, such an overhaul will have to be discussed and carefully studied, it will touch many parts of the core because the assumption that there is a single UV set is extremely present. We will probably need to keep a base UV set because some geometrical computations depend on it, but allow for something completely different for the textures.

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

Re: Adding Bezier patch for geometric smoothing

Postby paco » Sun Oct 02, 2011 5:10 pm

Don't worry, i'm not planning on touching anything on my own :)

One thing that has occurred to me looking at the mesh structure - I'm not sure that it really deserves to be a Primitive/Shape - although I can see the sense in it with the original PBRT implementation.

Correct me if i'm wrong, but currently though it seems that it gets refined before it's ever used (different to PBRT) as a Shape/Primitive - so it's bound functions don't get called, it's not intersected - it's really just a storage class for vert and face data, as well has having material/medium properties.

One option might be to create a new storage class for this situation and then create the Primitives elsewhere (like in the CreateShape function).

Not sure it's worth the effort though, and it would be a break with PBRT which isn't my preference. Maybe I should have some more coffee.
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Adding Bezier patch for geometric smoothing

Postby paco » Sun Oct 02, 2011 8:28 pm

Getting closer. I've implemented the smoothing for triangles atm - will hopefully have quads up soon.

Here's a test pic:
lux_test01.jpg


Each of the meshes are identical, only the smoothing option is different (flat, normal interpolation, geometric).
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Adding Bezier patch for geometric smoothing

Postby J the Ninja » Sun Oct 02, 2011 10:35 pm

*golf claps* :)
-Jason

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

Re: Adding Bezier patch for geometric smoothing

Postby jeanphi » Mon Oct 03, 2011 2:26 am

Hi,

Great! The result is looking good. How about some benchmark to see how the speed is impacted?

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

Re: Adding Bezier patch for geometric smoothing

Postby paco » Tue Oct 04, 2011 12:07 am

Still have some bugs and things to work out but when thats finished will let you know. Speed is ... well... lets not talk about that for now :)
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Adding Bezier patch for geometric smoothing

Postby paco » Thu Oct 06, 2011 4:27 am

Another example scene (sorry for the low spp) :
lineup.jpg


Suzanne is a bit rough (although a lot better than she was!). I still have a bit of experimenting to do from here. It won't be able to completely smooth out a rough mesh, but for meshes that are reasonably smooth it should do a good job. Here's the base geometry (which was fed to lux and converted to beziers from there - 1000 faces).

test_005_lineup.Scene.00012_base.jpg
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Adding Bezier patch for geometric smoothing

Postby jeanphi » Thu Oct 06, 2011 5:12 am

Hi,

Nice results. Do you honour vertex normals when converting to bezier patches or do you discard them?

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

Re: Adding Bezier patch for geometric smoothing

Postby paco » Thu Oct 06, 2011 5:16 am

Currently I use the imported normals - although they could also be optimised to provide better smoothing.
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests