Nebulae in Celestia using sprites
Posted: 23.04.2020, 23:06
Hi everyone! I'm starting a thread about making nebulae in Celestia, using point sprites.
Before we start, I should mention that I am not an expert! I'm not a professional astronomer, physicist, or a mathematician. I'm just a hobbyist, and this is just my experience making these nebulae add-ons. I hope this thread becomes a place for people to learn and exchange information about making these things. I am also not the first person to do sprite models! I would say the pioneer of making sprite models is Cham, but other people have used sprites to wonderful effect (just look around the Forums).
Download Link
The finished add-ons, as well as ASCII cmods for viewing/experimenting, are all available here: https://drive.google.com/drive/folders/1qBvr56J4kmSBaiHAs4Yj3xKEUXQqTfv-?usp=sharing
Introduction: Why Sprites?
Broadly speaking, there are two ways to make nebula models in Celestia. You can use a polygon mesh, and you can use point sprites. In a polygon mesh, a texture is wrapped around a surface. This texture can be, say, an image of the nebulae. With point sprites, points are displayed in 3D space. The "sprite" part of point sprites means that a specific texture is rendered at each point, no matter what angle you are looking from. The important thing to note is that if the sprite texture is something that is perfectly symmetrical along all lines of symmetry, like a circle, then when you view the sprite it looks like a sphere. This is how sprites give you a "volumetric" effect.
The vast majority of nebula add-ons on the Motherlode are made using the former method. I think it's because it's relatively easy to make a billboard model, and just UV-wrap an image of a nebula onto it. And to be fair these models look, well, photorealistic when viewed from the Earth. But when you view the models from the side, the model looks strange. (Imagine viewing a billboard from the side.)
Ultimately, I think why I think it is so difficult to make a 3D model of an a nebula using polygon meshes: 1) polygon meshes will always have these sharply defined surfaces at some viewing angle, while nebulae tend to be pretty fuzzy objects, and 2) it's difficult to take a single image of a nebula and turn that into a 3D model. Of course, that's not to say that it's impossible to make them using polygon meshes: I think jll's models are excellent, such as this Mz 3 (Ant Nebula) add-on.
But for me, the main reason that I started making sprites was because I found them to be easier to make, from a technological standpoint. With polygon meshes, you need to know a little bit about UV wrapping, transparency, and a whole bunch of other stuff. I don't know how to do that. But I do know how to plot points in 3D space. It requires only a little bit of knowledge of math. You can also use a 3D graphing software like GeoGebra 5, to do it for you.
Abell 39
So now that I've gotten my manifesto out of the way, I suppose I'll start with the simplest example: Abell 39, a near-perfect sphere. The download link is here.
Spherical nebulae like Abell 39 consist of an expanding shell of gas, that gets ionized by the central star to produce light. Visually, the shell appears as a "ring". This is because of limb brightening, where the outer areas appear to have more material than the inner areas. Here's a graphic that I think explains it well:
In Celestia, this is modeled pretty well with a spherical shell where the shell is made up of point sprites. Here's how I made the model for Abell 39:
1. Open Blender.
2. Blender always starts with a default cube. Delete that by clicking on it, then pressing "X", then "Enter".
3. In the tab on the left, select "Create", then "Ico Sphere". An Ico Sphere is important because it places all the points equi-distant from each other. If we used another shape, like the UV Sphere, the points would not have an even distribution, and the sprites would be brighter near those areas.
4. Near the bottom left, go to where it says "Object Mode" and change that to "Edit Mode". The Ico Sphere should be selected in orange.
5. Press "W", and select "Subdivide Smooth" twice. This helps create more points that fill out the gaps.
6. Near the top left, go to "Export", then "Wavefront (.obj)".
Then, I opened the OBJ file using a text editor and grab the vertices. Each point needs a sprite size, and a color (in RGB). Using Microsoft Excel, it's pretty easy to do that.
In a text editor, I copy-pasted the vertex definitions into a text file, and added all of the other parts: the material definition, the mesh definition, the list of sprites, etc. For more information, you can look at my abell39.cmod as an example.
Later, I'm going to add more nebulae and explain (to the best of my ability) how I made them.
Cheers, LukeCEL
Before we start, I should mention that I am not an expert! I'm not a professional astronomer, physicist, or a mathematician. I'm just a hobbyist, and this is just my experience making these nebulae add-ons. I hope this thread becomes a place for people to learn and exchange information about making these things. I am also not the first person to do sprite models! I would say the pioneer of making sprite models is Cham, but other people have used sprites to wonderful effect (just look around the Forums).
Download Link
The finished add-ons, as well as ASCII cmods for viewing/experimenting, are all available here: https://drive.google.com/drive/folders/1qBvr56J4kmSBaiHAs4Yj3xKEUXQqTfv-?usp=sharing
Introduction: Why Sprites?
Broadly speaking, there are two ways to make nebula models in Celestia. You can use a polygon mesh, and you can use point sprites. In a polygon mesh, a texture is wrapped around a surface. This texture can be, say, an image of the nebulae. With point sprites, points are displayed in 3D space. The "sprite" part of point sprites means that a specific texture is rendered at each point, no matter what angle you are looking from. The important thing to note is that if the sprite texture is something that is perfectly symmetrical along all lines of symmetry, like a circle, then when you view the sprite it looks like a sphere. This is how sprites give you a "volumetric" effect.
The vast majority of nebula add-ons on the Motherlode are made using the former method. I think it's because it's relatively easy to make a billboard model, and just UV-wrap an image of a nebula onto it. And to be fair these models look, well, photorealistic when viewed from the Earth. But when you view the models from the side, the model looks strange. (Imagine viewing a billboard from the side.)
Ultimately, I think why I think it is so difficult to make a 3D model of an a nebula using polygon meshes: 1) polygon meshes will always have these sharply defined surfaces at some viewing angle, while nebulae tend to be pretty fuzzy objects, and 2) it's difficult to take a single image of a nebula and turn that into a 3D model. Of course, that's not to say that it's impossible to make them using polygon meshes: I think jll's models are excellent, such as this Mz 3 (Ant Nebula) add-on.
But for me, the main reason that I started making sprites was because I found them to be easier to make, from a technological standpoint. With polygon meshes, you need to know a little bit about UV wrapping, transparency, and a whole bunch of other stuff. I don't know how to do that. But I do know how to plot points in 3D space. It requires only a little bit of knowledge of math. You can also use a 3D graphing software like GeoGebra 5, to do it for you.
Abell 39
So now that I've gotten my manifesto out of the way, I suppose I'll start with the simplest example: Abell 39, a near-perfect sphere. The download link is here.
Spherical nebulae like Abell 39 consist of an expanding shell of gas, that gets ionized by the central star to produce light. Visually, the shell appears as a "ring". This is because of limb brightening, where the outer areas appear to have more material than the inner areas. Here's a graphic that I think explains it well:
In Celestia, this is modeled pretty well with a spherical shell where the shell is made up of point sprites. Here's how I made the model for Abell 39:
1. Open Blender.
2. Blender always starts with a default cube. Delete that by clicking on it, then pressing "X", then "Enter".
3. In the tab on the left, select "Create", then "Ico Sphere". An Ico Sphere is important because it places all the points equi-distant from each other. If we used another shape, like the UV Sphere, the points would not have an even distribution, and the sprites would be brighter near those areas.
4. Near the bottom left, go to where it says "Object Mode" and change that to "Edit Mode". The Ico Sphere should be selected in orange.
5. Press "W", and select "Subdivide Smooth" twice. This helps create more points that fill out the gaps.
6. Near the top left, go to "Export", then "Wavefront (.obj)".
Then, I opened the OBJ file using a text editor and grab the vertices. Each point needs a sprite size, and a color (in RGB). Using Microsoft Excel, it's pretty easy to do that.
In a text editor, I copy-pasted the vertex definitions into a text file, and added all of the other parts: the material definition, the mesh definition, the list of sprites, etc. For more information, you can look at my abell39.cmod as an example.
Later, I'm going to add more nebulae and explain (to the best of my ability) how I made them.
Cheers, LukeCEL