Particle System / Volumetric fills / Clouds

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Particle System / Volumetric fills / Clouds

Post #1by buggs_moran » 26.01.2008, 01:54

I am not versed in OpenGL or C++ so I assume it has something to do with it & I am not being picky, but it would make so many of the current issues with volumetric fills (nebulae, clouds, jets) easier to model if particle system cloud effects like Orbiter (below) were possible... I have been toying with the idea of learning about programming to achieve this goal in Celestia, but am reticent to do it for fear that someone is already on it, and the fact that it would put me off of other Celestia/non-Celestia projects for some time...

Image
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

MKruer
Posts: 501
Joined: 18.09.2002
With us: 22 years 2 months

Post #2by MKruer » 26.01.2008, 02:55

You might want to check out this.
http://www.markmark.net/clouds/
http://www.markmark.net/SkyWorks/

If this could be done, it could be a real killer improvement for Galaxies and Nebulae

Imy
Posts: 109
Joined: 13.10.2006
With us: 18 years 1 month

Post #3by Imy » 26.01.2008, 10:14

Volumetric clouds may be also interesting to draw high dense atmospheres in gazeaous planets such Uranus or Neptune : this could allow trips inside this planet like we do for Earth or Mars...

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Post #4by duds26 » 26.01.2008, 17:13

For dense atmospheres it would be also handy to have volumetric images that we can apply on planets. Therefor we need a volumetric file format.

But nothing like this already exists and no standards exist for volumetrics or particle effects.
Or wait there is take a nice look at these things:
https://www.khronos.org/collada/wiki/Main_Page
http://www.web3d.org/x3d

And volumetric images for clouds:
http://www.2kan.org/jp3d.html
Last edited by duds26 on 15.04.2018, 21:10, edited 1 time in total.

Jugalator
Posts: 15
Joined: 05.07.2004
With us: 20 years 4 months
Location: Sweden
Contact:

Post #5by Jugalator » 10.02.2008, 19:03

I agree, the multiple uses of volumetrics in Celestia could sure make it a useful feature, for the many celestial objects that are more of a gaseous type, or consist of this in a part. :) I am personally a programmer, I just wish I knew more about graphics programming like this. ;)

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #6by fsgregs » 21.02.2008, 23:16

I too have always wondered why, with the exceptional capabilities of Celestia programmers, they have been unable to introduce the use of realistic cloud and nebula effects. I am no programmer, but I am a video game user, and virtually all games in use today contain spectacular environmental effects without a serious penalty in frame rates. They include explosions, flames, mist, very realistic clouds, falling rain, nebula clouds, etc.

Is it that such effects take too many lines of code, or is it a difficulty to implement specific to C++?

Are such effects possibly available as pre-written sub-routines that might be available open source?

I'm just curious. :roll:

Frank

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Post #7by rthorvald » 22.02.2008, 10:30

fsgregs wrote:Is it that such effects take too many lines of code, or is it a difficulty to implement specific to C++?

Without knowing much about programming, i suspect the reason we won??t see this soon is more that the lead devs aren??t interested than that it is difficult. Celestia??s focus is on other things... But i would *love* to have this feature.

- rthorvald
Image

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #8by fsgregs » 22.02.2008, 17:52

Are such effects possibly available as pre-written sub-routines that might be available open source?



I have checked out MKruer's links above to a free software routine called Skyworks. Although it was written in 2002 by a college Ph.D student in C++ 6, and is therefore a bit dated, it does create a reasonable set of free-floating, fly-through clouds floating above ground. the GREAT news is that the author has posted and made his entire source code available FREE, with no restrictions. The link can be found here.

http://www.markmark.net/SkyWorks/

Image


Is there anyone in the forum with C++ experience willing to examine that code as a starting point, modify it as needed without too much labor, and give Celestia at least a beginning ability to render free-floating clouds, realistic nebula, smoke, etc, without the need to draw a mesh?

I wish I could do it, but I have zero experience in C++. When I retire ... :) ... it is on my "bucket list" of things to do before I "kick the bucket".

Frank

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #9by chris » 22.02.2008, 18:12

rthorvald wrote:
fsgregs wrote:Is it that such effects take too many lines of code, or is it a difficulty to implement specific to C++?
Without knowing much about programming, i suspect the reason we won??t see this soon is more that the lead devs aren??t interested than that it is difficult. Celestia??s focus is on other things... But i would *love* to have this feature.


Exactly--a lack of time and not skill is the reason that Celestia doesn't have particles systems yet. I actually am interested in adding support for them to Celestia, but there have been other priorities.

Implementing particle systems is pretty easy stuff, though there are some special considerations in Celestia. A big difference between Celestia and games is that the user has complete control over time: it can be stopped, sped up to an effectively arbitrary degree, and even reversed. Traditional particle systems work by calculating the forces on the individual particles and calculating new velocities and positions at each time step. In Celestia, we'd have to constrain particle motions to just those that can be expressed analytically--quadratics seems like they'd give enough flexibility. Generation of new particles could be accomplished with some clever use of a pseudorandom number sequence: use the current simulation time to compute the starting position in the pseudorandom sequence, use the pseudoranom values to build a set of quadratics describing the motion of however many particles are in the system, then evaluate the quadratics to get particles positions, and render.

We'd need some sort of file format to describe the particle systems. Nothing special would need to be done to the ssc format--you could just specify a particle system for the mesh instead of a cmod or 3ds file.

--Chris

Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #10by buggs_moran » 22.02.2008, 20:23

I can't speak for all, but I am not looking for time related particle systems, though it might be neat for those Io volcanoes. I would just like the ability to use cloud "like" meshes for nebulae, accretion disks, cloud layers, etc. A static cloud is fine, because I can make it move using orbit and body frames.

The eventuality of a time dependant particle system is nice to think about, but I would just like to create my addons without all those sharp edges...
Homebrew:

WinXP Pro SP2

Asus A7N8X-E Deluxe

AMD Athlon XP 3000/333 2.16 GHz

1 GB Crucial RAM

80 GB WD SATA drive

ATI AIW 9600XT 128M

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #11by chris » 22.02.2008, 20:54

buggs_moran wrote:I can't speak for all, but I am not looking for time related particle systems, though it might be neat for those Io volcanoes. I would just like the ability to use cloud "like" meshes for nebulae, accretion disks, cloud layers, etc. A static cloud is fine, because I can make it move using orbit and body frames.

The eventuality of a time dependant particle system is nice to think about, but I would just like to create my addons without all those sharp edges...


You can already do that with cmod point sprites. The drawback is that right now they don't work on Macs with ATI hardware because of broken drivers :( I need to get around to adding a workaround that avoids the use of hardware point sprites.

--Chris

Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #12by buggs_moran » 22.02.2008, 21:44

I guess I don't understand sprites well enough...

I did one simple test with them once, but didn't like how they looked the same from every angle. I probably just don't understand how to use them and should take another look. However, my meager understanding after doing some reading this afternoon is that the sprites are 2D (hence always facing the viewer) and what I was talking about is really a 3D volume that changes with the viewer... Maybe that's not possible without the particle system...
Homebrew:

WinXP Pro SP2

Asus A7N8X-E Deluxe

AMD Athlon XP 3000/333 2.16 GHz

1 GB Crucial RAM

80 GB WD SATA drive

ATI AIW 9600XT 128M

Buzz
Posts: 264
Joined: 31.01.2002
With us: 22 years 9 months
Location: The Netherlands

Post #13by Buzz » 23.02.2008, 15:25

I want to find out how point sprites work, and installed Chris' spriteneb addon as a first step. The add-on is found in Celestia, but when I go to it I don't see anything. OpenGL 2.0 was used. I am running Vista home premium 32 bits with an ATI 2600 XT. I was wondering if this could have anything to do with Vista.

Buzz

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #14by chris » 23.02.2008, 16:54

Buzz wrote:I want to find out how point sprites work, and installed Chris' spriteneb addon as a first step. The add-on is found in Celestia, but when I go to it I don't see anything. OpenGL 2.0 was used. I am running Vista home premium 32 bits with an ATI 2600 XT. I was wondering if this could have anything to do with Vista.


Do you have nebula turned on? The fact that you're running on Vista shouldn't matter, though it's possible there's a problem with the ATI OpenGL driver for Vista.

--Chris

Buzz
Posts: 264
Joined: 31.01.2002
With us: 22 years 9 months
Location: The Netherlands

Post #15by Buzz » 23.02.2008, 17:17

Oops, no I didn't have them turned on! I do see the 'spriteneb' now, thanks Chris!

Buzz
Posts: 264
Joined: 31.01.2002
With us: 22 years 9 months
Location: The Netherlands

Post #16by Buzz » 25.02.2008, 20:36

I have started some simple experiments with point sprites. What I am trying to do is to obscure "emission nebulae" by dark nebula. I am using a partly transparant png as the texture. Although I am not using "blend add", the opaque sprites always appear in front of the transparant ones, even if they are behind these. Is this behaviour as expected? My cmod code:

Code: Select all

#celmodel__ascii

material      # index 0
   diffuse 1 0 0
   opacity 0.5
   texture0 "blob.png"
end_material

material      # index 1
   diffuse 0 1 0
   opacity 1
   texture0 "blob.png"
end_material


mesh

vertexdesc
   position f3
   pointsize f1
end_vertexdesc

vertices 6
 1 0 0 0.25
 2 0 0 0.25
 3 0 0 0.25
 1 1 0 0.25
 2 1 0 0.25
 3 1 0 0.25

sprites 0 3
0 1 2

sprites 1 3
3 4 5

end_mesh

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #17by chris » 25.02.2008, 20:43

Buzz wrote:I have started some simple experiments with point sprites. What I am trying to do is to obscure "emission nebulae" by dark nebula. I am using a partly transparant png as the texture. Although I am not using "blend add", the opaque sprites always appear in front of the transparant ones, even if they are behind these. Is this behaviour as expected? My cmod code:


Right: the individual particles are not depth sorted. This can be addressed, but it will be incur a big performance cost with large numbers of particles.

--Chris

Buzz
Posts: 264
Joined: 31.01.2002
With us: 22 years 9 months
Location: The Netherlands

Post #18by Buzz » 25.02.2008, 21:10

I see, good to know. This of course makes it impossible to create nebulae that are not purely emissive. I would be interested to see what can be created with depth sorted sprites and to see how large the performance impact is. Is this something that is easy to add as an option?

Buzz

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Re:

Post #19by duds26 » 31.08.2008, 17:41

chris wrote:
rthorvald wrote:Without knowing much about programming, i suspect the reason we won??t see this soon is more that the lead devs aren??t interested than that it is difficult. Celestia??s focus is on other things... But i would *love* to have this feature.

Exactly--a lack of time and not skill is the reason that Celestia doesn't have particles systems yet. I actually am interested in adding support for them to Celestia, but there have been other priorities.

Implementing particle systems is pretty easy stuff, though there are some special considerations in Celestia. A big difference between Celestia and games is that the user has complete control over time: it can be stopped, sped up to an effectively arbitrary degree, and even reversed. Traditional particle systems work by calculating the forces on the individual particles and calculating new velocities and positions at each time step. In Celestia, we'd have to constrain particle motions to just those that can be expressed analytically--quadratics seems like they'd give enough flexibility. Generation of new particles could be accomplished with some clever use of a pseudorandom number sequence: use the current simulation time to compute the starting position in the pseudorandom sequence, use the pseudoranom values to build a set of quadratics describing the motion of however many particles are in the system, then evaluate the quadratics to get particles positions, and render.

We'd need some sort of file format to describe the particle systems. Nothing special would need to be done to the ssc format--you could just specify a particle system for the mesh instead of a cmod or 3ds file.

--Chris

Collada would seem a good format.
It's for 3d and can also contain physics stuff.
https://www.khronos.org/collada/

And there is an interesting physics library called bullet physics library.
https://pybullet.org/Bullet/phpBB3/
https://pybullet.org/Bullet/phpBB3/viewforum.php?p=&f=21

Don't know if it helps but was worth mentioning anyway.


Return to “Development”