- Sprites are only implemented in the OpenGL 2.0 path right now
- I don't know how 3D modeling programs handle sprites (or it they do at all); thus any cmods that use sprites will have to be hand-edited or generated by a custom program.
Here is example add-on featuring a nebula drawn with point sprites. The nebula isn't intended to be realistic--the add-on just shows how to achieve a volumetric effect with sprites.
The add-on can be found at http://www.shatters.net/~claurel/celestia/files/spriteneb.zip
The changes to the cmod format relevant to point sprites are very minor. There's a new primitive type (sprites), and a new vertex attribute type (pointsize). The sprite texture is texture0 from the material definition. Here is a very basic example of a sprite cmod with three red sprites:
Code: Select all
#celmodel__ascii
material
diffuse 1 0 0
texture0 "gaussian.jpg"
end_material
mesh
vertexdesc
position f3
pointsize f1
end_vertexdesc
vertices 3
1 0 0 0.25
2 0 0 0.25
3 0 0 0.25
sprites 0 3
0 1 2
end_mesh
For nebula meshes, it may be useful to specify additive blending in the material definition by adding the line 'blend add'. This is especially appropriate for emission nebula, definitely not to be used for dark nebula like the Horsehead. Additively blended objects have the advantage of not needing to be depth sorted with respect to each other. Here's a slightly more complex sprite cmod that uses additive blending and per vertex colors so that each sprite has a different color:
Code: Select all
#celmodel__ascii
material
diffuse 1 0 0
texture0 "gaussian.jpg"
blend add
end_material
mesh
vertexdesc
position f3
pointsize f1
color f3
end_vertexdesc
# row of sprites: red, green, blue
vertices 3
1 0 0 0.25 1 0 0
2 0 0 0.25 0 1 0
3 0 0 0.25 0 0 1
sprites 0 3
0 1 2
end_mesh
The program GLNebula uses additively blended point sprites to show nebula generated by the photoionization tool Cloudy-3D: http://132.248.1.102/Cloudy_3D/ An interesting project would be a tool to convert output from Cloudy 3D into a cmod file.
--Chris