Go Back   NewTek Discussions > LightWave 3D For Developers > Node Development

Reply
 
Thread Tools Display Modes
Old 02-01-2007, 09:01 AM   #1
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
Vector Cast node for Vector Displacement

Hi,


Vector Cast is an experimental node which to bake
a vector displacement from an hi-res sculpted mesh (2)
to an hi-res base (non-sculpted) mesh (1a),
then the map can be applied to the base geometry (1b)
with an Image node in the Displacement Editor.
Click image for larger version

Name:	vectordisplacement.gif
Views:	615
Size:	29.4 KB
ID:	41682

The map baked with "Surface Baking Camera",
need an "UV border" for corners, zero displacement is 50% gray,
this allow casting negative value, may be I should add a scale
factor for big displacement for coding in colors.
This example is in "Object" space, I will try also with
"Tangent" space.
Click image for larger version

Name:	cube_vector_obj.jpg
Views:	351
Size:	72.7 KB
ID:	41683

There's a plugin in XSI:
http://www.xsibase.com/forum/index.p...threadid=28834
(Thanks LW3D for the idea and link)


Denis.

Last edited by dpont; 02-01-2007 at 09:02 AM.
dpont is offline   Reply With Quote
Old 02-01-2007, 09:05 AM   #2
Dodgy
Worms no more! Free fun!
 
Dodgy's Avatar
 
Join Date: Feb 2003
Location: Sydney
Posts: 7,018
Nice Where is it?
__________________
Push the software, don't let it push YOU!
My own plugins and work:www.mikegreen.name
LaptopSetup:corei5 2.26GHz nvidia 230M 4Gig win7
HomeSetup:4 Ghz P4 3GigRam FX9600 WinXp

Last edited by Dodgy; 02-01-2007 at 09:06 AM.
Dodgy is offline   Reply With Quote
Old 02-01-2007, 09:09 AM   #3
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
"...which helps to bake..."
Missing typos and too late edit delay...

Denis.
dpont is offline   Reply With Quote
Old 02-01-2007, 09:57 AM   #4
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
This is the first Win32 version of Vector Cast:
Attachment 41691

-Load the base and sculpted meshes in the Layout,
use different names for the two surfaces, works better
with triangulated polygons.

-This node is located in "DP Kit/Tools",
it must be added to the surface of the base mesh,
with a proper UV map selection .


-"Scale" a factor to increase/decrease the size
of displacement, because color is a clamped vector,
the rescaled maximum displacement is limited to 1 meter.
The displacement is also reduced internally to
store negative values.



-Use a Surface Baking Camera, select the low-res mesh, select
the same UV map, "Offset from surface" must be set to
1 um (0.001 mm) for 1 meter sized object, or less/more,
depends of your geometry to avoid artifacts in the image map,
"Direction" to "Smoothed Vector".
Check "Unseen by Camera" for the hi-res "Object properties"
for safe render.




-Vector map generated in Object/Texture space can be directly loaded
in the Image Node in Lightwave 9.0+ in the Displacement Editor,
set "Mipmap" to off, set your UV map,
in some case unchecking pixelblending is better,
then add a Multiply Math Vector (x2)
and finaly add a Substract Math Vector (-1, -1, -1).

It works in Object and Tangent space, but
There's no simple way to apply a Tangent VectorMap
in Displacement Editor, LW NormalMap node can
read such Tangent Color data, but it guess it
does a normalization so displacement distance is
broken.

Denis.

Last edited by dpont; 03-27-2007 at 09:31 AM.
dpont is offline   Reply With Quote
Old 02-01-2007, 02:06 PM   #5
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
Have updated Vector Cast node,
added a Vector Displace node (win32) plugin:
Attachment 41704


Vector Displace node:
-Vector map generated in Object/Texture space can be directly loaded
in the Vector Displace in Lightwave 9.0+ in the Displacement Editor,
This node is located in "DP Kit/Displacement".
The transformation in Tangent space has some limitations,
it doesn't work correctly in unsmoothed edges i.e edges of a box.
It can read floating RGB values, if you saved the vector map in such
format.

Denis.

Last edited by dpont; 03-27-2007 at 09:31 AM.
dpont is offline   Reply With Quote
Old 02-01-2007, 02:44 PM   #6
Dodgy
Worms no more! Free fun!
 
Dodgy's Avatar
 
Join Date: Feb 2003
Location: Sydney
Posts: 7,018
Displace seems to be bit broken. It crashed LW after giving some very odd results on a simple sphere.
__________________
Push the software, don't let it push YOU!
My own plugins and work:www.mikegreen.name
LaptopSetup:corei5 2.26GHz nvidia 230M 4Gig win7
HomeSetup:4 Ghz P4 3GigRam FX9600 WinXp
Dodgy is offline   Reply With Quote
Old 02-01-2007, 03:20 PM   #7
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
Works here with my sample box,
please, could you post your scene+object and/or
settings, I'm still working on "Tangent" space
for the displacement node and it is unstable.
But "Object" space should be safe (I hope).

Denis

Last edited by dpont; 02-01-2007 at 03:22 PM.
dpont is offline   Reply With Quote
Old 02-02-2007, 04:09 AM   #8
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
It seems that the "corner" problem with "Tangent" space
in Vector Displace Node is caused by discontinuous UV,
If the base mesh has unwelded points along seams,
it works properly.
I'm trying to fix this.

Denis.

Last edited by dpont; 02-02-2007 at 04:10 AM.
dpont is offline   Reply With Quote
Old 02-02-2007, 04:44 AM   #9
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
Updated Vector Displace node,
"Tangent" problem solved:
Attachment 41741


If somebody would do some test,
LW or Mudbox/Zbrush hi-res model,
you are welcome!

Denis.

Last edited by dpont; 03-27-2007 at 09:30 AM.
dpont is offline   Reply With Quote
Old 02-02-2007, 06:18 AM   #10
Dodgy
Worms no more! Free fun!
 
Dodgy's Avatar
 
Join Date: Feb 2003
Location: Sydney
Posts: 7,018
Here's my image and ball. Use the first UV set. This crashes LW with your new displacement node

I've also had problems rendering using your vector cast node, often getting just black instead of a nice tangent colour map.
Attached Files
File Type: zip Ball.zip (400.9 KB, 271 views)
__________________
Push the software, don't let it push YOU!
My own plugins and work:www.mikegreen.name
LaptopSetup:corei5 2.26GHz nvidia 230M 4Gig win7
HomeSetup:4 Ghz P4 3GigRam FX9600 WinXp
Dodgy is offline   Reply With Quote
Old 02-02-2007, 06:41 AM   #11
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
Confirmed, Vector Displace node doesn't like
subpatched polys, this is a shame, I will try to fix...
May you used also subpatched model for "Tangent" Vector
Casting?

Denis
dpont is offline   Reply With Quote
Old 02-02-2007, 08:00 AM   #12
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
After some other tests, I'm finding some other issues,
mainly around UV mapping evaluation in Displacement Editor,

First UV map of subpatched mesh seems to be badly evaluated
with Mesh Info function of SDK in Layout (even in Object space).
I use "frozen" mode to get positions and textures coordinate.

Second a freezed UV map of subpatched mesh in Modeler is bad also.

Sure Vector Displace node has also its own bugs (for Subpatched mesh
in Tangent space), that crashes Layout, which could be solved.

I know that a Displacement node as less "Nodal Access" datas than
a node writed for Surface Editor.
This is annoying because this tool need a more accurate UV
evaluation for export/import a shape to various geometry.


Not the first time an experimental tool... is purely experimental...

Denis.

Last edited by dpont; 02-02-2007 at 08:03 AM.
dpont is offline   Reply With Quote
Old 02-02-2007, 08:12 AM   #13
Dodgy
Worms no more! Free fun!
 
Dodgy's Avatar
 
Join Date: Feb 2003
Location: Sydney
Posts: 7,018
Better post those bugs to newtek
__________________
Push the software, don't let it push YOU!
My own plugins and work:www.mikegreen.name
LaptopSetup:corei5 2.26GHz nvidia 230M 4Gig win7
HomeSetup:4 Ghz P4 3GigRam FX9600 WinXp
Dodgy is offline   Reply With Quote
Old 02-02-2007, 08:57 AM   #14
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
I'm not at Newtek here ? ;-)

So yes freeze breaks UV in Modeler,
but in current UV interpolation (Object space) result
is correct, but needs a bigger map (SGI 64bit),
had also bad code to get pixel in the image map.

Added a "After Deformation" checkbox in Vector Cast node.

But Tangent space is still buggy don't try it in
the updated version...
Attachment 41745

Denis.

Last edited by dpont; 03-27-2007 at 09:30 AM.
dpont is offline   Reply With Quote
Old 02-02-2007, 11:17 AM   #15
dpont
Member
 
Join Date: May 2006
Location: France
Posts: 2,009
...After a lot of debug sessions, I'm sorry but I can't solve
the problem with Subpatched polys in "Tangent" space, this
is not UV map related, the pre-process failed because the
polygon counter of the SDK is broken for subpatched polys
in LW 9.0, it returns zero polygon, so I post here a safe version
of Vector Displace node but not fully working.
Attachment 41750

Hope this can be solved in LW 9.2...

Cheers,
Denis.

Last edited by dpont; 05-12-2007 at 10:37 AM.
dpont is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 02:45 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2000-2007, NewTek