Making fictional 3D planetary nebulae

All tutorials about Celestia go in here. For Celestia itself, add-ons, textures, scripting, etc.
Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Making fictional 3D planetary nebulae

Post #1by Fenerit » 27.09.2010, 02:04

A small tutorial for making fictional 3D planetary nebulae.
An issue in such a kind of modelling could be that of the form to be assigned to the meshes for best fitting their complex shapes. One of the best solutions, imho, is that of using math softwares through the use of parametric equations. There are several, powerful softwares which does that, but mostly not free and expensive. My suggestion here is toward K3DSurf, a software that Linux users knows well. It is free, open source and multi platform. Moreover it export the math forms in OBJ format.

http://k3dsurf.sourceforge.net/

The program is shipped with lots of mathematical examples for the "classic" curves and surfaces. Here is used the parametric functions with spherical coordinates ("Parametric" tab). Playing a bit with sine and cosine is easy to achieve the own favorite meshes. Raising to the powers does stretch and ondulate the forms, good for central ejecta. Non powers makes "blobbish" shapes, good for gas coverages. And so on. A slide control increase or decrease their smoothingness. Isn't important to smooth alot the mesh, 1, 2k polys is enough. This will light up the files even for complex nebulae made of several meshes.


Image


TEXTURING
This step is using GIMP as reference.

- make a new 256x256 or 512x512 empty (transparent) canvas (2:1 textures are good too)
- choose "Filters" > "Render" > "Lava" and apply the effect
- choose "Filters" > "Map" > "Make Seamless" ("Make Seamless" isn't strictly necessary, anyhow)
- choose "Colors" > "Color to Alpha" and set the "black" as color to alpha

Repeat the procedure above with other gradients and seeds, and overlay the layers in order to mix colors and save the images as PNG with different custom names for each one of the models.

Image

Note that "Lava" is good for pillars, remnants and clusters, while for gases maybe is better the "Cloud" filter, which is in the same menu. Even for "Clouds" is preferable to do the "Color to Alpha" procedure and then "Colorify". Nonetheless, "Cloud" is more tricky. The "Alpha" procedure allows the CMODs, which must be transparents, to be transparents definitely in such parts. These are peer-user setting, always changeable through the CMODview and/or by assigning more transparency to each texture.

THE CMODs
Once the meshes have been exported in OBJ form from K3DSurf (tab "Export"), must be open within a 3d modeler in order to assign to each one mesh the spherical UV map projection and its texture. Even the cylindric and the plane projection can be used under certain circumstances. Do not forget the placeholder construction, which can be simply a bounding cube as well as points placed on quadrants, like the compass. The final nebula model have to be built within the modeler, since the axes of the meshes couldn't be centered respect to world scale, and whether one would wish to add a point sprite as nucleii instead of another mesh, it should be out of center (and the camera, too).
At this point, do save the model in 3DS format and open it within the CMODview. In there, do assign roughly:

- emissive 1 1 1 (255 255 255, from colors' panel)
- opacity 0.3 to the inner meshes, 0.2 to the outer meshes, and so on.
- shineness 100 (not require)

Save as CMOD and make the .DSC file.

Two screengrabs of the same nebula from two different points of view. The nebula is made of just two meshes. More meshes, more colors, more transparency levels, etc... and the nebula can be more dimmer, which look best. Sprites can improve the look, although expensive for performances.

Image

Image

Test zip: [url] Nebula is named Forum nebula. Extract in ..\extras folder and make sure that nebula render be active.
http://marauder.webng.com/files/forum_nebula.zip 1 Mb mostly textures
Last edited by Fenerit on 27.09.2010, 18:13, edited 2 times in total.
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #2by Fenerit » 27.09.2010, 13:02

Just two complements:

- the step relevant to the CMODview and the mesh attributes can be done within the 3d modeler itself.

- The "Color to Apha" procedure works well when the choosed color is plain; that is, for black, RGB 0,0,0. If the image has color parts in which RGB is 0 1 0, ("false" black), the alpha isn't complete and when the layers are overlaid, the alpha value will decrease; thus, if more and more layers are overlaid, also the transparency will be lost and the mesh will tend to be opaque. So mind at.
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #3by Fenerit » 27.09.2010, 13:16

The problem above can be avoided through the use of some sort of lightning bolt effect/plug-ins which does insist upon the transparent canvas, without to render the background color to be removed. Lens flares are good too, for some parts of the nebulae.
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #4by Fenerit » 27.09.2010, 17:02

In the Forum nebula's test is possible to see the "Color to Alpha" issue. The mesh at center is more opaque.
To work upon the transparent canvas (pure alpha) instead of removing the color with such not-so-performant method, does permit to raise up the opacity of the mesh until 0.99... which perform both its complete transparency for what concern the alpha parts of the texture and the opacity of the texture's colors, which will be more sharp and not transparents. Such situation is on one hand preferable to enforce the clusters and pillars dust's zones, on the other undesirable for what concern zones which must be more fainty (gases). In this case, with the eraser tool, set up with 50% transparency or more, one can fade out such zones.
Never at rest.
Massimo

Reiko
Posts: 1119
Joined: 05.10.2006
Age: 41
With us: 18 years 1 month
Location: Out there...

Re: Making fictional 3D planetary nebulae

Post #5by Reiko » 27.09.2010, 20:20

Thank you for this! :D :blue:

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #6by Fenerit » 29.09.2010, 01:40

Reiko wrote:Thank you for this! :D :blue:

Thanks, Reiko. Is the Mutara nebula waiting for you? :D
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #7by Fenerit » 29.09.2010, 01:41

Few words about the UV mapping's step. The images below shows the blob mesh in two different projections: up the spherical, down the planar. Gridging is where the textures are applied, while all that is out of the grid isn't drawn. Usually modellers does allows the exporting of such map as image, and such image can be used as reference for the texturing's step, as long as one does wish to paint manually, without do rely upon graphics aids. Through the UV maps is possibile to see the borders of the mesh to be erased in seat of texture's transparency level.

Image

Image

BTW, the same Forum nebula file for experimenting, this time made without the "Color to Alpha" procedure but upon transparent canvas. The meshes are at 0.9 of opacity and the textures at 128x128px, which is enough for such fictional purposes. Moreover with a sprite in the center. Remove the previous test, first.

Image
http://marauder.webng.com/files/forum_nebula_2.zip 185 Kb
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #8by Fenerit » 05.10.2010, 16:41

Window's users who are interested in 3D organic modelling and painting through FREE program, would to take a look at Sculptris:
http://www.sculptris.com/gallery.html

forum:
http://www.zbrushcentral.com/forumdisplay.php?f=110

This way of 3D modelling can make both nebulae and asteroids (just, to mind Celestia) and lots of more, of course. Moreover, the 3D painting, can do the texturing step very easy to achieve.
Never at rest.
Massimo

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 9 months
Location: Germany

Re: Making fictional 3D planetary nebulae

Post #9by MiR » 05.10.2010, 21:30

Massimo,

Already a few days ago - just while i was reading your thread here - i was thinking about this:
could it be possible to make a (nebula-like) model (mesh) for eg. Pegasi/b to show the slow disappearing, vaporizing atmosphere behind the planet?

But if i take a closer look at these (for me completely strange) software (Thanks again for your PM :)) i just feel like a cowboy inside a SF-movie... 8O
While i'm overviewing some of these programs i come to the sober result that probably my hair's turning grey until i'm able enough to work with this sort of software. :roll:

But probably i haven't any choice. Pegasi/b is still waiting... :wink:. Provided it's a feasible feature in Celestia? :?:

Michael

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #10by Fenerit » 05.10.2010, 22:20

MiR wrote:
Already a few days ago - just while i was reading your thread here - i was thinking about this:
could it be possible to make a (nebula-like) model (mesh) for eg. Pegasi/b to show the slow disappearing, vaporizing atmosphere behind the planet?

Technically, yes. The way in which the effect can be achieved is based upon its "most-fitted shape mesh", that should be throughout fictional, being nobody aware about how the planet behave under such an aspect. The mesh(es), texturized like the nebulae, that is, with transparent parts, would be rotating like a capstan, toward middle/backside of the planet. Their directives are the same for the "common" Celestia's bodies: either UniformRotation or ScriptedOrbit directives; whether also the animation is amongst your goals.

MiR wrote:But if i take a closer look at these (for me completely strange) software (Thanks again for your PM :)) i just feel like a cowboy inside a SF-movie... 8O
While i'm overviewing some of these programs i come to the sober result that probably my hair's turning grey until i'm able enough to work with this sort of software. :roll:

On the contrary, such "organic" (voxel) 3D software are much more intuitive to handle with because it sounds very close like the tools of a 2d paint program; and there is no need to have to disentangle within 4 views. You must see the primitive, either a sphere, or whichelse imported model etc., like the clay of the sculptor. Tools act like its tools; usually the left mouse apply the tools, while the left mouse together with a key does pivot the mesh, so is easy to perform deformation. The tools are customizable, being "image-based"; the tools you like you can design it by yourself, by painting on a square canvas a draw (brushes). Tools does pinch, smooth, stamp, flat, etc and its inverse. Further tools are just for paint on it. UV map is applied in its space, and when you import the model in Celestia, the texture wrap the model like you have painted it.
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #11by Fenerit » 06.10.2010, 15:53

Continuing the tutorial...
So far we have seen how to achieve the CMODs' transparency through a two-fold use of the texture's transparencies. A first case, in which a sharp texture (with transparent parts) makes a dim and translucent nebulae because the model's opacity was set to 0.1, and a second case in which a global, high transparent texture (with complete transparent parts) makes a dimm and translucent nebulae because the model's opacity was set to 0.9.
Now we will see how to achieve the complete transparency of the model through the second case together with a model's opacity set to 1 (completely opaque).
Someone could have noticed that when a not flatted (not background) canvas (32bit) is applied upon a model with opacity 1, the model became completely transparent, even without the canvas does have transparent parts on it; whereas a flat background (24bit) is rendered as usual. These were the issues that brought to 0.1/0.9 values for the model's opacities.
But the model's opacity can be exclusively 1; is required just a bit of hacking. In particular, is required the use of the 3DStoCMOD (CMODtools) in order to have the 3DS conversion in ASCII format. In this third case, the CMOD must be edited manually. Once the CMOD has been converted in ASCII from 3DS, open it within a text editor; you will see such a structure:

Code: Select all

material
diffuse 1 1 1
texture0 "nebula.png"
end_material

material
diffuse 1 1 1
texture0 "nebula_core.png"
end_material

mesh
vertexdesc
position f3
normal f3
texcoord0 f2
end_vertexdesc
.
.
.

Now, after the default material blocks which shows the assigned textures, add other two similar blocks but with the blend add directive (do not intermix the blocks):

Code: Select all

material
diffuse 1 1 1
texture0 "nebula.png"
end_material

material
diffuse 1 1 1
texture0 "nebula_core.png"
end_material

material
diffuse 1 1 1
texture0 "nebula.png"
blend add
end_material

material
diffuse 1 1 1
texture0 "nebula_core.png"
blend add
end_material

mesh
vertexdesc
position f3
normal f3
texcoord0 f2
end_vertexdesc
.
.
.

The directive blend add makes the per-pixel alphablending upon the colored parts, avoiding the CMOD to be completely transparent just in there.
Then save, open it onto CMODview for its binary conversion (note that CMODview doesn't handle such "two block" structure in the part concerning the texture's assignment; thus, let's use it just for the binary conversion only). Start Celestia and take a look. Remember that the whole texture's transparency have to be customized just to dim on the nebulae; if the colors are sharpen, they will remains sharpen (on a transparent model). One can change also its diffuse value and adding the emissivity.
FYI, amongst the newest CMOD's directives (thanks to Chris) there is also the directive blend premultiplied, which is useful too, even in other cases.
Never at rest.
Massimo

W0RLDBUILDER
Posts: 122
Joined: 02.06.2010
With us: 14 years 5 months

Re: Making fictional 3D planetary nebulae

Post #12by W0RLDBUILDER » 30.03.2011, 18:22

How am I supposed to export an obj file from K3DSurf? I have looked and looked and there is NO export option.
EDIT: Never mind. .Only K3DSurf 0.6.2 lacks the export option. 0.6.1 works fine.

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #13by Fenerit » 01.04.2011, 00:22

W0RLDBUILDER wrote:How am I supposed to export an obj file from K3DSurf? I have looked and looked and there is NO export option.
EDIT: Never mind. .Only K3DSurf 0.6.2 lacks the export option. 0.6.1 works fine.

Hi! Even K3DSurf 0.6.2 has the OBJ export. In "Parametric" tab choose "Option". The button "export OBJ" will load a tiny internal notepad, in which you can see the OBJ structure. Through its toolbar, save the file. OBJ files are text files.
Never at rest.
Massimo

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Making fictional 3D planetary nebulae

Post #14by Fenerit » 09.07.2011, 22:36

Now the new version of Sculptris is freely available also for Mac OSX.
Never at rest.
Massimo


Return to “Tutorials”