Terragen -> Projection Mapping ?

Started by Floating.Point, January 15, 2010, 10:23:55 AM

Previous topic - Next topic

Floating.Point

Hello all,

I am a young environments artist currently working and studying in Australia.
I utilize cinema 4d quite a lot for its wonderfully intuitive camera projection workflow.
I am very new to Terragen but am extremely excited about its possibilities.

I have come to a bump which I cannot seem to overcome so some support and ideas would be greatly appreciated.

My goal is to build up a terrain in Terragen and utilize its beautiful render engine to produce high res plates. I would like to then (somehow) bring in the geometry and camera into my 3d package (c4d) and use the render to project through the camera onto the geometry generated by Terragen.

Please dont mistake my query as being a question about camera projections ( I am quite experienced with that already). Instead my problem is I do not understand how I can get the geometry and camera out of TG2 and into C4D.

If anyone could point me in the right direction I would be thoroughly grateful.

Many Thanks,

Nathan

PS. my apologies if this question has been answered, I could not seem to find any information despite having tried a good while before posting. Thanks again.


Falcon

For the terrain, if you have a heightfield you can export it as an LWO object (rather: A series of LWO objects in an LWS scene).

For procedural terrain, I use an ortographic camera with -90/0/0 rotation (i.e. straight down) and a distance shader giving me elevation of the terrain. This can then be used, e.g. in the displacement channel in Cinema 4D or you may find a way to generate an actual terrain mesh from it.

The camera is tricky. Your best approach would probably be to take it from the .tgd file, which is a fairly easy to understand XML file.

Hetzen

#2
I use 3D Studio Max and have no working knowledge of C4D, but in Max there's a good plugin which imports camera and light information from TG scene files. You can also import lwo geometry out of TG, but I wouldn't use that, as it exports millions of unconnected triangles even at low render settings. Instead I would export a heightfield map out, by connecting your landscape through a new heightfield generate shader, then right click and save that to a .ter, import that into Max, then tweak the displacement looking through the imported camera until I get it lined up. If for some reason, like plant populations, that doen't work, then you could use a low poly lwo export then use that as a template to push pull vertices on a plain in the 3d ap to get things to line up.

But my favoured way is to ignore the camera projection aproach completely and just take the camera out of the 3d app and bring it and it's animation into TG then stick it on the farm over night. Way more flexible interms of limited perspective shift you'd get from projection, just takes longer to render. That's if I can't just get away with a sky box, or a background still plate.

Sorry I know this doesn't answer your question for C4D, but it may give you a steer on what to look for when working out your solution.

* just seen Falcons reply, which will also need some tweakage to get right with the conversion from black to white into real terms that you can dial into C4D, but definately workable.

Floating.Point

Thanks for the fast reply,

I didn't realize that the TG2 script was human readable... its quite a beautiful thing to just read through!

I have a couple of questions if you wouldn't mind elaborating a bit...

QuoteFor the terrain, if you have a heightfield you can export it as an LWO object (rather: A series of LWO objects in an LWS scene)

While importing this geometry into C4D, do you know at what scale to import to ensure the camera will match?

QuoteFor procedural terrain, I use an ortographic camera with -90/0/0 rotation (i.e. straight down) and a distance shader giving me elevation of the terrain. This can then be used, e.g. in the displacement channel in Cinema 4D or you may find a way to generate an actual terrain mesh from it.

What a cool trick! you clever thing you!!
can you suggest any tricks to getting the mapped displacement to match the camera perfectly? or is it matter of just doing it by eye?

QuoteThe camera is tricky. Your best approach would probably be to take it from the .tgd file, which is a fairly easy to understand XML file.

Cool Cool Cool! like I said before, beautiful human readable script (I am falling in love with TG2 tonight)
My biggest concern is that even though I can get Terragens camera position from the script, how do I ensure my imported geometry (/displacement) values are relative to the camera in cinema 4d?

Thanks a lot for your support.

Nathan   

Floating.Point

#4
Thanks Hetzen

(I didn't notice your post before I replied to Falcon)

In an ideal world I would love to let Terragen do my renders, unfortunately I do not have access to a farm with TG2 implemented.

Im going to play with these new avenues tonight and see how I go, I was naive to think there would be a magic button that made it work!! lol  

PS. When rendering sequences, do you use GI? have you encountered problems with flickering like I have read about? These problems are another factor which have influenced me to go down the projection path- I am not so strong with manual lighting and have done all of my still renders thus far with GI enabled.     


Hetzen

Flickering appears in all walks of GI life I'm afraid. So yes it is a toss up between projection and frame rendering. TG has some rather good AA features as well as GI blur that can minimise these effects, depending, as always, the scene you're working on. Don't ever be afraid to break up a scene through different packages handling fore, mid and background, then re-compiling in a compositing package. You'll end up with a lot more control over final look as well as speed to delivery. A lot of backgrounds have almost zero paralax.

As for using TG on a farm. Deadline has been pretty rock solid once you get your head around the syntax, which is actually quite simple.

Falcon

Quote from: Floating.Point on January 15, 2010, 11:19:20 AM
QuoteFor procedural terrain, I use an ortographic camera with -90/0/0 rotation (i.e. straight down) and a distance shader giving me elevation of the terrain. This can then be used, e.g. in the displacement channel in Cinema 4D or you may find a way to generate an actual terrain mesh from it.

What a cool trick! you clever thing you!!
can you suggest any tricks to getting the mapped displacement to match the camera perfectly? or is it matter of just doing it by eye?

I don't need precision in the stuff I do, so eyeballing it works for me. But you could use the distance shader and displacement size in C4D. In other words: You know the value/height of "white" in your TG2 scene, because that's identical to what you set in the distance shader as "far colour". Set the same value as the displacement value in C4D and you should end up with a correct displacement.



Floating.Point

#7
Quote from: Falcon on January 15, 2010, 10:34:45 AM
For procedural terrain, I use an ortographic camera with -90/0/0 rotation (i.e. straight down) and a distance shader giving me elevation of the terrain. This can then be used, e.g. in the displacement channel in Cinema 4D or you may find a way to generate an actual terrain mesh from it.

Hey Falcon,

I have managed to get a dynamically updating mesh from a greyscale displacement map - very easily using mograph, and its very fast too!!

Would you mind going into some detail regarding the setup of the distance shader?
I am uncertain of the method for determining the correct near and far distances...

I am so close now, I can feel a solution just around the corner :)

if appropriate, perhaps you wouldn't mind attaching a very simple example?

Many Thanks,

Nathan

tvu

Quote from: Floating.Point on March 22, 2010, 11:54:01 AM
Quote from: Falcon on January 15, 2010, 10:34:45 AM
For procedural terrain, I use an ortographic camera with -90/0/0 rotation (i.e. straight down) and a distance shader giving me elevation of the terrain. This can then be used, e.g. in the displacement channel in Cinema 4D or you may find a way to generate an actual terrain mesh from it.

Hey Falcon,

I have managed to get a dynamically updating mesh from a greyscale displacement map - very easily using mograph, and its very fast too!!

Would you mind going into some detail regarding the setup of the distance shader?
I am uncertain of the method for determining the correct near and far distances...

I am so close now, I can feel a solution just around the corner :)

if appropriate, perhaps you wouldn't mind attaching a very simple example?

Many Thanks,

Nathan


Hi Nathan,

How did you go with the Terragen 2 to C4D?

I think there is supposed to be a plugin for this called Terracin?

I can't find out too much about it as it seems to be for c4d 8.2 (anchient)?

What do you know?

Thanks,

Greg

Floating.Point

Howdy Greg,

I had some time away from TG2 of late (I became a little overwhelmed)-
Just tonight I set up some test scenes... and to my delight, my absence from the program proved worthwhile!
I had a bit of an "Ah-Ha" moment where many aspects of the engine became clear to me!

;D

As for getting geo + cameras into c4d it is fairly straight forward and I am using methods discussed in this thread:

http://forums.planetside.co.uk/index.php?topic=6346.0

let me know if you need some help

Cheers,

Nathan