FORUMS: list search recent posts

Displacement map problem when scaling object

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Quentin Hab
Displacement map problem when scaling object
on Sep 6, 2011 at 10:21:14 pm

I have a displacement map on my object that won't scale with my object. Now I have looked around in search for a solution to make the displacement scale with the object, and a solution I found seems to be adding an expression to the alphaGain of the displacement texture, and linking it to the scaleX of the object. That would be:

file1.alphaGain = pSphere1.scaleX;

This works fine, but the problem I have is that the displacement offset doesn't come along. It doesn't get scaled to stay with the original displacement. I am getting different tweaks trying expressions on the alphaOffset, but no proper result that will make my displacement offset stay uniformed while scaling the object up or down.

How can I keep my displacement map thesame while scaling the object? Is there a different expression for alphaOffset?


Return to posts index

Steve Sayer
Re: Displacement map problem when scaling object
on Sep 7, 2011 at 2:02:08 pm

I think the problem here is that, since Gain is a multiplier, it's okay for it to be 1 when the object's scale is 1. But Offset is an addition, so when the scale of the object is 1 you end up with an Offset of 1 instead of the default of zero.

I think this expression should do the trick:

file1.alphaGain = pSphere1.scaleX;
file1.alphaOffset = (x * pSphere1.scaleX);

In this case, 'x' should be whatever your original offset value is. So if your original offset value is 0, the final offset value will still be zero no matter what the object's scale. If your original offset was 0.2, and you triple the size of the object, you'll end up with an alphaOffset of 0.6, which should be what you want. That 0.6 will get applied after the gain gets multiplied, so the most displaced parts of the map should have a total displacement of 3.6, which I think is what you're looking for.

Hope that helps,

-Steve


Return to posts index

Quentin Hab
Re: Displacement map problem when scaling object
on Sep 10, 2011 at 9:02:00 pm

Hi Steve,

I was able to sort it out with the expression and a bit of tweaking, thank you for your help!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]