Xgen on Displaced object


#1

Could someone please tell me the specific action I need to do to connect a displacement map to the Xgen Displacement or Offset slider?

I have displacement on the material connected to my Xgen Grow geometry. I have tried just pointing to the same tif map in Xgen with:
$a=map(’${DESC}/paintmaps/displacement/disp5.tif’);#file
$a

I also tried converting my tif to a ptx file, but that did not work either. I am basically getting way to much offset when connecting the maps in Xgen. Displacement rotates the primitives in a checkerboard type pattern, and offset just pushes the primitives way to off the surface. I am using 0.5 as my mid value on the displacement map.

Michael Todd, can you help?


#2

add a multiplier slider to your map expression where

$a= ("Your/map/here’);
$b=0.3;#-10.00,10.00;
$a*$b

the -10.00, 10.00 are the min max for the slider so you can set those as needed then multiply the values in the map by the slider to adjust the displacement amount.

Your map needs to be a ptex map, so create a paintmap for the displacement then locate the file node that get’s added for the paint map in the hypershade. Load your tiff file there and when you save the paintmap, the tiff file will be converted to a ptex map.


#3

Ok, I’ll try that as soon as I can. What is the mid value supposed to be for xgen displacement?


#4

You can set the mid point to be where you need it via expression. By Default 0 is no displacement and 1 is full displacement of 1 unit (cm)

Using a fit() expression, you can set min and max values for the displacement

Using this expression:

$a=map(’${DESC}/paintmaps/displacement’);#3dpaint,40.0
$min=-10.0000;#-10.00,0.00
$max=10.0000;#0.00,10.00
fit($a,0,1,$min,$max)

I can set a min max displacement of 10 units, with the mid point being 0. What the fit does is take an input, in this case a float map with values of 0 to 1 and set the output range, in this case to +/-10

Once you’ve painted a map, you can always replace it with one on disc if needed, just find the file node for the paintmap in Textures and look up the file you need.


#5

Awesome information. Thanks !


#6

what about multi frame displacement ?
I have animated displacement

I need to get data from a displacement shader and set every frame