#declare ringtex = texture { /* ringtexture generator settings. */ #local Red = 0.4; // max red #local Green = 0.4; // max green #local Blue = 0.9; // max blue #local rchange = 0.3; // maximum amount of random color change #local bandwidth = 0.03; // maximum width of single color bands #local Seed = 1; // any integer pigment { wood color_map { #local i=0; #local S = seed(Seed); [0 color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)> transmit 1] #while(i<.8) #local i=i+rand(S)*bandwidth; [i color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)> transmit rand(S)] #end [.8 color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)> transmit 1] } } finish { brilliance 0.5 ambient 0 } } /* Generator for procedural gas-planet texture. Apply on sphere with rad 1*/ #declare planettexproc = material { texture { #local Red = 0.3; // max red #local Green = 0.3; // max green #local Blue = 1.0; // max blue #local rchange = 0.3; // maximum amount of random color change #local bchange = 0.5; // maximum amount of random brightness change #local bandwidth = 0.075; // maximum width of single color bands #local Seed = 1245; // any integer pigment { gradient z color_map { #local i=0; #local S = seed(Seed); [0 color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)>*(1-rand(S)*bchange)] #while(i<.8) #local i=i+rand(S)*bandwidth; [i color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)>*(1-rand(S)*bchange)] #end [1 color rgb <(1-rchange)*Red+rchange*Red*rand(S),(1-rchange)*Green+rchange*Green*rand(S),(1-rchange)*Blue+rchange*Blue*rand(S)>*(1-rand(S)*bchange)] } turbulence .02 lambda 5 } finish { brilliance 2// 0.5 ambient 0 } } } /* The Planet */ #macro ringplanet(gscale) union { disc { <0,0,0>, <0,0,1>, 1.0, 0.6 texture{ringtex} scale 4.5 hollow } union { sphere { <0,0,0>,1 material {planettexproc translate z*.5 scale 2} } sphere { <0,0,0>,1 hollow // no_shadow texture{pigment{color rgbt 1}} interior { media { scattering{5,color rgb <.3,.3,1>*5/gscale eccentricity .4 extinction 2} intervals 1 density { spherical color_map { #local sc = 1-1/1.1; [0.0 color rgb 0] [sc-sc/2 color rgb .12] [sc-sc/4 color rgb .4] [sc-sc/8 color rgb .6] [sc-sc/16 color rgb .8] [sc color rgb 1] [1.0 color rgb 1] } } } } scale 1.1 } scale <2,2,1.8> } scale gscale } #end