• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
4

How to: link 2D offset to 3D camera? (Or otherwise mimic 3D motion?)

Engaged ,
Jan 15, 2024 Jan 15, 2024

Copy link to clipboard

Copied

I've got what may be a common question, but I couldn't find an answer so I thought it was worth asking.

Short version: I've got a 2D background that I want to shift as a 3D camera moves.

I know one way to do it is just map the texture (in this case, a starfield) onto an Environment layer and call it a day, but that's more memory-intensive than I want to make it; what I'd like to do instead is make the background tileable, and then as the camera moves, have AfterEffects adjust an Offset effect (or some other method) accordingly, so it appears that the background is moving even if it isn't.

Is this kind of thing possible?

EDIT: okay so using an environment layer WON'T work, it used to be you could have an environment layer visible as a background layer, but now apparently that option's gone.

TOPICS
Experiment , Expressions , How to , Scripting

Views

164

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2024 Jan 15, 2024

Copy link to clipboard

Copied

That's an interesting idea.  And just out of interest, have you compared the render times to CC Environment to an Enviroment layer?

But the solution to what you're after (I think) is to create a null layer, make it 3D and push it back in Z-space so it is as far back as your environment.

Then on the Offset effect's Shift Centre To, hold ALT and click on the stopwatch and in the expressions area type:

thisComp.layer("null 1").toComp([0,0,0]);

 

This will convert the 3D coordinates of the null to 2D coordinates the Offset effect can link to.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 15, 2024 Jan 15, 2024

Copy link to clipboard

Copied

I didn't even know the CC Environment effect existed, to be honest; I did a few quick tests and it definitely renders faster than an Environment layer would (though, since the Environment layer isn't visible as a background layer, that wasn't an option anyway; I swear once upon a time you could show it but even as far back as AE2021 it doesn't work that way).

 

I'll give both approaches a try and we'll see what happens. Great suggestions both though!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2024 Jan 16, 2024

Copy link to clipboard

Copied

I've done something like this with Fractal Noise applied to a 2D layer, with an expression tying Offset Turbulence to the camera's position and POI. It can be fairly convincing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 16, 2024 Jan 16, 2024

Copy link to clipboard

Copied

Dan what was your approach? Same or similar to what ShiveringCactus described?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2024 Jan 16, 2024

Copy link to clipboard

Copied

LATEST

No, I just did some rudimentary math to convert where the camera is pointed to an x/y offset in the noise field. It only worked because the background was always "sky".  One advantage of the noise field though is that it's essentailly continuous in all directions, so it doesn't need to be tiled.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines