Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XGen and Displacement

6 REPLIES 6
Reply
Message 1 of 7
lucreziamagnano
2078 Views, 6 Replies

XGen and Displacement

Hello I have a problem to use the displacement

in the shader my map displacement has a scalar zero value of 0.250, how can I add that value also to my  displacement map in Xgen?

Thank you

6 REPLIES 6
Message 2 of 7

If you have converted the displacement map to a ptex map, you can adjust the map values via a clamp or fit expression. The displacement values default to 0 to 1 so the mid point is .5, but you can offset the values with a fit expression:

 

$a=map('${DESC}/paintmaps/displacement');#3dpaint,500.0

$min=0.0000;

$max=0.2800;#0.0,5.0

fit($a, 0,1, $min, $max*2)

 

You can then adjust the values to fit the xgen displacement values to the displacement used on the object:

 

pSphere1.png

 

pSphere2.png

 

pSphere3.png

 

Cheers

 

 

 

 

 



Michael Todd

XGen Product Owner and Designer

Message 3 of 7

Hi Michael,

 

Unable to match xgen displacement with surface displacement. Can you please check attached file and let me know if there is any mistake? 

 

Thanks

Sudarshan 

Message 4 of 7

There seems to be something wrong with the jpeg being sued as the displacement map source. I can't open it in photoshop as it says it has an invalid header. What resolution is the image and what bit depth?



Michael Todd

XGen Product Owner and Designer

Message 5 of 7

Sorry about that, Not sure what happend exactly. Sending new image.

Message 6 of 7

Looks like the image in in sRGB color space as applied to the mesh, but the color space of the displacement is RAW, as applied by XGen. You can adjust the gamma in the displacement expression  as the scaling in the displacement, of the sRGB color space image, will differ from scaling the displacement in RAW space.

 

DispGamma.png

 

$a=map('${DESC}/paintmaps/displacement');#3dpaint,200.0

$min=0;

$max=10.0000;#0.0,10.0

$G=0.3650;#0.00,10.00

$gamma=gamma($a,$G);

fit($gamma, 0,1,min, max)

 

 

note that I raised the resolution of the ptex map to 200 texels, to increase the fidelity of the disaplacement maps 4k resolution. This gives 512 pixels per face

 

ptexView.pngptexView2.png

 

 

Cheers

 



Michael Todd

XGen Product Owner and Designer

Message 7 of 7

ohh i see, got the point.

 

Thank you very much Michael,

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report