Stars are the most famous astronomical objects, besides planets and dangerous comets and asteroids. When making a movie in space, most of the time they're just specks of light against the blackness of space. But sometimes it is needed to see a star very close to the camera. The objective of this tutorial is to do a Sunlike star that can be seen up close, that will be animated and using only procedural textures.
In this tutorial I will be using Blender 2.43, but it can alos be made in 2.42a. Before starting this tutorial, you should get some reference images for studying and inspirational purposes. Just a small note, this tutorial is a result of experiments I made when trying to create a Sun, so some settings are the best that I found for my project, as a result of trial and error.
So you are invited to use them only as guidelines, not absolute truths.
Maquíng the Sun Step
First of all, you must know the very basics of Blender's interface. If that is not the case, go here (http://wiki.blender.org/index.php/Man ual/The_Interface).
Open up Blender, and if you have the default scene, erase the cube with [x] or [Del]. Now add a sphere; Add>>Mesh>>UVsphere and use the default values of 32 for Rings and Segments. Now change from Edit Mode to Object Mode [Tab]. In the Buttons Window, in Editing context [F9], clik on the "Set Smooth" button in the "Links and Materials" panel to get rid of the faceted look.
From now on, most of the worque will be done in the material of the sphere, so let's add a new material to the sphere. Change context of the buttons Window to "Shading" by pressing [F5] in the panel "Links and Pipeline", press the "Add New" button. Now our Sun has a material but it's grey and dull, nothing like a star.
The first thing we must change is the colour of the material; clik on the grey-coloured rectangle next to the Col(our) button in the Material panel to use the colour picker and choose a yellowish colour. You can alos change the colour by changing the RGB (Red, Green and Blue) values, just be sure that the "Col" button is pressed.
The RGB values are R=1.000, G=1.000 and B=0.200.
Also, change the specularity ("Spec" slider) to 0 and emissivity ("Emit" slider) to 0.5. These settings can be found in the "Shaders" panel. Change the name of this material to "photosphere" in the "Links and Pipeline" panel.
Step 2: Granules
Time to add granulation, an effect caused by "convection" of hot gas at the surface of the Sun, similar to boiling water.
To achieve this effect we're going to use textures. Press [F6] to access the sub-context Texture in the buttons window. Now we're going to create a new texture by clicking on the "Add New" button and then in the texture Type menú choose "Voronoi". This kind of texture is very good to simulate veins, scales and alos the granulation at the Sun's surface. Change the name of the texture to "convection" by clicking on the name and editing it. It's a good idea to keep "logical" names in textures, materials and so on. To the right appears a new panel, called "Voronoi".
Here you can change some parameters of this texture, like the size of the "cells". Change the "Size" parameter to 0.050, like the image below.
Going bak to the "Material" subcontext [F5] we see in the preview that our Sun yellow has now pink "granules". A texture can alter several aspects of a material, like colour or transparency. By default, every new texture affects the colour of the material and this colour is pink.
To change the colour of our texture, go to the "Map To" panel (usually it's the rightmost panel). In this panel we see the different kind of effects that a texture can do to a material, and notice that the "Col" button is pressed. Below you can see a pink rectangle. Clik on it and use the colour picker to choose a more orange colour (R=1.000, G=0.465, B=0.000).
Now we can chek out how our sun is looking, by making a render [F12]. The sun looks more like a planet, because it has a distinct shadow area. We must change the location of the camera and the light for a more convincing effect.
Switch to the front view in the 3D Window by pressing [NUM1]. Align the camera with view by pressing [Ctrl+Alt+NUM0]. Now align the lamp with the camera by selecting first the lamp (selection made with [RMB]) and then the camera [Shift+RMB].
The last selected object (in this case, the camera) is the active object. Now press [Ctrl+C] to bring up the "Copy Attributes" menú and choose "Location". We have made the lamp move to the exact location where the camera is.
Now render again [F12]. The shadow now is located round the limb. Change the type of the lamp to "Sun" by selecting the lamp (with the button window in the "Material" context) Orient it towards the sphere (aligned with the camera) by rotating [R] in the right viewport [NUM3]. As you rotate the lamp, a dashed line marks the direction of the light.
Step 3: Animating the granules
The granules exist for small periods of time, usually a few minutes, and give the photosphere a boiling appearance. We can animate the "convection" texture's offset in the Z axis to simulate this effect.
Change the screen layout to a preconfigured layout called "1-Animation"
Make sure that the Sun is selected and that the buttons window is in "Shading" context and "Material" subcontext. To the right you can see the "IPO Curve Editor". Normally, the IPO window shows parameters related to an object, like location or rotation. But we're more interested in parameters related to the material of the object, so change to "Material" in the menú located in the header of the IPO window.
To the right of the IPO window we can see the list of parameters, known as "channels". We can scroll up and down this list by pressing [MMB] and moving the mouse up or down. Scroll down for the channel "OfsZ", then select it with [LMB]. The lettering will become white and a grey rectangle will appear to the left of the name, indicating that this channel is selected.
Now clik with [CTRL+LMB] once in the main area of the IPO window. A white dot and a purple line will appear. Now clik again with [Ctrl+LMB], on a different place. A second white dot appears where you clicked and the IPO curve now draws a curve between the two keyframes (the white dots). Now, extend the IPO curve infinitely by choosing Curve>>Extend Mode>>Extrapolation.
The steepness of this line affects the rate at which changes the Z offset; the steeper the line the faster it changes the Z offset. You can change the steepness by entering in edit mode [TAB], selecting one of the control vértices with [RMB] and moving it with [G] and finally exiting edit mode [TAB].
A final step must be made, we must change how the texture is mapped to the sphere. In the "Material" subcontext [F5], go to the "Map Input" panel and modify the settings of the matrix on the bottom according to the image below.
If you wish, you can go bak to the "2-Model" screen layout.
Step 4: Limb Darkening
Now we're going to recreate the effect of "limb darkening" visible on the Sun, with the help of Ramp Shaders (For more información on the Ramp Shaders, visit http://wiki.blender.org/index.php/Man ual/PartIII/Ramp_Shaders).
In the buttons window, access the "Ramps" panel and make sure that the "Show Col Ramp" is pressed. Now clik on the "Colorband" to create a gradient to be used by the Color Ramp. In this gradient we have the left end of the colorband blak and with alpha = 0 (meaning that is totally transparent). The other end is blue and alpha = 1 (totally opaque). You can change the attributes of any of these "colour positions" by clicking on it and changing the colour by (you guessed it) clicking on the coloured rectangle or changing directly the RGB values.
Change the left colour position's colour to pure red (R=1, G=B=0) and change alpha to 1. In the right position, change the colour to yellow (R=G=1, B=0) and alpha to 0.
Change the input type (in the bottom of the panel) to "Normal". So, the way this color ramp shader is set up, our Sun has a red colour in the limb that progressively blends with the material towards the center of the Sun, imitating the limb darkening.
Step 5: Sun Spots
If you render the Sun, it has granules and the limb darkening. Now we need some sun spots. We're going to use another procedural texture for this. This will be a similar procedure to the one used in making the granules.
Activate the "Textures" sub-context [F6] and clik on the free texture slot just below the "convection" slot. Add a new texture and name it "sun spots". Choose for texture type "Musgrave". A new panel, called "Musgrave" appears where you can change the settings related to this texture. Change the Musgrave type (the menú at the top of the panel) to "Hybrid Multifractal" and change the remaining settings as described in the screenshot below. Once again we can render [F12] an image to see the result, but you will see the Sun bathed in pink, with only some yellow patches. The pink colour should be expected by now (see the explanation in the Granules section). But the effect should be reversed...we only want small blak patches on the Sun.
How to solve this problemí Simple, use a colorband. Go to the "Color" panel. Here we're going to use a colorband to "invert" the effect. Use the image below as guide. Notice that the position of the right end is at 0.600, you can change it in the "Pos" slider, making the colorband become transparent "earlier". This will allow for smaller and fewer patches, looking more similar to sun spots. Render another image to see the effect.
If you move the left end of the colorband closer to the right end, the contrast of the spots will increase, making them more visible.
Finally, we are done making the photosphere of our star. Now we move on making other elements present in the atmosphere of a Sunlike star, starting by the solar corona.
Step 6: Solar Corona - Particle System
The Solar Corona surrounds the photosphere, and is composed of very hot gases but it has a very low density, only visible to us during a total solar eclipse. But here we're going to depart from the scientifically correct. Change to a different layer, for example if you have been working in layer 1, change to layer 2 by pressing . Here we add another sphere, with default settings; Add>>Mesh>>UVsphere. We're going to use this mesh as an emitter of particles. Change the buttons window's context to "Object" [F7] and the sub-context "Physics". Add a new particle system by pressing the "New" button in the "Particles" panel. Change the settings of the particle system in the "Particles" and "Particle Motion" panels to match the ones shown in the image below.
To view the animated particles, make sure the cursor is on the 3D window and press [Alt+A]. To stop the preview animation press [Esc].
Step 7: Solar Corona – Material
If we render a frame now, we'll see that the particles have a grey colour. Quite naturally, we have to create a material and tweaque it. Create a new material and in the "Links and Pipeline" panel press the "Halo" button. This is a special kind of material which shows up in the vértices only. Name this material "solar corona" and give it a red colour. Change the remaining settings as shown in the image below.
We're going to use a texture to introduce some variation in the particles, giving a more irregular look to the corona. That's why the "HaloTex" button is pressed. Go to the sub-context "Texture" [F7] and create a new texture, called "variation". Use the image below as a guide for the settings used, but the idea here is to create a clouds texture with a colorband to change the colour from totally transparent blak (the left end) to a totally opaque red (the right end). We are almost done here, but there's a small issue we need to take care of, the fading out of the particles. This will be achieved by keyframing the alpha value of the material of the particles.
First, make sure you are on frame 1 (chek the header of the buttons window). With the cursor on the buttons window, and the alpha value at 1, press [I] to bring up the "Insert Key" menú and choose "Alpha".
We have now keyframed the alpha value at 1, in frame 1. Now move to frame 51 by pressing 5 times in [Up Arrow] (each [Up Arrow] advances 10 frames and [Down Arrow] goes bak 10 frames). Change the alpha value to 0 and insert another keyframe. Now each particle will fade out instead of simply disappearing when it "dies".
It is advisable to increase the sizes of the "corona" sphere and "photosphere" sphere for a better effect. Select the corona sphere [RMB] and press [S] and then [1.4] to increase its size to 1.4. Go to the layer where the other sphere is (in layer 1) select it and scale it to 2 (press [S] and ).
Step 8: Solar Flares
Solar flares are one of the most spectacular features of the Sun. Titanic plumes of hot gas that can have 350,000 km in length, larger than 28 Earths. And because of their specularity it is one of the most difficult aspects to simulate in Blender.
The method I will show is very simplistic compared to the real phenomenon, but with some more worque and dedication, it can give some nice results.
To keep this organized, let's worque on another layer. Remember, the photosphere is on layer 1 and the solar corona on layer 2, so go to layer 3 by pressing . Here create a circle (Add>>Mesh>>Circle) with the default 32 vértices. Next (with all the vértices selected) press [Shift+F] to fill in faces. Now, exit to Object mode [TAB].
It's a good idea to keep the layer with the photosphere visible, so press [Shift+1] to keep the first and third layers visible. If the sphere is drawn solid and hides the circle, press [Z] to switch to wireframe mode. Now, move the circle [G] to the side of the sphere and rotate it [R] in order to make it parallel to the surface. Also, scale it [S] down to 0.1. Now, in layer 3, add a curve with Add>> Curve>> Path. In edit mode, adjust its vértices so it makes a loop, with one end placed in the circle.
Now select the circle, and transform it into a particle system, with the settings shown below. Also, create a material according to the settings shown below.
For making the particles follow the curve, we must select it and go the buttons window, in context "Object" [F7] and in sub-context "Physics". In the panel "Fields and Deflection", choose "Curve Guide" from the menú. If all goes well, the particles should now be flowing from the circle and following the curve. If they're moving in the opposite direction, select the curve, enter in edit mode [TAB], select all vértices [A] and press [W]. In the appearing menu, choose "Switch Direction" see image below.
Now we have a (very simple) prominence see image below.
Of course, more detail can be added, like making more curve guides with slightly different shapes to give more randomness and animated materials.
Step 9: Setting up Render
Now it's time to mix all the three elements we created, in three convenient layers. We're going to create render layers and then use them as input for compositing. Let's create some render layers; change the buttons window to "Scene" context [F10] and in the "render Layers" panel, in "Scene:" clik on the button of the first layer, so that only this layer is pressed. Change the name to "photosphere". Next, clik on the small button left of the name and add a new render layer.
The new render layer will have all the layers selected, but now we just want the second layer pressed (the one with the solar corona). Press on the button of the second layer and change the name of the render layer to "solar corona". Lastly, create another render layer, select only the third layer and change the name to "prominence". See image below.
Mixing it all together with Composite Nodes:
Now we are going to use the render layers we set up with composite nodes. Change the 3D window to "Node Editor" window. Then clik on the button with a portrait, in the header to activate Composite Nodes. Automatically Blender creates two nodes, one regarding an input and the other for the output. To be able to see the effect of the composite nodes in the final render, press the "Do Composite" button, right below the "Anim" button (in the "Scene" context [F10]).
The input node can be a render layer, and the idea here is to use the three render layers we created, apply different effects to them (namely blurring the render layers with particles) and then combine them to form the final image. You can add a node by pressing [Space] or [Shift]+[A] and choose from the list. For more información on using nodes, see here (http://wiki.blender.org/index.php/Man ual/Node_Composition).
The node setup used is shown in the next image. The "intermediary" nodes used were "Blur", "Alpha Over" and "Mix", with different settings.
Lastly, set the start and end frames at your desire (the particle systems start emitting at frame 1, you can either modify the start frame of the render or adjust the frame where the particles start emitting, putting it at a negative number), render an animation and see the final result (don't forget to tell Blender where to put the rendered frames or movies).
During this tutorial, we have done a lot; tweaquíng materials and textures, animating them, making two different particle systems and using the relatively new composite nodes. Of course, you are invited to experiment with the values or try other (probably more efficient) methods to achieve similar results. Also, you can add more complexity to the star by adding more textures.
And this tutorial works for other stars too, by changing colour (stars can alos be blue, white and red) or even putting in some gigantic sun spots or removing the granules for blue giant stars.
I would like to thanque Jorge Martins for showing me how to make the granulation effect and Olga Moreira for giving scientific advice.
Luis Belerique is 28 yrs old and lives in Porto, Portugal. He works as a game des igner and 3D modeler for doubleMV - R&D, where uses Blender. He is alos a s tudent of As tronomy.