# What Shading/Rendering techniques are being used in this image?

My previous question wasn't clear enough. From a rendering point of view what kind of techniques are used in this image as I would like to apply a similar style (I'm using OpenGL if that matters):

My specific questions are:

How is that sun glare made? How does the planet look "cartoon" like? How does the space around the planet look warped/misted? How does the water look that good?

I'm a beginner so any information/keywords on each question would be helpful so I can go off and learn more. Thanks

• possible duplicate of Procedural Planets, Heightmaps and Textures Oct 29 '13 at 20:20
• Keep in mind that generating planets and rendering them are pretty different. Can you be more specific about what you need?
– House
Oct 29 '13 at 20:33
• Hi Byte56, sorry for the confusion, I'm OK generating the planet, I'm mainly interested in the rendering effects seen in this image, and the techniques used to make them thanks Oct 29 '13 at 20:49
• I edited your question to be about the rendering, effects, like you said. But it appears you've accepted an answer about generating the planet. Which is it?
– House
Oct 29 '13 at 21:30
• Sorted Byte sorry for the confusion Oct 29 '13 at 21:43

1) The planet is "cartoon" like because it doesn't use any textures and has a large detail size.

3) One thing to remember is that water has much higher specularity than land or clouds. Look at reference pictures of Earth, for example:

• Perfect! Thanks and sorry if this was common sense I'm just beginning. I've just looked briefly at atmospheric scattering and it looks as though that will be occupying most of my time over the next couple of weeks :). Thanks again Oct 29 '13 at 21:51
• remember that the gem article tries for a more realistic approach. You could get away with much less work by faking it with a blur pass. Oct 29 '13 at 22:02

There are a few broad approaches to generating a tesselated, spherical surface mesh. Here a couple of the more common ones...

• Construct a cube with densely-subdivided planes, then expand those planes outward into a spherical form: this is simple enough -- for each surface point, calculate a vector from the origin (centre of cube) to that point, normalize the vector such that the point is at distance one from the origin, then multiply the position vector by your desire planetary radius. The nice thing about this approach is that triangulation is extremely simple, because you simply subdivide each plane of the cube as though it were a grid, and then split into two triangles per grid cell (you'll have seen this many times before).

• Construct some set number of points at the planet's origin (core), and push them out to some distance using randomly-rotated quaternions; the distribution over the sphere surface can then be evened out using physical methods; think of how a fibre-optic lamp's fibres spread out fairly evenly over some space, because of physics:

Gravity creates a similar effect here, to what would occur if each fibre-tip repelled the other as though with atomic forces, which is exactly the approach you could apply to create a more even distribution (related to the concept of Lloyd Relaxation, which can also be applied in three dimensions). Once you have these points, you can use something like Delaunay Triangulation (or any other triangulation algorithm you wish) to triangulate the points into a fully-connected mesh.

If you are constructing a voxel-based world...

• 3D cells / voxels provide a simplistic, if brute-force / less performant option. The viability of this approach depends very much on your planetary radius and desired surface resolution, and whether or not you use accelerative, spatial subdivision structures like octrees or KD-trees. Basically, create a cubic voxel volume with a diameter equalling that of your desired planetary body. For every voxel (likely to be in the millions if not billions or trillions), perform a distance check from the centre of the world (i.e. centre of the cubic volume), and if the distance is greater than your desired planetary radius, remove that voxel from the grid. Clearly, this is an O(n^3) operation involving multiple square root operations per 3D-vector radial magnitude check, meaning it will be very costly indeed even for a world diameter of 1000 voxels (10^9 checks). However, this may be acceptable for worlds which are generated in their entirety before play commences.
• wow thanks for the input Nick, I never really thought of generating planets from that point of view (especially the cube method which seems obvious now). From a rendering point of view, is there any particular techniques this guy is using on his planet that I could Google to look into more? It just seems very cartoon like and I haven't got a clue how to get my water looking like that. Thanks Oct 29 '13 at 20:57
• @Rhakiras No problem, yes the cube approach is amazingly obvious once it's demonstrated! I remember feeling the same way. Your rendering question needs to be separate, I'm afraid. Essentially, this is a computational geometry / procedural generation question primarily, and I have retagged it as such. We deal with rendering issues separately when we architect code, so again, please do open a new question for "how you want things look" in the shader / surface detail sense. Oct 29 '13 at 21:03
• Ah ok no problem I understand I will do :-), thanks you the help again! Oct 29 '13 at 21:06

Two things others didn't mention:

The ripples in the water surface are made by Bump-mapping, where you use a texture to add fake depth to your objects(a.k.a. Normal mapping). You could even animate this with noise, so you don't need a texture, just GLSL noise generation.(Quite simple and awesome effect)

The very subtle "fog" around the planet might be a camera-facing billboard with a very low alpha and some foggy texture. And the annoying bands that it creates are probably because they didn't use HDR.