Creating Earth’s Atmosphere

earth-render

There are many aspects to think about when creating earth: terrain color/bump map, cloud layer casting shadows, ocean specular/color map, night city-lights map, and of course an atmosphere. But the trickiest part of creating a good looking earth is keeping the clouds white without the atmosphere tinting them blue.

I learned this technique from the two video tutorials below. What I particularly enjoy about this technique is that the planet shadow casting on the atmosphere isn’t created by a light, instead it’s controlled by a color ramp in the atmosphere shader. So you can directly control where the atmosphere falls off and imitate light scatter. In other words, it doesn’t matter where you place your light because the atmosphere is a system of its own. This means faster render times since there no volume shadows to compute.

By scaling the volume shape you can easily adjust how far out the atmosphere extends. Need to change the thickness of the atmosphere? Just adjust the edge dropoff of the shader.

When you need to have a planet revolving around a sun, well things get a little tricky since the atmosphere shadow isn’t created by a light. But the solution is to simply key the rotation to match the movement. It’s not ideal but hey, kiss it!

I’ve been quite pleased with the simplicity of using a volume primitive for an atmosphere. I’ve not experimented too much with part 2 where they replace the sphere fog shader for the volumetric fluid shader. The added wispy detail is beautiful yet it’s simply not realistic for creating a planet. (but maybe a sun?!) I’m curious to experiment with it merely out of its shadowcasting ability, but I’ve learned alot from working with fluids and textured surfaces together… flickering, odd falloff streaking, crepuscular rays, and such bugs that are so stupidly simple and yet difficult to fix.

DOWNLOAD
maya scene – earth with atmo, color, bump, spec, and trans


Source of Tutorials

Creating a Star Field

One of my favorite things is to fly through a star field in the dome. It’s those particular moments when the dome seemingly disappears and your imagination takes over. It’s truly a majestic and thought provoking experience. But how can you make a star field thats easy to manipulate and renders efficiently?

In the spirit of creating a star field that is reusable but still realistic, we chose to mimic the star distribution of a main sequence star field. Of course it’s all editable if you need. But for all practical purposes this template works beautifully for a flight between star systems. You just need to choose the density of stars.

We decided to go with four different star colors that are the foundation for all the star sprites. They are designed to simulate the look of Sky-Skan’s DigitalSky stars since we use DigitalSky for our star globe backgrounds. You would think that only 4 different star color images being repeated thousands of times on the star sprites wouldn’t be enough variability. But the truth is that within the dome it’s all about the immersion of flying among the stars. Everyone is focused on the grand sense of scale.

Each of the four star colors gets its own particle emitter.
There are two reasons for this:

1) We can easily control the amount and scale of the orange, yellow, white, and blue stars. Meaning that for each star color we can keep the emitter rate equal to the distribution of star types of a main sequence star field. We can also force an allowable range for the scale to be randomized. This means that the colors of stars can correlate to the average size of the star.
2) Mental ray doesn’t play nicely when the particle shape node has more than one texture. There are some hacky solutions for this, but this multiple emitter solution actually grants us more control of the spites since we can manipulate the star color groups individually. Sometimes you just gotta kiss it.

Star Field Stats
— Emitter1: Orange stars – 5000/sec – scale .8 to 1.2
— Emitter2: Yellow stars – 4500/sec – scale 1 to 1.5
— Emitter3: White stars – 600/sec – scale 1.5 to 2
— Emitter4: Blue stars – 300/sec – scale 2 to 4

Whats happening here?
Maya has an excellent particle system that is fisheye compatible. So we use a spherical volume emitter and adjust the ‘away from center’ to 0. This insures that particles are emitted randomly throughout the volume and stay stationary. We use sprites as the particle render type. Sprites are simply a special type of image plane that will always face the camera. We then map a texture onto the image plane. This texture is an stylistic image of a star; I created it from scratch in Photoshop. All of this is already setup in the star field template maya scene. I’m just sharing a bit of framework thoughts for those interested.

DOWNLOAD
maya scene – star field template


Workflow
(Either read below or see the tutorial to the right)
starfield-tutorial1) Open the StarFieldTemplate.mb maya scene file.
2) Make sure you have your scene project setup. Otherwise your initial state will get lost when you open up this scene again.
3) Choose density by ticking the timeline frame-by-frame. I always tend to need much more than I initially imagine. Try placing a test camera in the star field and doing some renders.
4) When satisfied, set an initial state for each of the 4 particle shapes.
5) Zero out the rate for each of the emitters. (but do not ever delete them!)
6) Delete the ppScale creation expression for each of the emitters.
7) Done! Now you can scrub the timeline and the sprites are locked in place. Try a test render!

Don’t Add Lights to the Stars
These stars don’t need to be lit with a light. They have incandescence that makes them self-lit. Any added lights should be light linked away or else it will contribute to lighting the sprites and make the stars brighter than expected.

If you have any issues rendering the sprites…
Go to the Render Globals / Quality / Raytracing / Acceleration / Acceleration Method: change to Regular BSP. Then try BS2.

Editing the Randomized Scale Range
1) Go to the sprite shape node in the attribute editor / Per Particle (Array) Attributes / right click on ‘Expression…’ next to Sprite Scale Y PP / click Creation Expression.
2) Edit the numbers in the last part of the expression text area: rand(.8,1.2)
3) When finished, click ‘Edit’ in the Expression Editor and then close.

Hide Certain Sprites within the Star Field
1) Set your particle lifespan to ‘lifespanPP only’.
2) Right click on the particles and enter component mode.
3) Go to Window > General Editors > Component Editor
4) Find the ‘Particles’ tab, then find the ‘lifespanPP’ field.
5) Now you can select the sprites you want hidden in the viewport. Then type in 0 for their lifespanPP in the Component Editor.
6) After finished, you MUST initial state (again).

starfield-render

Background Stars v1

cropped-starglobe-maya-render(For an improved version of this star globe, please see Background Stars v2.)

Do you need night sky stars with accurate magnitudes and a good looking milky way for the background of your whole Maya scene? Do you want 360 degrees of coverage without any stitch marks, seams, or pole pinching? Well here is what I call the ‘star globe’. (Named out of ease for communicating with my team.)

Just import it, point-constrain it to your camera, and scale the star globe to surround your entire scene. This insures that the star globe will follow the cameras position but not its rotation. For a final render, we typically use preview quality settings and don’t have any aliasing/blinking of the stars. Fisheye camera typically at 500 focal length to shortcut the grey blurry line problem, but it depends how big you’ve scaled the star globe  (you’ll know easily if the stars look blurry and weird).

Also, make sure to check the light linking of the star globe so that there are no lights attached. This is because the star globe material has the texture set to incandescence. This insures that it will look always look the same without having to worry about other light sources accidentally brightening the stars.

DOWNLOAD
maya scene – star globe

StarglobeMayaViewportScreenshot

These stars are optimized to look like pinpoints of light on specifically a dome. But if your final screen is instead flat, well the stars might appear more like spheres of light. In this case I would suggest lowering the camera focal length. Therefore more stars will be in the shot and they will appear smaller. And if you don’t want to change the focal length for your shot, then create a render layer override instead.

The stars were originally rendered in Sky-Skan’s DigitalSky software. PTgui was then used to re-project the night sky images from circular fisheye to equirectangular (what I call ‘defishing’); this was needed for easy UV mapping of a sphere in Maya. We spent alot of time in the dome to optimize the look of the star pinpoints, color saturation, and halo size. So we now use these stars for all of our fulldome productions. Please remember that everyone has different standards of what a star background should look like and this matches our criteria after much discussion about what we liked and didn’t like from other fulldome shows. What looks great on a computer screen does not often transfer to the dome in same way; this was created to look crisp in the dome.

Note: If your renders are starting up slowly, then use Photoshop to convert each of the star globe source images into IFF’s (type: maya, not amiga). Then point the Maya texture nodes to the IFF’s instead. The reason for this is that IFF’s are memory mapped; meaning Maya will only load into memory the parts of the image that it actually needs to render. If you want even faster renders, convert the textures into Mental Ray MAP files.

Custom Maya Camera for Fulldome Production

fulldome-cam-screenshot
Here is a custom Maya camera I’ve made for our fulldome productions. Just import and go! (Requires Domemaster3D)

DOWNLOAD
maya scene – custom fulldome camera rig

Notes
— Uses an aim/up to point the camera. It is applied in a way that allows you to aim the camera and not worry about the camera Z rolling within 180° field of view.
— A hemicube camera rig is parented within fisheye camera (and hidden). Therefore it automatically uses the aim. So if you need to switch over and use hemicube cam for whatever reason, then it’s there and waiting for ya!
— Includes a dome visualization that isn’t selectable. It just lets you know where the camera is facing. It’s also helpful as a guide to see where the springline hits in a scene. I called it the “FYI”.
— Click the camera to see the custom attributes: FYI scale, FYI visibility, FYI Uni Helper, Cam Locator Scale, and Custom Roll. Includes the ability to scale the camera locator without affecting the cam scaleXYZ. (Since changing cam scaleXYZ changes how textures are placed onto surfaces.)
— Preset Domemaster3D settings. (This assumes you already have Domemaster3D installed). Check out this simple tutorial to apply the DomeAFL lens shader to a Maya camera.
— It’s by no means perfect and definitely has a gimbal-lock-camera-flip if you go past 180°, but it works well if you know its limits. Play around with it and you will quickly understand.