| Author |
Message |
Legion
 Posts: 152 Location: Germany
 |
[UPDATE]
I've got a video on youtube from the nebula:
[url]http://www.youtube.com/watch?v=0KxgaRuQfPY[url]
[/UPDATE]
Some of us (including me, of course) are working on space shooter type of games.
And I've taken some time (together with the guys on Pandas IRC channel) to create one effect a good space shooter game can't afford to miss...
...a planetary nebula!
Of yourse, you could just render some great looking nebulae on your skybox, but what we wanted (Treeform and myself) was a volumetric nebula that you could actually fly through.
So after some internet research I found some equations that could help with generating such nebulae.
http://www.btinternet.com/~ndesprez/manual/attractors.htm
Based on those "strange attractors" I created some code, that generates a nebula as a set of GeomParticles...
The code(with enough comments I hope):
http://legion.panda3dprojects.com/download/nebula2.py
And some screenshots with different angles and particle densities:
The last two are with 1000000 particles, obviously too much fro the frame rate, the first one is with 100000 particles...
so enjoy... _________________ ---OmniCode 0.1.6 ---
sxy cm180 kg90 skffffff ha7d4419 eso sp< Ag1982 anE hdd ZoB Rl! Kd! MBintp FHg UFCthulhu IN12 Ad* PrPython(3)^(9)&C(2)^(5)&Basic(5)&PHP(4)^(7)
Last edited by Legion on Fri Aug 10, 2007 10:12 pm; edited 1 time in total |
|
treeform
 Posts: 2027 Location: Seattle
 |
|
Josh Yelon
Posts: 1360
 |
Have you tried using a significantly smaller number of particles, but with each individual particle larger? _________________ Josh Yelon, Teacher, Carnegie Mellon Entertainment Technology Center |
|
Legion
 Posts: 152 Location: Germany
 |
Yes I did, but that just looks bad...
But you could try that for yourself (just takes a minute to adjust the number of particles and the thickness with setRenderModeThickness() )
And don't ask about using textured sprite particles, that won't even let me go up to 1000 particles with a reasonable frame-rate.
Though, I want to experiment with shaders, to achieve a denser look with less particles. But right now shaders won't work (somehow my system is a little bit messed up)... _________________ ---OmniCode 0.1.6 ---
sxy cm180 kg90 skffffff ha7d4419 eso sp< Ag1982 anE hdd ZoB Rl! Kd! MBintp FHg UFCthulhu IN12 Ad* PrPython(3)^(9)&C(2)^(5)&Basic(5)&PHP(4)^(7) |
|
Hypnos
Posts: 546 Location: Zürich, Switzerland
 |
i changed the code structure a bit and added 2 other algorithms to play around with.
The used function can now be defined at the end of the file "a = nebula(func)"
- where func may be:
- default : the previous one
- lorenz
- ifsLorenz
to see the full capabilities i recommend playing around with the 'changeable variables' in the classes default, lorenz and ifsLorenz. Try little changes on separate numbers, as it often exceeds the number range of python.
http://public.nouser.org/~rspoerri/Development/python/panda3d/projects/nebulae/nebula2.py |
|
Legion
 Posts: 152 Location: Germany
 |
Thanks Hypnos...
I already had the feeling, that the nebula class should provide more flexibility, so one could render different shapes... _________________ ---OmniCode 0.1.6 ---
sxy cm180 kg90 skffffff ha7d4419 eso sp< Ag1982 anE hdd ZoB Rl! Kd! MBintp FHg UFCthulhu IN12 Ad* PrPython(3)^(9)&C(2)^(5)&Basic(5)&PHP(4)^(7) |
|
darksmaster923
Posts: 101 Location: Cali USA
 |
it looks...........beautiful............. _________________ I am the law |
|
Hypnos
Posts: 546 Location: Zürich, Switzerland
 |
I added a interactive environment to change the parameters on the fly. Get the latest version of my modification from:
http://public.nouser.org/~rspoerri/Development/python/panda3d/projects/nebulae/nebula3.py
It also allows you to save the files into .bam
Because it recalculates the whole nebula when pressing a button the number of particles during modifying should be kept low. Once you found something nice you can increase the number of particles easily.
The only thing that has to be changed manually is the attractortype at the end of the file. |
|
Hypnos
Posts: 546 Location: Zürich, Switzerland
 |
|
radu
 Posts: 143 Location: Bucharest
 |
anyone happens to have the 4 or 4_1 version available somewhere?
on a side note: has anyone considered bringing all these examples together, including these small experiments, into a wiki or something, so they don't get lost as times goes by? |
|
ThomasEgi
 Posts: 1820 Location: Germany,Koblenz
 |
radu: serach the forum for "demomaster" . aside from that we have the code-snippset and showcase corner here on the forum. then we have panda3dprojects which can host larger examples. only very few things are lost. you'r also free to write samples to be included into panda. _________________ rig: dell inspiron 1720; ubuntu 9.10_64 ;panda 1.7.0
may a catgirl be with you. nyaan nyan~~ ^.^ |
|
Hypnos
Posts: 546 Location: Zürich, Switzerland
 |
|
|