Scene scale startegy

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

Scene scale startegy

Postby pciccone » Tue Sep 28, 2010 12:02 pm

Hi.
I did a lot of testing about scene scale issues and I need some suggestions. We know that a Lux Unit (LU) is equal to 1m. A DAZ Studio unit (SU) is 1cm. When exporting a scene to Lux I divide each unit by 100.
Unfortunately this seems to introduce some precision issues that create artifacts in the scene. If I don't scale the units the resulting image looks better but then I have all kind of issues related to physical size.
Volumes are wrong, light is affected etc.
Is there a way of setting the unit of measure in Lux at the beginning of the scene to an arbitrary amount, so that I can specify that all the number are actually 1/100 of a meter? Or maybe there is a better approach?

Thanks in advance.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Scene scale startegy

Postby jeanphi » Tue Sep 28, 2010 12:10 pm

Hi,

Unfortunately not yet. However this is a known issue and should be dealt with sooner or later.

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

Re: Scene scale startegy

Postby pciccone » Tue Sep 28, 2010 12:12 pm

Thank you Jeanphi.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Scene scale startegy

Postby pciccone » Tue Sep 28, 2010 1:33 pm

Jeanphi.
Would it make sense to do something like this:

AttributeBegin
# Scale from SU to LU
Scale 0.01 0.01 0.01
NamedMaterial "mymat"

Shape "trianglemesh" "point P" [
...
]
AttributeEnd

And output the vertex list in Studio Units?

Thanks.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Scene scale startegy

Postby Lord Crc » Tue Sep 28, 2010 2:47 pm

Yes that should work well in most, if not all, cases. If you have other transformations you need to take care of the ordering though. This should avoid precision issues due to limited number of decimals used when outputting the floats.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

Re: Scene scale startegy

Postby pciccone » Tue Sep 28, 2010 3:08 pm

Thank you , unfortunately it doesn't solve the issue. I'll post more later, after the renders end.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Scene scale startegy

Postby Lord Crc » Tue Sep 28, 2010 3:23 pm

I forgot that lights may not like this, so stick with the old way for them. Btw what's the current status on this jeanphi?
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

Re: Scene scale startegy

Postby pciccone » Tue Sep 28, 2010 3:33 pm

Good to know, yes, lights are scaled by division.

Thanks.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Scene scale startegy

Postby jeanphi » Wed Sep 29, 2010 1:32 am

Hi,

This should work for mesh lights too since LuxRender applies the transform to the mesh coordinates when loading the mesh and no tranforms are done afterward.
However it won't work correctly for other primitives (spheres, ...). If you use instances, you also need to be careful to apply the transform only once (on the base object or the instance).

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

Re: Scene scale startegy

Postby pciccone » Wed Sep 29, 2010 1:36 am

Good to know, thanks.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Next

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests