Planetside Software Forums

Support => Terragen Support => Topic started by: ragnoru on February 18, 2014, 01:39:16 PM

Title: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 01:39:16 PM
Hi,
I am doing lots of high altitude clouds renders with Terragen3 with airplanes flying through the clouds.
I am rendereing the airplanes in 3dsmax max and the clouds in terragen, I need the airplanes to matte the clouds so I exported the airplanes as an obj sequence from 3dsmax, and the camera as an FBX camera.
When I render the matted clouds there is a significant difference between the 3dsmax render and the terragen render, the only way I found to fix it is to offset the airplane around using the angular position until I find the sweet spot where the difference is just due to anti-aliasing, is this a pivot issue?
As a test I imported the same Obj sequence and camera into nuke and compared to the 3dsmax render, and the position is just perfect.

Matching the 2 renders is really time consuming there must be a better way to have a objects match right off the box.

Obviously having exr2 files out and the ability to deep compositing will make this a non issue, but until than I really need some help on solving this issue I've got way to many shots that need to be delivered in a week
Thank you
Aldo Ruggiero
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 04:22:28 PM
Here are the supporting files.
A simple teapot scene that works perfectly in nuke ( in the zip file you can see that the camera and the tepot match perfectly the 3d render)
and way off in terragen
[attach=1]
[attach=2]
[attach=3]

I attached the terragen file, teapot obj, and fbx camera
Any help with this will really be appreciated
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 05:02:33 PM

Not sure about the real problem but as it is an animation could there be anything related to using the wrong frame as the beginning Aldo?
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 05:08:21 PM
No unfortunately it is the same frame.
I get the same issue with a static camera and static object.
Aldo
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 05:32:45 PM

Alright.
Did you tried to import the fbx file with the "Set project start/end frames on import" box checked in the FBX file import window Aldo?
That changed the position of the object-camera a little.
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 05:53:11 PM
No difference in numbers or visual
[attach=1]
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 06:30:55 PM
I made two renders one with the static fbx imported the other with the animated one.
The two renders were different.
But i could not see any different numbers in the settings. Strange!
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 06:57:31 PM
I made many tests so i hope it is as i think but at least the difference looks like it comes from the blur tab in the camera node.
When i made the Motion blur length zero the renders (animated and not animated) were the same.
Not sure if your problem lies here but it could be worth a look.

Even that in the render node the motion blur is set to off that setting in the camera is changing the position of the camera.
You can see it easily if you put a big number like 40 in the camera blur setting that the position changes quite much.

Looks like a bug.
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Matt on February 18, 2014, 06:59:30 PM
It's probably related to motion blur and the shutter offset:

http://www.planetside.co.uk/wiki/index.php?title=Camera_-_Blur_Tab

If you set the shutter offset to -0.25 it might match.

(Almost certainly true after what Kadri reported. Thanks for doing those tests!)

Matt
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Matt on February 18, 2014, 07:04:08 PM
Setting the shutter offset to -0.25 *appears* to be about right, apart from a slight subpixel offset which might be due to Max's default renderer measuring pixels incorrectly (or my image viewer!).

Matt
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 07:09:24 PM
Kadri really good catch.

Matt
When I turn blur length to 0 i get a 1 to 1 match with a non motion blur frame from 3dsmax
With shutter offset to -0.25 and blur length of 0.5 I get still a visible offset (my planes are going really fast)
With shutter offset to -0.25 and blur length of 0.25 I get still a one to one match
This is with motion blur disabled in the render

Aldo
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 07:14:20 PM

Matt you have your own reasons, but wouldn't it be a little less confusing to change the camera blur to 0 automatically when no motion blur is used in the render node?

Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Matt on February 18, 2014, 07:18:21 PM
Hi Aldo,

There are a few unknowns here. I don't know how Max handles the key frames when motion blur is turned off. You should also be able to choose how the shutter is offset in Max. Sometimes you just have three choices: centred, start, end.

If Terragen matches when you set the shutter offset to -0.25 and the blur length to 0.25, that means that the Max render is rendering as if the key frame is at the end of the exposure (I think), which seems unusual. Will you be rendering with VRay? I'd recommend setting the camera to "centred" in Max/Vray, then in Terragen set the shutter offset to minus the motion blur length divided by 2. That should match. In any case, there should be a way to get them to match almost 100% whatever settings you have in Max, if I know the setting you use. The only big problems occur if you have multi-segment motion blur or non-linear blur which Terragen doesn't support and/or if you have very high curvature between key frames but I don't think that's what's happening here.

Matt
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Matt on February 18, 2014, 07:20:31 PM
Hi Kadri,

The motion blur flag needs to be separate so that you can render out motion vectors and still control the length of the motion blur for the vectors. It works the way it does because it's a good idea to render the non-blurred frame centred on whatever the final blur region will be, not at the start or end of it. You might also need to shift the timing of the key frames.

http://www.planetside.co.uk/wiki/index.php?title=Camera_-_Blur_Tab

But of course if you want to, you can set the camera's motion blur length to 0 if that's the way you'd prefer to disable motion blur (that was the only way to do it in TG2). They just have potentially different consequences.

Matt
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 07:23:03 PM

I see. Thanks Matt!
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Kadri on February 18, 2014, 07:48:09 PM
...
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 18, 2014, 09:05:29 PM
Hi Matt.

You were right the shutter offset of -.25 and motion blur length of .5 seems to give the best match.
(as far as frames rendered without motion blur)

When I turn on motion blur in the renderer the airplane becomes heavily blurred, the plane is linked to the camera and they are travelling at mach 2, the plane and the camera are locked together so I was expecting the clouds below to be heavily motion blurred and the airplane to be sharp.
I think this might be an all separate post regarding the order in which the 3d motion blur is applied..

Now I just need to be able to import the alembic file format inside terragen instead of the objs sequences (it takes me about 3 hours to export these geometries every time there is an animation change) and this job will become a piece of cake.

Thanks again for the help.
Aldo










Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: TheBadger on February 19, 2014, 01:52:53 AM
Excuse me. I was just curious if when talking about alembic sequence is that a separate matter from the discussion on page one entirely? I mean, are you saying you would prefer to do an object sequence over the workflow that you are? OR you are doing an object sequence and you were just mentioning you would prefer alembic to .obj?

If you are doing object sequences in relation to the issue of the OP. I was curious why the talk about compositing... Or were you discussing "Render Elements"?

I am very interested in object sequencing in a TG workflow. But there is only a few topics in the forum right now. So Just asking about it while this thread is current.

Thanks.

Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: Matt on February 19, 2014, 01:39:26 PM
Quote from: ragnoru on February 18, 2014, 09:05:29 PM
When I turn on motion blur in the renderer the airplane becomes heavily blurred, the plane is linked to the camera and they are travelling at mach 2, the plane and the camera are locked together so I was expecting the clouds below to be heavily motion blurred and the airplane to be sharp.
I think this might be an all separate post regarding the order in which the 3d motion blur is applied..

Now I just need to be able to import the alembic file format inside terragen instead of the objs sequences (it takes me about 3 hours to export these geometries every time there is an animation change) and this job will become a piece of cake.

Ah yes, I'd forgotten about that. We don't have object motion blur yet (so all you get is camera blur from the camera moving past an object that's static in world space), but even if we could render object motion blur you wouldn't get blur from an OBJ sequence because there isn't any real motion in it.

We are thinking about Alembic in future.

Given the limitations on motion blur and time to export each new animation, is there some other way you could do this? You can setup render layers for different sets of clouds, and comp all the cloud layers together perfectly in Nuke (even if cloud layers intersect), so you might not need to use object holdouts in many cases.

Matt
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: TheBadger on February 20, 2014, 03:05:35 AM
QuoteWe don't have object motion blur yet (so all you get is camera blur from the camera moving past an object that's static in world space), but even if we could render object motion blur you wouldn't get blur from an OBJ sequence because there isn't any real motion in it.

Ahh, ok, now i understand a bit better.
Title: Re: Imported Obj File Position Not Matching Original File Position/Relation To Cam.
Post by: ragnoru on February 25, 2014, 06:16:07 PM
Alembic is really really quick to export and I would love to see it in Terragen.
I would love to see the ability to render a deep channel with exr2, it would make things a lot easier.

Thank you so much for your help.

Aldo Ruggiero