/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : JacquierSea_mcr.pov Version : 3.6 Description : Macro for making waves and foam sea isosurface Date : February 2005 Author : Marc Jacquier Thomas A. M. de Groot (macro structure; water texture) **********************************************************************************/ #version 3.7; #include "functions.inc" #include "iso_csg.inc" #ifndef (Standalone) #declare Standalone = true; #end //===================================================================================================================================== #macro JacquierSea ( Filter, // water texture: filter value Transparency, // water texture: transparency value TexScale, // water texture: normal scale vector FD, // water interior: fade distance FP, // water interior: fade power (1000 = exponential attenuation) Isoscale_x, // isosurface: x-scale of the function (Size of waves) Isoscale_z, // isosurface: z-scale of the function (Size of waves) Damp, // isosurface function: damp (parameter H) Lacunarity, // isosurface function: lacunarity Octave, // isosurface function: octave Offset, // isosurface function: offset Gain, // isosurface function: gain Wave_Height, // isosurface function: wave height Foam, // isosurface function: amount of foam MinBox, // isosurface: minimum limits of container MaxBox, // isosurface: maximum limits of container MaxGrad // isosurface: max_gradient ) #ifdef (FF) #undef FF #end // Seawater texture (original: TdG_NorthSeaWaterTex) without foam: #local T_eau = texture { pigment { color srgbft <0.104167, 0.3125, 0.260417, Filter, Transparency> } normal { waves , 0.05 turbulence 0.5 frequency 100.0 phase 1.0 ramp_wave scale TexScale } finish { ambient 0.15 diffuse 0.0 brilliance 5.0 phong 1.0 phong_size 90.0 specular 0.4 roughness 0.01 conserve_energy reflection { .1, .9 falloff 2 } } } // foam texture: #local T_mousse = texture { pigment { color rgb 1 transmit .3 } finish{ ambient 0.0 diffuse 1 } normal{ bumps 0.1 scale 0.2 } } // transformation of the function used for the isosurface sea, into a pigment function: #local FF = function {y + 1 - f_ridged_mf(x/Isoscale_x, y, z/Isoscale_z,Damp,Lacunarity,Octave,Offset,Gain,2)*Wave_Height} #local P_img = pigment { function {FF(x, y, z)} color_map { [0.0 rgb 1 ] [1.0 rgb 0 ] } warp {turbulence .02 lambda 7} poly_wave 0.5 } #local F_img = function {pigment {P_img}} #local f_crackle_moi = function {pattern {crackle warp {turbulence 0.65 lambda 3} scale <1,2,1>*2}} //turb 0.7 //#local f_crackle_moi = function {y + 1 - f_ridged_mf(x/Isoscale_x, y, z/Isoscale_z,Damp,Lacunarity,Octave,Offset,Gain,2)*Wave_Height} // The distribution function from codesea.pov, to fill more or less the crackles (François Dispot): #local F_var_crackle = function {min(1, f_crackle_moi(x, y, z)/max(min(1,(1-F_img(x, y, z).gray)*Foam),.001))} // final material for the sea: #local M_Iso_Sea = material { texture { function {F_var_crackle(x,y,z)} texture_map { // combinations: [.35 T_mousse] // .4 .35 [.50 T_eau] // .5 .85 } } interior { ior 1.33 fade_distance FD fade_power FP fade_color srgb <0.0, 0.437467, 0.0> media { samples 1, 30 absorption srgb <1.0, 0.05, 0.05> scattering { 3, srgb <0.0875, 0.5125, 0.353125> // mie murky scattering } } } } //---------------------------------------------------------- // Iso_Sea by Marc Jacquier (2003) // Originally: Isosurface plugin 1beta by S. Shonfield, morayplugin@yahoo.ca // adapted to left-handed orientation: isosurface { function { y + 1 - f_ridged_mf(x/Isoscale_x, 0, z/Isoscale_z,Damp,Lacunarity,Octave,Offset,Gain,2)*Wave_Height } contained_by {box{MinBox,MaxBox}} threshold 0 accuracy 0.001 max_gradient MaxGrad //max_trace 1 //all_intersections material {M_Iso_Sea} scale <1,1,1> rotate <0,0,0> translate <0, 0, 0> } // end isosurface //Deep Water: box { , pigment {color rgb <0.119608, 0.137255, 0.556863>*0.01}} #end // end of JacquierSea macro //===================================================================================================================================== #if (Standalone) global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.004 // end pretrace at this size count 50, 500 // higher -> higher quality (1..1600) [35] ->set to about 200 for better shadows (slower) nearest_count 10, 5 // higher -> higher quality (1..10) [5] error_bound 0.6 // higher -> smoother, less accurate [1.8] recursion_limit 2 // how much interreflections are calculated (1..5+) [2] low_error_factor .3 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.010 // reuse of old radiosity samples [0.015] maximum_reuse 0.1 // new parameter 3.7 [0.2] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 normal off // take surface normals into account [off] media off // take media into account [off] always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } default { texture { pigment { rgb <1,0,0> } } } camera { location <0.0, 2.0, -10.0> direction 1.5*z right x*image_width/image_height look_at <0.0, 1, 0.0> } sky_sphere { pigment { gradient y color_map { [0.0 srgb <0.6,0.7,1.0>] [0.7 srgb <0.0,0.1,0.8>] } } } light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1>*1.2 // light's color translate <-3000, 3000, -3000> } /*light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1>*0.8 // light's color translate <3000, 3000, -3000> shadowless }*/ fog { fog_type 2 distance 100 color srgbft <0.7, 0.7, 0.7, 0.2, 0.1> fog_offset -1 fog_alt 5.0 turbulence 80 } //=========================================================================================================================== //original cylinder by Marc Jacquier: #declare Mat_Cylinder = material { texture { pigment { color srgb <1.0, 0.8, 0.8> } finish { diffuse 0.7 } } } #declare CylinderObject = cylinder { // Cylndr001 <0,1,0>, <0,0,0>, 1 translate -0.98*y material {Mat_Cylinder} scale <1.0, 100.0, 1.0> rotate 5.0*z } //object {CylinderObject} //=========================================================================================================================== //alternate cylinder using iso_csg: #declare fn_Shape1 = // shape function to be declared IC_Displace( IC_Cylinder(-y, y, 0.5), function { f_noise3d(x, y, z)*0.6 } ) #declare fn_Shape2 = IC_Scale( fn_Shape1, <1,2,1> ) #declare fn_Shape3 = IC_Rotate( fn_Shape2, 5*z ) isosurface { function { fn_Shape3(x, y, z) } max_gradient 1.6 // change! contained_by { // change! box { <-4, -4, -4>, <4, 4, 4> } } material {Mat_Cylinder} } //=========================================================================================================================== #declare Seawaves = JacquierSea ( 0.9, // water texture: filter value 0.10, // water texture: transparency value <3, 2, 1>, // water texture: normal scale vector 4, // water interior: fade distance 1001, // water interior: fade power (1000 = exponential attenuation) 7, // isosurface function: x-scale (Size of waves) 5, // isosurface function: z-scale (size of waves) 1.2, // isosurface function: damp (parameter H) 3, // isosurface function: lacunarity 6, // isosurface function: octave 1.18, // isosurface function: offset 5, // isosurface function: gain 0.9, // isosurface function: wave height 0.2, // sea surface: amount of foam <-500,-11,-50>, // isosurface: minimum limits of container <500,1,1000>, // isosurface: maximum limits of container 3 // isosurface: max_gradient ) object {Seawaves} #end // end of Standalone #declare SkyStandalone = false; #include "Thomas de Groot\Skies\TdG_Sky_04_mcr.inc" TdG_sky ( <6000, 1000, 6000>, // SkyScale 1, // Intervals 1, // Scat 0.6, // E <100, 50, 100>, // ExtraHaze false, // AtmosphericHaze false, // OnlyHaze <0.02, 0.02, 0.01>, // ScatCol 1.2, // SkyLum true, // LowerCloudLayer true, // IntermediateCloud_Layer true, // UpperCloudLayer 0, // UL 0, // IL 0, // LL false // ToMoray ) object {TdG_Sky}