Author Topic: Confusion about using heightfield generate  (Read 176 times)

Offline Kerbonaut

  • Member
  • *
  • Posts: 1
Confusion about using heightfield generate
« on: April 01, 2017, 07:19:10 PM »
Hi, I'm trying to export a heightmap of some terrain, and I'm having some difficulty using the heightfield generate feature. I know I have to hook it up with the last shader, but whenever I export the heightfield it comes out weird; It only has two colors, solid white and black, and maybe a little bit of grey in between. And hooking it up with other shaders has either produced the same image or gone completely blank. What am I doing wrong?

72641-0

Offline Hetzen

  • Member
  • *
  • Posts: 1509
Re: Confusion about using heightfield generate
« Reply #1 on: April 01, 2017, 11:22:03 PM »
Heightfields use pixel values over the white value to represent height. So what you are seeing in your attachment is the first meter of the terrain above 0. There's probably information below zero too.

I've tended to not use Heightfields these days. I generally use a Get Altitude plugged into a Linear Step, with two constants, one for the lowest level of terrain, say -200m and the second for the highest level in the terrain, say 2000m. What this outputs is a flat gradient between black and white for the full range I've indicated by the two constants. I then use this to illuminate the terrain by plugging it into the Luminosity input of a surface layer with its colour set to full white. Turn off all lighting and render an orthographic top down view of the area I want to export. Render to the rez I want, then save as an EXR which is linear in the way it holds it's colour information. Why? Because I can take this into Photoshop and visually edit it, bring it back into TG as an image map in a single colour channel, with say erosion and river masks in the other two, which can cut out a lot of render processing when you are rendering sequences.

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 11309
  • Holy snagging ducks!
Re: Confusion about using heightfield generate
« Reply #2 on: April 02, 2017, 07:18:01 PM »
Kerbonaut, when you say you are hooking the Heightfield Generate up to the "last shader", are you doing it with the last shader in the *Terrain* group, or the last shader in the *Shaders* group before it connects to the planet? The latter is definitely not correct (in the majority of cases). It should be the last in the Terrain group. My second question would be how you are exporting: right-click on the Heightfield Generate and Save As? What format are you exporting as?

Jon, you know you can export heightfields to EXR as well, right? Your workflow sounds overly complicated, unless I'm not understanding why you're using it.

- Oshyan

Offline Hetzen

  • Member
  • *
  • Posts: 1509
Re: Confusion about using heightfield generate
« Reply #3 on: April 02, 2017, 08:14:21 PM »
Hi Oshyan, yes I did. When you export an exr from a heightfield node, you get a similar image to Kerbonaut's op. You are visually cut-off beyond anything over a meter, unless you start playing with Levels in Photoshop to compensate for over whites to pull the whole terrains altitude back into a visual black to white range.

With the method above, you know the altitude range you are exporting. You can see the whole altitude in Photoshop and do some edits. And bring it back into various apps knowing the range you're working with.

Offline cyphyr

  • Member
  • *
  • Posts: 3467
    • richardfraser
Re: Confusion about using heightfield generate
« Reply #4 on: April 02, 2017, 08:28:21 PM »
If you open the 32 bit EXR in Photoshop and convert it to 16 bit you can see the values and edit them and avoid gettingthe stepping that happens with 8 bit .... I think ...
www.richardfraser.co.uk
/|\

i7 5930 @3.5Ghz, 32Gb
i7 2600k @3.4Ghz, 16Gb
i7 980 @3.33Ghz, 16Gb

Offline Hetzen

  • Member
  • *
  • Posts: 1509
Re: Confusion about using heightfield generate
« Reply #5 on: April 02, 2017, 08:46:22 PM »
I guess you can Richard, what gamma settings do you use to convert into 16 bits? Because I might be missing a trick here.

When keeping everything in 32bits for editing, I've not noticed stepping when I put a 'copy merged' from Photoshop into a 32bit red channel.

Sorry Kerbonaut, we're going off on a tangent here.  :)

Offline cyphyr

  • Member
  • *
  • Posts: 3467
    • richardfraser
Re: Confusion about using heightfield generate
« Reply #6 on: April 02, 2017, 08:53:46 PM »


Sorry Kerbonaut, we're going off on a tangent here.  :)
happens lol

I guess it's down to the workflow ones comfortable with. If I keep things in 32 bit I get images like Kerbonaut or pure black or pure white. I've not tried looking at the channels, there may be a trick in there as well.
I think I use Exposure and Gamma but it's been a long time ...
www.richardfraser.co.uk
/|\

i7 5930 @3.5Ghz, 32Gb
i7 2600k @3.4Ghz, 16Gb
i7 980 @3.33Ghz, 16Gb

Offline Hetzen

  • Member
  • *
  • Posts: 1509
Re: Confusion about using heightfield generate
« Reply #7 on: April 02, 2017, 09:18:07 PM »
Well, I've been using this method to get in and out of other apps quite successfully so far.

Kerbonaut what was the file type you exported?
« Last Edit: April 02, 2017, 09:20:41 PM by Hetzen »

 

anything