loopsubdiv construction/syntax

Discussion related to the LuxRender Material system, programming API and Scene file format.

Moderators: jromang, tomb, zcott, coordinators

Re: loopsubdiv construction/syntax

Postby dougal2 » Tue Jun 03, 2008 1:21 am

BTW, Radiance perhaps you might download Maya PLE and have a play with it when you have a spare moment. The file i/o stuff is restricted, but some of the code fragments I post might just run in it.
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: loopsubdiv construction/syntax

Postby Radiance » Tue Jun 03, 2008 1:23 am

hmmmm

Before: you take a simple mesh and apply subdiv in maya, export to lux as lots of polygons (trianglemesh shape)

Now: directly export the simple mesh and lux subdivs internally to lots of polygons (loopsubdiv shape

so the whole concept of creating this functionality around a maya subdiv object is wrong...
even if you can get the base simple mesh back, it's still not good enough as the user does'nt want to slow his maya opengl view to a grinding halt selecting a high subdivision level,
which is'nt exported anyways...

you'll have to do some clever thinking :)

can you not add a property to a normal mesh object or something ?

greetz,
radiance

PS: i'm near my bandwith limit (again), so no maya PLE at the moment...
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: loopsubdiv construction/syntax

Postby dougal2 » Tue Jun 03, 2008 11:10 am

OK, forget about the "loopsubdiv" in Lux, lets pretend this thread is really about making sense of Maya's subdiv objects.

Radiance wrote:even if you can get the base simple mesh back, it's still not good enough as the user does'nt want to slow his maya opengl view to a grinding halt selecting a high subdivision level, which is'nt exported anyways...


That's the whole point of the subdiv geometry in Maya, and this is why it's different from regular polygons.
The subdivision is not applied to the whole mesh, but only locally in the areas you've edited. This is what I mean by subdiv Levels in Maya. The different levels are visible simultaneously and can be edited independantly. Those little screenshots I've posted in the first post show 2 subdiv Levels on the object - it's not a composite image.

When exporting this geometry, what I can do is export only the faces that exist in a particular level - there is never any need to either export or view the whole object at the finest subdiv level.

I'm going to do some work now to validate what I'm exporting from different levels, hopefully I can shed some light on the problems I faced last night.
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: loopsubdiv construction/syntax

Postby Radiance » Tue Jun 03, 2008 11:21 am

hmmm

I see, but i don't think thats possible at the moment.

The loopdiv shape does'nt support different levels for different groups of vertices.
Exporting the different levels as different loopdiv shapes won't work either, as you'll end up having tears/holes in it (because vertices between groups won't be connected)

I think it might be best to stick with attributes on normal mesh objects or similar in this case... :(

greetz,
radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: loopsubdiv construction/syntax

Postby dougal2 » Tue Jun 03, 2008 11:47 am

Radiance wrote:The loopdiv shape does'nt support different levels for different groups of vertices.


That's not something I'm trying to achieve. The levels I'm referring to are != "nlevels". They are simply a subset of the faces in the mesh.

Really, I simply need to knwo wht the following valid object doesn't work as a loopsubdiv:
Code: Select all
# Polygon Shape |pSphere1|pSphereShape1 (set 0)
AttributeBegin
   ConcatTransform [6.000000 0.000000 0.000000 0.000000
                    0.000000 0.000000 6.000000 0.000000
                    0.000000 -6.000000 0.000000 0.000000
                    0 0 0.000000 1.000000]
NamedMaterial "lambert1"
Shape "trianglemesh"
   "integer indices" [

0 1 2
0 2 3
1 4 5
1 5 2
2 5 6
2 6 7
3 2 7
3 7 8
9 10 11
9 11 12
12 11 5
12 5 4
15 16 17
15 17 18
16 19 20
16 20 17
21 22 23
21 23 24
22 8 7
22 7 23
23 7 6
23 6 20
24 23 20
24 20 19


   ]
   "point P" [

-1.375000 -0.000000 1.375000
-0.750000 -0.000000 1.750000
-0.875000 -0.000000 0.875000
-1.750000 -0.000000 0.750000
0.000000 -0.000000 1.875000
0.000000 -0.000000 0.937500
0.000000 0.000000 0.000000
-0.937500 0.000000 0.000000
-1.875000 0.000000 0.000000
1.375000 -0.000000 1.375000
1.750000 -0.000000 0.750000
0.875000 -0.000000 0.875000
0.750000 -0.000000 1.750000
1.875000 0.000000 0.000000
0.937500 0.000000 0.000000
1.375000 0.000000 -1.375000
0.750000 0.000000 -1.750000
0.875000 0.000000 -0.875000
1.750000 0.000000 -0.750000
0.000000 0.000000 -1.875000
0.000000 0.000000 -0.937500
-1.375000 0.000000 -1.375000
-1.750000 0.000000 -0.750000
-0.875000 0.000000 -0.875000
-0.750000 0.000000 -1.75000

]
AttributeEnd


Here's a render of it as a trianglemesh:
subdiv_level1_export_trianglemesh.png


Here's the vertex and tri numbering:
subdiv_level1_export_numbering.png
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: loopsubdiv construction/syntax

Postby CTZn » Tue Jun 03, 2008 2:07 pm

Here's my contribution; hopefully that will help finding a good basis for communication:

A Short Introduction to Maya's SubD's

Radiance, am I correct when I assume that the last object shown is what lux expects as input for loopsubdiv ?

Ah crap there are permissions issues, hold on... K I'm attaching the file if possible... well nope.

I'm on this, will post again.
Last edited by CTZn on Tue Jun 03, 2008 2:18 pm, edited 1 time in total.
CTZn
 
Posts: 224
Joined: Fri May 16, 2008 5:23 pm
Location: Paris, France

Re: loopsubdiv construction/syntax

Postby dougal2 » Tue Jun 03, 2008 2:16 pm

CTZn
Thanks for the vid.

Also, there are indeed 2 issues in this thread.

#1 Outputting verts and indices in an optimised fashion.
I'm reasonably confident that I'm doing this correctly. I've adapted my code to work on normal polygon meshes and I'm getting nice shared vert output that converts nicely to Lux's loopsubdivs.

#2 Reading vert info from a Maya subdiv object
This works when working with a single subdiv level in Maya, and saving the output as a Lux trianglemesh.
Specifying a single level as a loopsubdiv doesn't work.
Trying to output all visible levels into one Lux mesh doesn't work, either as trianglemesh or loopsubdiv.

I hope that clarifies.

I have at least worked out the optimised mesh stuff that is handy for some mesh situations, even though I still have questions that need answering about it.
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: loopsubdiv construction/syntax

Postby CTZn » Tue Jun 03, 2008 2:22 pm

Ah you could see it, I couldn't :mrgreen:

The only part that's different for me is the "adaptive convert subdiv to polygon" that tesselates the entire object to the highest level ??!
No, that is what the "uniform" method would do; adaptative tesselates the object according to the highest local level edited. Backfaces in the demo object are coarse. I think it's fine as is.

Attached the final mesh:
Attachments
Maya_subDs.obj.zip
The final object. This is no zip actually, just edit the file name to obj.
(15.3 KiB) Downloaded 2 times
Last edited by CTZn on Tue Jun 03, 2008 2:28 pm, edited 1 time in total.
CTZn
 
Posts: 224
Joined: Fri May 16, 2008 5:23 pm
Location: Paris, France

Re: loopsubdiv construction/syntax

Postby dougal2 » Tue Jun 03, 2008 2:26 pm

No, you're right, the convert worked properly this time.

Here's a render of:
1. create subdiv cube
2. edit the same (ish) as you did in the vid
3. adaptive convert to poly
4. export via my optimised mesh output routine, including triangulation
5. render as trianglemesh and no normals so that you can see the triangulation.
Attachments
subdiv_to_poly.png
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: loopsubdiv construction/syntax

Postby CTZn » Tue Jun 03, 2008 2:30 pm

Fine, I did my job :)
CTZn
 
Posts: 224
Joined: Fri May 16, 2008 5:23 pm
Location: Paris, France

PreviousNext

Return to Materials, API & Scene file format

Who is online

Users browsing this forum: No registered users and 1 guest