Monday, January 17, 2011

Tutorial: How to create a starfield in AE

Okay, here's a tutorial for creating a starfield (like the one we used) in After Effects (AE). I will just show the most basic way of doing this. You can always play with the parameters to have it just the way you like it.



I will also show how we use AE to create DMD previews; this is really cool to see whether the animatin will look good on the actual DMD.

Let's go! : )

First of all: Start AE. In this tutorial I will use the CS4 version. This will also work in older version as well as the newer version CS5:

Once fired up, your screen will look something like this:


After AE is started everything is default in you project. The first thing you want to do is create a new composition. This can be done throught the menu: Composition>New Composition, or just by hotkeying CTRL+N. By doing this. The following screen will appear:


This is the dialog where you set the dimensions, fps, duration of the comp you want to create. In this case we will set the size 1000% of the actual DMD pixels (1280x320), fps to 50 and the duration to 10 seconds.

Of course you could do it 1:1 scale (128x32), but for previewing purposes I choose to go for this resolution...

Allright. Now we've created a new comp with a 1000% size of the actual animation. Next thing to do is add a 'solid' to the comp. Press CTRL+Y, or Layer>New>Solid to create a new solid:


AE will automatically assume you want to create a solid in the comps' dimensions. Choose white to be the color of the Solid and click OK:


Nice.... You just made your first white solid in AE! Great! : )
Now... We're gonna add a nice (default) preset to this solid to create a starfield. There are a lot of default presets in AE to create fantastic effects, but for now, we're just going to use the star burst preset... To find this preset just enter "CC Star"... in the 'Effects & Presets' panel:


Now. Drag the 'CC Star Burst' preset on your white solid in the composition viewport to apply the preset in your comp. You will immediately see the effect in your comp:


In the top left of the screen some parameters will appear for this preset: Scatter, Speed, Phase etc... Of course you can adjust these parameters to create the exact starfield you want, but for now we'll just accept these settings; they're pretty much what we want anyway.

Now is a good time to save your project. Press CTRL+SHIFT+S (Save as...) to save your project. I will call my project 'starfield.aep'.

Since this is the time we really created an animation (The 'CC star burst' preset automatically creates an animated starfield) we can preview the animation by pressing the "0" (zero) on the numeric pad to pre-render the sequence. The animation will now pre-render to the available RAM. The progress of this is shown by the growing green bar above the timeline:


Once the bar is completely green, the animation will play automatically. If you don't have enough RAM to play it, the animation will only play a smaller part of the total animation. No worries, because this is just the preview!! This realtime preview will give you a good idea of how the final animation will perform.

Okay, now is the time to see how this will look on the actual DMD. for this I have a nice litte trick to preview this in AE. First we want this hires comp to be scaled down to 128x32 pixels...

Go to the 'Effects & Presets' panel and type: 'mosaic':


Drag the 'Stylize>Mosaic' preset to your comp to add this preset. Set the parameters to 128x32 (Horizontal Blocks & Vertical Blocks):


Preview the animation by pressing "0" on the numpad. ; )
Now you'll see the hires animation being converted to a lowres 128x32 animation.

For previewing DMD animations I made an overlay image in Photoshop to simulate te 'round' DMD pixels. Select File>Import >File (CTRL+I). Now choose the "DMD-overlay.png" and select Open.

Click here to download the .png.

The file will now appear in your projects panel. Drag this file on to your comp:


Now when you zoom to 100% you will see your comp like a simulated B&W DMD screen:


The only thing left to to is making it red/orange like a real DMD. for this we're going to create a orange solid. Press CTRL+Y, or 'Layer>New>Solid'. Use the color picker to create an orange solid to match the final DMD color:


Click OK to proceed. The Orange layer will now be on top of everything:


To use this layer to colorize the layers beneath it, AE has invented 'Blending modes'. These blending modes will use the selected layer-content to alter the layers beneath them with some very cool algorithms. For this purpose we will use the BM 'Classic Color Dodge'. Right click the 'Orange Solid' in the timeline and select: Blending Mode>Classic Color Dodge:


With this BM applied your comp should look like this:


Press "0" on the Numpad to preview the DMD animation! Cool!

Next thing is to export it to an .png sequence. After that we can convert it to a .dmd file.
Before we convert this Comp to a 128x32 pixel version we first have to remove the preview/overlay layers. Of course you can delete them by selecting the layers and pressing delete, but you could also disable the orange solid and the DMD overlay by clicking the 'eye' icons in front of the layers:


This way you can easily enable the layers again to switch this Comp to preview-mode.

Now, create a new Comp (CNTL+N). This one will be called "DMD 128x32". Set the dimensions to 128x32 pixels. Everything else should be ok: 50fps, duration: 0:00:00:10 :


AE will automatically switch to this new Comp. As you can see the actual size is very small! Only 128x32 pixels which represent the dots on your DMD.

Next, drag the "Stars 1280x320" Comp in the new "DMD 128x32" Comp. Put it in the center of the new Comp; AE will automatically snap to this position:


Ofcourse the Stars Comp is 1000% too big for the DMD Comp, so we need to scale it down a bit. To do this; select the "Stars 1280x320" layer in the timeline and click on the little arrow in front of the layer name to open up the controls for this layer. Click again on the 'Transform' arrow to see the transformation controls for this layer.

Modify the scaling to 10%:


You will now see the Stars Comp scaled down exacty to 128x32 pixels of the DMD. Only thing left to do is render it to a .png sequence.

To render the sequence that's selected in your viewport just press CTRL+M (Menu: Composition>Make Movie). This will bring up the render queue in the bottom part of your screen:


To modify the render settings of the Output Module click the yellow-ish link right next to the "Output Module" (in this example it says 'lossless'). A new window will appear:


Change the 'Format' to "PNG Sequence" and click OK if you want to render a non-alpha sequence. If you want the sequence to be transparent except for the stars change 'Channels' to "RGB + Alpha" and then click OK.

To specify the location of your .png sequence click the link next to 'Output to'... A default Windows dialog will pop up and you can tell AE where to put the files.

Finally hit the 'Render' button and AE will start rendering the sequence!


Because of the small size this won't take very long and in a few seconds you will hear a very nice sample telling you AE has finished rendering the sequence!

Only thing left to do now, is converting the .png sequence to a .dmd file and check it on the real DMD.

Good luck!

No comments:

Post a Comment