Author Topic: Fit vector displacement.  (Read 255 times)

Offline paq

  • Member
  • *
  • Posts: 190
Fit vector displacement.
« on: December 21, 2017, 04:12:07 PM »
Hello,

I have a vector displacement texture (.exr), normalized, and I need to refit the value between 2 specific Min/Max value. Is it possible to do that with the blue nodes ? I don't see any refit operator, and I'm too dumb to recreate the maths myself :S
« Last Edit: December 21, 2017, 04:19:59 PM by paq »
Gameloft

Offline Hetzen

  • Member
  • *
  • Posts: 1555
Re: Fit vector displacement.
« Reply #1 on: December 21, 2017, 05:31:00 PM »
Can you use a colour adjust and set the black and white points to your range? You may want to un-check clamp black and white.

Offline paq

  • Member
  • *
  • Posts: 190
Re: Fit vector displacement.
« Reply #2 on: December 21, 2017, 06:28:51 PM »
Hello,
Well I finally use this :

OLD PERCENT = (x - OLD MIN) / (OLD MAX - OLD MIN)
NEW X = ((NEW MAX - NEW MIN) * OLD PERCENT) + NEW MIN

Seems to work fine with vectors.

I have tried the color adjust, but it very difficult to enter color value like : 0.811485, 1.25989, 0.903355 with the actual interface.
Gameloft

Offline Hetzen

  • Member
  • *
  • Posts: 1555
Re: Fit vector displacement.
« Reply #3 on: December 21, 2017, 08:43:48 PM »
Glad you found your solution. Can you explain why you wanted to do that?

Offline paq

  • Member
  • *
  • Posts: 190
Re: Fit vector displacement.
« Reply #4 on: December 24, 2017, 05:23:30 PM »
Hi Hetzen,

It's for the vector displace project here : http://www.planetside.co.uk/forums/index.php/topic,23959.0.html

I can't find a way to write negative value in .exr when exporting my vector displace data from Houdini (something that bugs me a lot grrr), so I refit the range between 0-1 before the export, and I had to refit the value back in Terragen between the original min/max value.

 
Gameloft

Offline Hetzen

  • Member
  • *
  • Posts: 1555
Re: Fit vector displacement.
« Reply #5 on: December 25, 2017, 11:35:14 PM »
Hey Paq

Thanks for explaining. Yes I've been following your thread. I'm keen to try your method out.

Something I do, which may not be relevant here, is when I want to raise a normalised -1 to 1 range into the positive I tend to add 1 then multiply by 0.5. So the new range is 0 to 1, the old zero point is now 0.5. This can be useful to put a curve on the graph shape with bias or gain scalers amongst other uses. Then to bring back into -1 to 1 range, simply multiply by 2 then subtract 1.

Offline paq

  • Member
  • *
  • Posts: 190
Re: Fit vector displacement.
« Reply #6 on: December 26, 2017, 03:07:04 AM »
Hi Hetzen,

Well, for my first prototype, I didn't pay attention to the size of the model, so mix/max value could be way over -1 1.
I'm such a noob for this kind of stuff  8) ... but now I do my normalization in Houdini before exporting, so whatever the geometry I create, x/z always fit between 0 and 1 ... so I shouldn't get to much trouble to get the right result in Terragen.

Gameloft