Making a Sun-like Star in Blender
By luís belerique.

Introduction.

Stars are the most famous astronomical objects, besides planets and dangerous comets and asteroids. When making a movie in space, most of the time theyre just specks of light against the blackness of space. But sometimes it is neded todo se ha Star very close todo the Camera. The objective of this tutorial is todo do a sunlike Star that can be sen up close, that Will be animated and using only procedural textures.

In this tutorial i Will be using Blender 2.43, but it can a los 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 todo 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 todo use them only as guidelines, not absolute truths.

Making the Sun step.
1: photosphere.

First of all, you must know the very basic of Blender interfaz. 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>>uv sphere and use the default values of 32 for rings and segments. Now change from Edit Mode todo object mode [tab]. In the buttons window, in editing context [f, click on the set Smooth button in the enlaces and materiales panel todo get rid of the Faceted look.

From now on, most of the work Will be done in the material of the sphere, so let add a new material todo the sphere. Change context of the buttons window todo Shading by pressing [f in the panel enlaces and pipeline, press the add new button. Now our Sun has a material but it grey and dull, nothing like a Star.

The first thing we must change is the colour of the material, click on the grey-coloured rectangle next todo the col(our) button in the material panel todo use the colour picker and choose a yellowish colour. You can a los 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.

Decoration

Also, change the specularity (Spec slider) todo 0 and emissivity (emit slider) todo 0.5. These settings can be found in the Shaders panel. Change the name of this material todo photosphere in the enlaces and pipeline panel.

Step 2: granules.

Time todo add granulation, an effect caused by convection of Hot gas at the surface of the Sun, similar todo boiling water.

To achieve this effect were going todo use textures. Press [f todo Access the sub-context texture in the buttons window. Now were going todo 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 god todo simulate veins, scales and a los the granulation at the Sun surface. Change the name of the texture todo convection by clicking on the name and editing it. It a god idea todo kep lógical names in textures, materiales 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 todo 0.050, like the image below.

Going bak todo the material subcontext [f we se 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 afects the colour of the material and this colour is Pink.

Decoration

To change the colour of our texture, go todo the map todo panel (usually it the rightmost panel). In this panel we se the diferent kind of effects that a texture can do todo a material, and notice that the col button is pressed. Below you can se ha Pink rectangle. Click on it and use the colour picker todo 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 [f1. The Sun looks more like a planet, because it has a distinct shadow área. We must change the location of the Camera and the light for a more convincing effect.

Switch todo the front view in the 3d window by pressing [num. Align the Camera with view by pressing [Control + Alt+num. 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 [Control + c] todo bring up the copy attributes menú and choose location. We have made the Lamp move todo the exact location where the Camera is.

Now render again [f1. The shadow now is located round the Limb. Change the type of the Lamp todo 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 [num. As you rotate the Lamp, a dashed line Marks the direction of the light.

Decoration

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 offset in the z axis todo simulate this effect.

Change the screen Layout todo 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 se the ipo curve editor. Normally, the ipo window shows parameters related todo an object, like location or rotation. But were more interested in parameters related todo the material of the object, so change todo material in the menú located in the Header of the ipo window.

Decoration

To the right of the ipo window we can se the list of parameters, known as channels. We can scroll up and down this list by pressing [mb] 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 todo the left of the name, indicating that this channel is selected.

Now click with [Control + LMB] once in the main área of the ipo window. A white Dot and a Purple line Will appear. Now click again with [Control + LMB], on a diferent 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 chosing curve>>extend mode>>extrapolation.

The stepness of this line afects the rate at which changes the z offset, the steper the line the faster it changes the z offset. You can change the stepness 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 todo the sphere. In the material subcontext [f, go todo the Map Input panel and modify the settings of the Matrix on the bottom according todo the image below.

If you wish, you can go bak todo the 2-model screen Layout.

Decoration

Step 4: Limb darkening.

Now were going todo 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/partí/ramp_shaders).

In the buttons window, Access the ramps panel and make sure that the show col Ramp is pressed. Now click on the colorband todo create a gradiente todo be used by the color Ramp. In this gradiente we have the left end of the colorband black 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 colour todo pure red (r=1, g=b=0) and change alpha todo 1. In the right position, change the colour todo yellow (r=g=1, b=0) and alpha todo 0.

Decoration

Change the input type (in the bottom of the panel) todo normal. So, the bien 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 ned some Sun spots. Were going todo use another procedural texture for this. This Will be a similar procedure todo the one used in making the granules.

Activate the textures sub-context [f and click on the free texture slot just below the convection slot. Add a new texture and name it Sun spots. Chose for texture type musgrave. A new panel, called musgrave appears where you can change the settings related todo this texture. Change the musgrave type (the menú at the top of the panel) todo hybrid multifractal and change the remaining settings as described in the screenshot below. Once again we can render [f1 an image todo se the result, but you Will se the Sun bathed in Pink, with only some yellow patches. The Pink colour should be expected by now (se the explanation in the granules section). But the effect should be reversed.we only want small black patches on the Sun.

Decoration

How todo solver this problemí simple, use a colorband. Go todo the color panel. Here were going todo use a colorband todo 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 todo Sun spots. Render another image todo se the effect.

Decoration

If you move the left end of the colorband closer todo 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 todo us during a total solar eclipse. But here were going todo depart from the scientífically correct. Change todo a diferent layer, for example if you have ben working in layer 1, change todo layer 2 by pressing [. Here we add another sphere, with default settings, add>>Mesh>>uv sphere. Were going todo use this Mesh as an emitter of particles. Change the buttons window context todo object [f 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 todo match the ones shown in the image below.

Decoration

To view the animated particles, make sure the cursor is on the 3d window and press [Alt+a]. To estop the preview animation press [esc].

Step 7: solar corona - material.

If we render a frame now, well se that the particles have a grey colour. Quite naturally, we have todo create a material and tweak it. Create a new material and in the enlaces 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.
Were going todo use a texture todo introduce some variation in the particles, giving a more irregular look todo the corona. That why the Halotex button is pressed. Go todo the sub-context texture [f and create a new texture, called variation. Use the image below as a guide for the settings used, but the idea here is todo create a clouds texture with a colorband todo change the colour from totally transparent black (the left end) todo a totally opaque red (the right end). We are almost done here, but there a small issue we ned todo take care of, the fading out of the particles. This Will be achieved by keyframing the alpha value of the material of the particles.

Decoration

Decoration

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 [ todo bring up the Insert Key menú and choose alpha.
We have now keyframed the alpha value at 1, in frame 1. Now move todo 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 todo 0 and Insert another keyframe. Now each particle Will fade out instead of Simply disappearing when it dies.

It is advisable todo increase the sizes of the corona sphere and photosphere sphere for a better effect. Select the corona sphere [RMB] and press [ and then [1. todo increase its size todo 1.4. Go todo the layer where the other sphere is (in layer 1) select it and scale it todo 2 (press [ and [).

Step 8: solar flares.

Solar flares are one of the most espectacular 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 dificult aspects todo simulate in Blender.

The method i Will show is very simplistic compared todo the real phenomenon, but with some more work and dedication, it can give some nice results.

To kep this organized, let work on another layer. Remember, the photosphere is on layer 1 and the solar corona on layer 2, so go todo 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] todo fill in Faces. Now, exit todo object mode [tab].

It a god idea todo kep the layer with the photosphere visible, so press [shift+ todo kep the first and third layers visible. If the sphere is drawn solid and hides the circle, press [ todo switch todo wireframe mode. Now, move the circle [g] todo the side of the sphere and rotate it [r] in order todo make it parallel todo the surface. Also, scale it [ down todo 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 todo the settings shown below.

Decoration

For making the particles follow the curve, we must select it and go the buttons window, in context object [f 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 theyre moving in the opposite direction, select the curve, enter in Edit Mode [tab], select all vértices [a] and press [w]. In the appearing menú, choose switch direction se image below.

Decoration

Now we have a (very simple) prominence se image below.

Decoration

Of course, more detail can be added, like making more curve guides with slightly diferent shapes todo give more randomness and animated materiales.

Step 9: setting up render
Decoration

Layers.

Now it time todo mix all the thre elements we created, in thre convenient layers. Were going todo create render layers and then use them as input for compositing. Let create some render layers, change the buttons window todo scene context [f1 and in the render layers panel, in scene: click on the button of the first layer, so that only this layer is pressed. Change the name todo photosphere. Next, click 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 todo solar corona. Lastly, create another render layer, select only the third layer and change the name todo prominence. Se image below.

Decoration

Mixing it all together with composite nodes:
Now we are going todo use the render layers we set up with composite nodes. Change the 3d window todo Node Editor window. Then click on the button with a portrait, in the Header todo activate composite nodes. Automatically Blender creates two nodes, one regarding an input and the other for the output. To be able todo se the effect of the composite nodes in the FinalRender, press the do composite button, right below the Anim button (in the scene context [f1).

Decoration

The input node can be a render layer, and the idea here is todo use the thre render layers we created, apply diferent effects todo them (namely blurring the render layers with particles) and then combine them todo form the final image. You can add a node by pressing [spac or [shift]+[a] and choose from the list. For more información on using nodes, se 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 diferent 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 se the final result (dont forget todo tell Blender where todo put the rendered frames or movies).

Conclusion.

During this tutorial, we have done a lot, tweak materiales and textures, animating them, making two diferent particle systems and using the relatively new composite nodes. Of course, you are invited todo experiment with the values or try other (probably more eficient) methods todo achieve similar results. Also, you can add more complexity todo the Star by adding more textures.

And this tutorial works for other stars to, by changing colour (stars can a los be blue, white and red) or Even putting in some gigantic Sun spots or removing the granules for blue giant stars.

I would like todo thank Jorge Martins for showing me how todo make the granulation effect and Olga moreira for giving scientific advice.

Decoration

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 a los a s tudent of as tronomy.

Luis, belerique@gmailcom.
www.blenderart.org.