#include "rand.inc"
#declare fast = 0;
#declare test = 0;
#declare Test = texture{pigment{color rgbt .6} finish{ambient .3} }
#declare nebula_piece =
blob{
#local Loop = 0;
threshold .65
#while (Loop < 100)
sphere{25-50*<rand(R),rand(S)-pow(rand(R),.5),rand(T)-pow(rand(R)+rand(S),.5)>,20*rand(U),2*pow(rand(V),.5)-.7}
#local Loop = Loop + 1;
#end
}
#if (test)
light_source{<1000,1000,-600> color rgb 1 }
#end
merge{
#local Loop = 0;
#while (Loop < 100)
object{nebula_piece
translate 100-200*<rand(W),2*(rand(X)-pow(rand(W),.5))+.5,rand(Y)-pow(rand(X)+rand(W),.5)>
}
#local Loop = Loop + 1;
#end
#if (test)
texture{Test}
#else
material{nebula} hollow no_shadow
#end
}
#declare index = 1;
#while (index < 10) //#declare luminosity = (pow((rand(S)-.5),9/5) + 1);
#declare luminosity = Rand_Gauss(.8, .2, rand(S) );
star(luminosity,100*rand(T)-50, 100*rand(T)-50, 100*rand(T)-50) #declare index = index + 1;
#end