//------------mare /* Feel free to use this code in your works Jonathan Rafael Ghiglia */ #version 3.5; #include "functions.inc" #declare f_onde= function { f_ridged_mf (x,y,z, 0.05,// H 2.8,// Lacunarity 6,// Octaves 0.7,// Offset 0.9,// Gain 3//P5 ) } #declare f_marosi= function { pigment { bozo color_map {[0 rgb 1][1 rgb 0]} scale 15 } } #declare t_mare = texture { pigment { pigment_pattern {function {max(0,min(z,1))} color_map {[0 rgb 0][1 rgb 1]} scale 50 translate 10*z} pigment_map { [0 function {f_onde(x,y,z)} color_map {[0.6 rgbf <1,1,1,1>][.8 rgbt <1,1,1,0.35>]} ] [1 rgbt 1] } } finish { ambient 0 diffuse 1 // rende visibile la schiuma specular 0.45 roughness 0.008 reflection {0.1,1 fresnel on } conserve_energy} } isosurface { function {y-f_onde(x,y,z)*0.3+f_marosi(x,y,z).red*3} //evaluate 1,10,.99 accuracy 10^-2 max_gradient 4.677 contained_by {box {-<1000,41,100>,<1000,0.33,1000>}} texture {t_mare } interior {ior 1.333 fade_distance 2 fade_power 1000 fade_color rgb <0.000,0.255,0.459>} } box {<-1000,-50,-1000>,<1000,-40,1000> pigment {color rgb <0.886,0.812,0.580>} } camera { location <0,2,-4> look_at 1.5*y } light_source { // weak sun <0.0, 0.0, 0.0> color rgb <0.600, 0.677, 0.677>*1.8 translate <500, 500, -500> media_interaction on } fog {fog_type 2 fog_offset 20 fog_alt 10 rgbt <.5,.65,.65,.2/0.8>*0.8 distance 300 turbulence .5} sky_sphere { pigment { wrinkles color_map { [0.2 rgb <.479,.677,.677>] [1 rgb <.5,.65,.65>*0.5] } scale <1.25,0.1,1> turbulence 0.2 lambda 3 omega 0.6} }