Matching 3ds max camera/terrain to Terragen 4

Started by wubba, July 28, 2018, 05:31:59 am

Previous topic - Next topic

wubba

Quote from: Matt on July 30, 2018, 04:22:06 am
I wonder if their PNG saver has a 16 bit option?

Unfortunately it only exports 24 bit, as Kadri pointed out is still only 8 bit :(
What don't kill you only makes you stranger.

Dune

You could enlarge it considerably in Photoshop, make it 16bit, blur it and add detail in TG. You could get rid of the steps then.

wubba

Quote from: Dune on July 30, 2018, 04:56:56 am
You could enlarge it considerably in Photoshop, make it 16bit, blur it and add detail in TG. You could get rid of the steps then.

Might be worth a shot?.. though not sure if that's gonna help with the floating trees effect??...
What don't kill you only makes you stranger.

Dune

Did you sit the tree pop on the last node before it's going into planet? Maybe add (another) compute terrain there (just for the pop to sit on).

wubba

Quote from: Dune on July 30, 2018, 05:40:23 am
Did you sit the tree pop on the last node before it's going into planet? Maybe add (another) compute terrain there (just for the pop to sit on).

I'm not using population (at this stage).. I've rendered a cluster of test trees in max with them roughly positioned but not floating above the terrain.. if anything partially submerged...
I haven't tinkered with population yet.. reading up on it now but can you tell me what the limitations are?..

I want to use specific plant models (various palm trees) and be able to animate (branches moving in the wind)..
Having said this, it still doesn't fix the stair artifacts??...
What don't kill you only makes you stranger.

digitalguru

July 30, 2018, 06:48:50 am #20 Last Edit: July 30, 2018, 06:56:31 am by digitalguru
Hope this helps, but when trying something similar in World Machine  (exporting .raw32) - changing the file extension to .raw will let it load in Photoshop - when you import you have the option of specifying the bit depth you know it is.

Just had a quick look at the World Creator website and it says it can export to raw32 - that would be your best bet - you would just need to change the extension as mentioned to .raw and specify 32 bit on import to Photoshop

Quoteunder 16bit settings as states 'Specified image is larger than file
this is simply that the raw importer in Photoshop needs to know the resolution of the image you're trying to load - looks like the default is 4096 x 4096.

So if your image is 2048 x 2048, you'll have to set that manually, but if you can export a higher resolution image from World Creator try as high as you can go to get more detail

Terragen won't load the .raw file though, so you could convert it to OpenExr to load it into Terragen and turn it into an RGB image. Photoshop is a bit behind the times with 32 bit Exr images so when I was trying this workflow I found a free plugin for Photoshop that exports full 32 exrs:

https://www.exr-io.com/

So here's a suggestion for a workflow to get the most out of your map:
  • Save your map fromWorld Creator at the maximum res you can to a .raw32 file

  • Change the extension of the .raw32 file to .raw

  • Load into Photoshop - set the resolution manually on the import dialog and set bit depth to 32bit and Byte order to IBM PC

  • In Photoshop changeImage/Mode from greyscale to RGB Color

  • Save to OpenExr using the exr-io option to maintain 32 bit depth


You can then load the exr into Terragen via a heightfield load or a displacement node, my personal preference is via a heightfield node as you then get the extra fractal fine detail displacement on the heightfield shader for free.

Possible pitfalls:

When I tried this from World Machine the map seemed to be normalized - that is the values don't match "real world" values - for instance, if the highest point in your World Creator scene is 350 meters,, then the brightest pixel in your map will need to be 350. If it isn't, then you will have to:

  • Add a Heightfield resize node in Terragen and check the Re-size in meters option and set to the size of the terrain in meters..

  • Add a Heightfield adjust vertical, check the Multiply height by option and tweak until the height is right


In my workflow, I used Nuke to get an exact value for this multiplier.

That should help with displacement maps - though couldn't you export a .obj to load into 3ds max and a .ter file for Terragen?





wubba

July 30, 2018, 08:59:37 am #21 Last Edit: July 30, 2018, 09:01:34 am by wubba
Quote from: digitalguru on July 30, 2018, 06:48:50 am
Hope this helps, but when trying something similar in World Machine  (exporting .raw32) - changing the file extension to .raw will let it load in Photoshop - when you import you have the option of specifying the bit depth you know it is.

Just had a quick look at the World Creator website and it says it can export to raw32 - that would be your best bet - you would just need to change the extension as mentioned to .raw and specify 32 bit on import to Photoshop

From what i gather, it depends on which World Creator you're using.. Unity WC2 exports .raw (8 & 16 bit) and those extensions are .raw... WC2 'standalone' exports .raw .r16 & .r32 (I'm assuming .r* is still raw?)... Later versions I cannot account for but changing the .r16/32 extension gets the same  'Specified image/larger file' error in Photoshop as the unity WC2 .raw (16) does... I can only play with lower res settings to open it & then they only display corrupt so!?...

(IM CONFUSED!!!) - BUT!...

I did manage to import the Unity WC2 a 4k .raw (16)  into Lightroom & export it to 4k .tiff (16), which opened fine in Photoshop.. I then flipped it & downsized to 2k maintaining the 16 bit depth. (My 3ds Max terrain is also set at 2048x2048)..

Well the extra bit depth does make a difference but not as much as I was hoping for.. but I think it is passable considering it is a fast paced scene and most of the terrain will be eventually scattered with vegetation & covered by cockpit internals.. May have to use another approach for trees.. as for now I'm exhausted!!!

[attachimg=1]
What don't kill you only makes you stranger.

digitalguru

QuoteUnity WC2 exports .raw (8 & 16 bit)


Yeah, I suspected the Unity version might have different export formats.

I guess it doesn't export to Terragens .ter format either.

If you don't mind, could you upload the original raw file from unity to have a look?

wubba

Quote from: digitalguru on July 30, 2018, 06:48:50 am
That should help with displacement maps - though couldn't you export a .obj to load into 3ds max and a .ter file for Terragen?
-------------------------------------------------------------------------------------------------------------------------------------------
Yeah, I suspected the Unity version might have different export formats.
I guess it doesn't export to Terragens .ter format either.
If you don't mind, could you upload the original raw file from unity to have a look?


No unfortunately it dont.. yeah sure... cant attached it here as its 32mb... download it here :)

http://www.mediafire.com/file/g8homh1q2p83210/heightmap4k%20unityWC2%20%28RAW16%29.rar
What don't kill you only makes you stranger.

digitalguru

Got it - what's the resolution (pixel dimensions) of the file?

wubba

Quote from: digitalguru on July 30, 2018, 09:54:04 am
Got it - what's the resolution (pixel dimensions) of the file?

4097×4097 .. which I found odd.. I assume a Unity thing?
What don't kill you only makes you stranger.

digitalguru

July 30, 2018, 10:08:49 am #26 Last Edit: July 30, 2018, 10:11:09 am by digitalguru
getting somewhere - what's the size of the terrain area in meters?

QuoteI assume a Unity thing


some progs add a pixel so the rez is not an exact power of two - don't know why though - maybe it's a memory allocation thing

wubba

Quote from: digitalguru on July 30, 2018, 10:08:49 am
getting somewhere - what's the size of the terrain area in meters?


Not exactly sure on the metres... Could it be the 'Terrain Real Width'?
[attachimg=1]
What don't kill you only makes you stranger.

digitalguru

July 30, 2018, 10:35:39 am #28 Last Edit: July 30, 2018, 10:43:09 am by digitalguru
Quote
Not exactly sure on the metres... Could it be the 'Terrain Real Width'?


hopefully :-)

I'm getting something like this - does that look like the shape of your terrain?
[attachimg=1]

p.s the heightmap looks like this:
[attachimg=2]

wubba

Quote from: digitalguru on July 30, 2018, 10:35:39 am
does that look like the shape of your terrain?
------------------------------------------------
p.s the heightmap looks like this:


Nope! way off ;) .. I got that washed away effect myself when importing the raw16 into Photoshop under lowres settings I think??.. but here is how its meant to look. :)

[attachimg=1]
What don't kill you only makes you stranger.