Matching 3ds max camera/terrain to Terragen 4

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

Previous topic - Next topic

wubba

Hey all... Fairly new with Terragen as have dabbled in the past but now I'm in knee deep in trying to achieve integration with a 3ds max scene...
Ok so I've imported a .fbx scene from Max which consists of just a camera on a path with multiple twists and bends...

The completed scene will be a 1st person cockpit view of a small space ship crashing through an array of trees, eventually coming to a halt near a coastal shore..

Problem I have is the terrain I'm using in Terragen is a displacement .tiff height map & the terrain I'm using in Max is identical as is the exact same .tiff height map applied using a Displace modifier..
When all imported into Terragen.. the camera path is not aligned to its correct X,Y,Z position... I'm unable to move the camera so I move the terrains instead manually guessing it's correct position to what it is in Max..
Unfortunately once I comp it all in after effects, the max render is all out of sync with the Terragen render...

Is there a way to accurate reposition the terrain in Terragen so it syncs up with my Max animation?.. Would be great if I could import the .fbx terrain along with the camera path from the one .fbx file into Terragen??...



What don't kill you only makes you stranger.

KlausK

/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

KlausK

#2
Sorry, can`t post more than a few words. I am constantly redirected to "Start a new topic".
I have attached a txt file instead.
CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

Matt

Welcome to the forum!

Before importing the camera, I would export the terrain from Max as an OBJ (or a proxy of your terrain). Bring the OBJ into Terragen and make sure it has the correct size in world space (Terragen units are metres). If the scale is off, then usually it's by a factor of 0.01, 0.1, 10 or 100.

Now see if the camera sits correctly in this space. If not, it's usually just a scaling issue, as with OBJ, so try reimporting with different scale factors.

Rotation order shouldn't be a problem with FBX.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

FBX cameras sometimes import with the wrong FOV because of a difference in film back / aperture settings. You might be able fix this by changing the Terragen camera to "Use horizontal FOV" after importing it.
Just because milk is white doesn't mean that clouds are made of milk.

wubba

Thanks heaps guys for the replies!!! :) .. I've been working on the suggestions you've all posted but unfortunately still no success... I'm not at my computer atm but will upload my scene files and assets once I get back. .. Hopefully give a better insight..
What don't kill you only makes you stranger.

wubba

#6
Think I got it working  ;D ...  The height map needed to be flipped! .. & I also had the wrong X&Y coordinates inputted to the heightfield terrain... Been doing so many tests, saving so many variations of the same files, I think I may have got muddled & mixed stuff up!?.. Anyway... Looks good.. can't wait for the final render!!!  8)

PS: Thanks to KlausK & Matt from Planetside Staff for the prompt help!!!
What don't kill you only makes you stranger.

KlausK

Well done, you got it!

I couldn`t resist and rendered a sort of low res version. Hope you don`t mind.
Looks quite nice. I am curious how it works out in the end.
Crashing through the trees and debris  and dust and all.
Let us know, please.
CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

wubba

Quote from: KlausK on July 29, 2018, 10:35:36 AM
Well done, you got it!

I couldn`t resist and rendered a sort of low res version. Hope you don`t mind.
Looks quite nice. I am curious how it works out in the end.
Crashing through the trees and debris  and dust and all.
Let us know, please.
CHeers, Klaus
Not at all! :) .. I just posted the screen capture coz i didn't have time to render it.. Looks like The camera is slipping underneath the terrain towards the end... I may need to adjust either the height of the terrain or camera path in Max?? .. either way I know the process works!
You can check my progress on here if like :)

facebook.com/projectinfinity3d
What don't kill you only makes you stranger.

wubba

Uh Oh!... Never plain sailing is it.. & in my case I'm not even hitting the water!!!..
So... I've comped it in with my trees and I'm 99.9% sure all elements are in their correct position, though the palm trees look like their still floating and moving with the camera (slightly)... I assume it has something to do with how Terragen interprets the height map terrain..  with the camera so close to the surface, the terrain has a 'staircase' like appearance, which does not do the same in Max!?... Went from a 2k to 4k map & made little to no difference at all so I'm beginning to think I've hit a brick wall here??... or is there a way to remove the staircase effect???...  :-\
What don't kill you only makes you stranger.

Matt

You probably need to use a 16 bit displacement map, if you're not already.

If Max doesn't show the stair-stepping, perhaps your terrain is subdivided too coarsely in Max? If you increase the subdivisions high enough, I'd expect the Max terrain show the same stair-stepping.
Just because milk is white doesn't mean that clouds are made of milk.

wubba

Quote from: Matt on July 29, 2018, 11:52:26 PM
You probably need to use a 16 bit displacement map, if you're not already.

If Max doesn't show the stair-stepping, perhaps your terrain is subdivided too coarsely in Max? If you increase the subdivisions high enough, I'd expect the Max terrain show the same stair-stepping.
Yeah I've been reading up on the 16 bit requirement.. At first I downsized the res from 4k to 2k in 8bit. The original png is actually 24bit.. which I loaded into Terragen & still shows the stair artefacts so I don't know..
Does it need to be exactly 16 or are you saying you can't avoid it altogether?
What don't kill you only makes you stranger.

Kadri

Quote from: wubba on July 30, 2018, 02:22:27 AM
..
Yeah I've been reading up on the 16 bit requirement.. At first I downsized the res from 4k to 2k in 8bit. The original png is actually 24bit...
Your 24 bit image is actually a 8 bit image (8 bit for Red+8 bit Green+8 bit Blue= 24 bit). It can be confusing at first.

"This means that the 8-bit setting (BPC) is in fact 24-bits per pixel (BPP). Meaning that each pixel can have values ranging from 0 to 16,777,215, representing about 16 million colors.
...
Similarly the 16-bit setting (BPC) would result in 48-bits per pixel (BPP). The available number of pixel values here is mind boggling (2^48). More than 16 million times more numerical values then the 8-bit setting. Again, this may seem like an overkill, but if you consider the neutral color gradient again, the maximum amount of tonal values is 'only' 65,536."


From here:
https://www.diyphotography.net/8-bit-vs-16-bit-color-depth-use-matters/

You need HDR images like an EXR file for example.

wubba

Quote from: Kadri on July 30, 2018, 02:58:31 AM
Your 24 bit image is actually a 8 bit image (8 bit for Red+8 bit Green+8 bit Blue= 24 bit). It can be confusing at first.

"This means that the 8-bit setting (BPC) is in fact 24-bits per pixel (BPP). Meaning that each pixel can have values ranging from 0 to 16,777,215, representing about 16 million colors.
...
Similarly the 16-bit setting (BPC) would result in 48-bits per pixel (BPP). The available number of pixel values here is mind boggling (2^48). More than 16 million times more numerical values then the 8-bit setting. Again, this may seem like an overkill, but if you consider the neutral color gradient again, the maximum amount of tonal values is 'only' 65,536."


You need HDR images like an EXR file for example.

That blows because the heightmap is just right for my scene, not to mention I've already put in a fair bit of work around it... Its exported from Unity World Creator.. the only export format options are .jpg .png .raw8 raw16 & .obj... I tried the .raw16 format but it wont open in Photoshop, under 16bit settings as states 'Specified image is larger than file'!??.. Hmmm... I wonder if Camera Raw will convert it safely to .tiff16??...

What don't kill you only makes you stranger.

Matt

#14
I wonder if their PNG saver has a 16 bit option. If not, raw16 is probably your best bet. You'll need to tell Photoshop what the resolution is. And I assume must be greyscale, not RGB. If you enter the same X and Y size as in World Creator I think it can be made to work. Is there anyone else here who's tried this and can help?
Just because milk is white doesn't mean that clouds are made of milk.