#version 3.8; global_settings {assumed_gamma 1} #include "functions.inc" camera { location <0, 0, -25> look_at 0 right x*image_width/image_height } sky_sphere { pigment { gradient y color_map {[0 rgb <0, 0.5, 0>] [1 rgb <0, 0.1, 0>]} translate y*0.5 } } light_source {<2.5, 5, -20> color rgb 1} #declare E = 0.000001; #declare Start = 0.1; #declare End = 0.9; #declare Turbulence = 0.325; #declare Scale = 0.25; // smoothstep function #declare K = function (t1, t2, T) {max (0, min(1, (T-t1)/(t2-t1) ) )} #declare Smoothstep = function (t1, t2, T) {pow (K(t1, t2, T), 2) * (3-2*K(t1, t2, T))} // mod function that plays nice when crossing 0 #declare Mod = function (T) {select (T, 1-mod (abs(T), 1), mod (abs(T), 1) )} // smooth step function //#declare N = function (NN) {floor (NN-0.5) + Smoothstep (Start, End, abs(Mod(NN-0.5)-0.5) )} #declare N = function (NN) {floor (NN) + Smoothstep (Start, End, Mod(NN) )} #declare Noise = pigment { function {f_noise3d(x, y, z)} turbulence Turbulence } #declare StepNoise = texture { function {f_noise3d (N(x), N(y), N(z))} //turbulence Turbulence texture_map { [0 pigment {rgb <0.1, 0.001, 0.001>}] [0.5 pigment {rgb <0.1, 0.001, 0.001>}] [1 pigment {rgb <0.3, 0.15, 0.001>}] } } #declare StepNoise2 = texture { function {f_noise3d (N(x), N(y), N(z))} turbulence Turbulence*1.5 texture_map { [0 pigment {rgb <0.001, 0.001, 0.1>}] [0.5 pigment {rgb <0.001, 0.001, 0.1>}] [1 pigment {rgb <0.91, 0.95, 0.99>}] } } #declare Granite = texture { StepNoise scale 0.3 } #declare Quartz = texture { agate scale 0.3 texture_map { [0 pigment {rgb 0}] [0.3 pigment {rgb 1}] [1 pigment {rgb 1}] } } #declare W1 = 0.3; #declare W2 = 0.1; #declare Fade = 0.05; #declare Vein = texture { function { (abs(x-f_noise3d (x, y, z)) < W1) + (abs(y-f_noise3d (x, y, z)*2) < W2) } //function {(abs(x-f_noise3d (x, y, z)) < W)} //function {(abs(Mod(x/4-f_noise3d (x/4, y, z))) < W)} turbulence 0.625 texture_map { [0.0 Granite] [0.5 Granite] [0.5 Quartz] [1.0 Quartz] } } /* box { <-10, -10, 0>, <10, 10, 0.1> texture { Vein } } */ // The central sphere #declare SS = function (X, Y, Z) {pow(X,2)+pow(Y,2)+pow(Z,2) - 0.0625} // a 90-deg rotation around x to bring the following tori into the xy plane #declare TR1 = transform {rotate x*90} #declare TI1 = function {transform {TR1 inverse}} /*difference { torus {0.6, 0.125 rotate x*90 scale <0.9, 0.75, 1> translate <-0.00, 0, 0>} torus {1, 0.33 rotate x*90 scale <4.4/11, 2.25/9, 1>*1.1 translate <-0.09, 0, 0>} }*/ // The outer torus of the "P" #declare T1 = function (X, Y, Z) {f_torus (X/0.9, Y, Z/0.75, 0.6, 0.125)} // The inner torus of the "P" #declare T2 = function (X, Y, Z) {f_torus (X/0.44+0.18, Y, Z/0.275, 1, 0.33)} // a -25-deg rotation around z to tilt the cone #declare TR2 = transform {rotate -z*25} #declare TI2 = function {transform {TR2 inverse}} // The cone of the "P" #declare C = function (X, Y, Z) { max (sqrt(pow(X*7,2) + pow(Z*7,2)*2) - (Y+1.57), Y ) } // sphere to subtract from cone #declare CS = function (X, Y, Z) {pow(X,2)+pow(Y,2)+pow(Z,2) - 0.1} #declare Logo = function { min ( SS (x,y,z), max ( T1 (TI1 (x,y,z).x, TI1 (x,y,z).y, TI1 (x,y,z).z), -T2 (TI1 (x,y,z).x, TI1 (x,y,z).y, TI1 (x,y,z).z) ), max ( C (TI2 (x,y,z).x, TI2 (x,y,z).y, TI2 (x,y,z*2).z), -CS (x, y, z) ) ) } #declare Gradient = 10; #declare Min_factor= 0.7; #declare Isosurface = isosurface { function {Logo (x, y, z)} threshold 0 //max_gradient Gradient evaluate Gradient*Min_factor, sqrt(Gradient/(Gradient*Min_factor)), min (0.7, 1.0) accuracy 0.0001 contained_by {box {<-1, -1, 0>*2, <1, 1.2, 1>*2}} //texture {pigment {rgb <0, 0, 0.2>} finish {specular 0.2}} interior_texture {pigment {agate} finish {specular 0.4}} translate y*0.5 } sphere { 0, 10 texture {Vein rotate -z*30} } object { Isosurface scale 5 translate <0, -0.5, -10.25> texture {StepNoise2 scale 0.15} }