/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : Tek_RoughSea.pov Version : 3.6.1c / MegaPOV 1.21 Description : isosurface ridged_mf - can it make nice looking water? - yes apparently it can, so I made it into a full picture! :) Date : November 2006 Author : Tekno Frannansa E-mail : p.b.i. Copyright (C) 2006. All rights reserved. Use and/or modification of this scene is free, except for commercial purposes. Commercial distribution is not allowed without written permission from the author. **********************************************************************************/ // Render settings (right-click on a line below): // +w640 +h640 +a0.3 +am2 +bm2 +wt6 // +w500 +h600 +a0.3 +am2 +bm2 Create_Ini=Tek_RoughSea #version 3.7; #default {pigment {rgb <1,0,0>}} #default {finish {ambient 0 diffuse 1}} //#version unofficial megapov 1.21; //not actually using any megapov features I think #include "functions.inc" #include "transforms.inc" #declare Rad=off; //doesn't affect the water apart from the foam, but massively increases render times! So leave it switched off global_settings { #if (version < 3.7) hf_gray_16 off max_intersections 64 #end assumed_gamma 1.0 max_trace_level 5 //default [5] #if (Rad) radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.004 // end pretrace at this size count 50 // higher -> higher quality (1..1600) [35] nearest_count 10, 5 // higher -> higher quality (1..20) [5]; (new in 3.7) optional 2nd parameter sets adaptive radiosity pretrace error_bound 1 // higher -> smoother, less accurate [1.8] recursion_limit 1 // how much interreflections are calculated (1..5+) [3] low_error_factor 0.3 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // 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 } #end //noise_generator 2 } #default { pigment { srgb 1 } finish { diffuse .9 ambient 0 } } //camera very important, must be orthographic for tiled texture, but for perspective with moveable edges of window perhaps spherical? #local H=image_width/sqrt(image_height*image_width); #local V=image_height/sqrt(image_height*image_width); camera { spherical angle H*30,V*30 //#declare camPos = <.4,-.5,-15>; #declare camPos = <.4,-.5,-5>; location camPos //look_at x-y*1.3-z*8.5//+y*5 look_at <3, -0.5, 8> rotate -1*z } //some debug stuff, paint things black to examine the media #macro pigOverride() //pigment { srgb <.02,.06,.15> } #end #macro texOverride() //texture { pigOverride() finish { diffuse 0 ambient 1 } } //override textures to debug media #end //-------------------------------------------------------------------------------- #declare water = isosurface { #local Q=0; //randomize the water function { y+(3- f_ridged_mf( ((x+y*.2)/4)/-1, Q+y*.4, z/4, //note: with /-1 to mirror the direction of waves. Has also to be done in the f_spotted function, and in the texture! .5, //H negative exponent of multiplier, magnitude scale per octave. lower this to emphasize higher gain values 3, //1/omega = frequence multiplier per octave, H^ exponent is seeded by this 6, //octaves 1, //offset sets the clip point, or phase, or something, 1 = default, 0 = no clip (no ridges) .8, //gain - 0 means see nothing from higher freqs, 1 higher freqs only at tips, inf -> lower freqs added at all heights [like granite] 3 //noise generator ))*.57 +(f_spotted((x/5+y/5)/-1, 0, z/5)-.5)*1 } contained_by { box { <-20,-10,-20>,<160,2,240> } } max_gradient 6 accuracy 1/10000 //still get a few black spots, but less texture { //foam pattern, see through where not foaming #local bubbly = .2; pigment_pattern { pigment_pattern { average pigment_map { [1-bubbly pigment_pattern { function { //modified version of the function from above //tweak gain and H settings to make foam lie along ridges //tweak position (if desired) to make it lag behind a bit f_ridged_mf( ((x+y*.2)/4)/-1, Q+y*.4, z/4, .5, //H negative exponent of multiplier, magnitude scale per octave. lower this to emphasize higher gain values 3, //1/omega = frequence multiplier per octave, H^ exponent is seeded by this 6, //octaves 1, //offset sets the clip point, or phase, or something, 1 = default, 0 = no clip (no ridges) 3, //gain - 0 means see nothing from higher freqs, 1 higher freqs only at tips, inf -> lower freqs added at all heights [like granite] 3 //noise generator )/3 } colour_map { [.55 srgb 0] [.71 srgb 1] } } poly_wave 2 ] [bubbly crackle form <1,0,0> scale .005 cubic_wave colour_map { [0 srgb 0][1 srgb 1] } ] } } colour_map { [0+bubbly srgb 0] [1-bubbly/2 srgb 1] } } #local goodTex = on; texture_map { [0 //water, totally see through and fresnel reflective #if (goodTex) pigment { srgbt 1 } finish { diffuse 0 //ambient 1 reflection { 0, 1 fresnel } conserve_energy //phong 1 phong_size 500 //too big? } #else pigment { srgb <.05,.1,.2> } #end ] [1 #if (goodTex) pigment { srgb 1 transmit .3 } //lots of internal reflections make it bright finish { brilliance .5 reflection { 0, 1 fresnel } conserve_energy } normal { crackle -2 form <1,0,0> scale .003 poly_wave 2 } #else pigment { srgb 1 } finish { brilliance .5 } normal { crackle -2 form <1,0,0> scale .003 poly_wave 2 } #end ] } } interior { ior 1.33 media { absorption srgb 1/<0.1, 1, 0.7> //the 1/ lets us control the colour things appear, which is more intuitive emission srgb 0.1*<0.0, 0.1, 0.2> //this will be tinted by the absorption, making a kind of teal colour density { srgb 0.2 } } }// */ texOverride() //rotate -30*y hollow } sphere { y*(-5000-10.01), 5000 //leave it white so it blends in with the sky & foam pigment { spherical cubic_wave scale 100 translate -y*10 colour_map { [0 srgb 1] [1 srgb 0] } } texOverride() } //-------------------------------------------------------------------------------- #declare boat= union { #local hullBase= superellipsoid { <.1,1> rotate z*45 rotate x*10 //sharpen the bow, flatten the stern. scale (x+y)*.73 + z //not quite 1/sqrt(2) because it's not quite square cross section } intersection { object { hullBase scale <1.5,6,8> } plane { y, 0 } plane { -y, 3 } intersection { object { hullBase scale <1.48,6,7.98> } plane { -y, .5 } pigment { srgb .1 } inverse } texture { pigment { gradient y translate -y*.9 scale 6 colour_map { [.825 srgb .3] [.825 srgb .7] [.85 srgb .7] [.85 srgb <.01,.1,.2>] } } normal { dents -1 scale 1/30 } } texture { pigment { srgbt 1 } finish { reflection { .03, .5 falloff 5 } conserve_energy } normal { dents -1 scale 1/30 } } texture { //dirt layer pigment { pigment_pattern { average pigment_map { [1 gradient -y scale 6 poly_wave 1] [.3 granite scale <.1,1,.1> cubic_wave] } } cubic_wave colour_map { [0 srgb <.1,.02,0> transmit 1] [1 srgb <.1,.02,0>] } } finish { brilliance 2 } normal { granite .1 scale <.1,1,.1> } } texOverride() } //metal rim at the top of the hull. intersection { //torus { 1,.002 scale <1.5,5,8> superellipsoid { <.1,1> rotate z*45 rotate x*10 //sharpen the bow, flatten the stern. scale (x+y)*.73 + z //not quite 1/sqrt(2) because it's not quite square cross section scale <1.51,6,8.01> } superellipsoid { <.1,1> rotate z*45 rotate x*10 //sharpen the bow, flatten the stern. scale (x+y)*.73 + z //not quite 1/sqrt(2) because it's not quite square cross section scale <1.49,7,7.99> inverse } plane { y, .01 } plane { -y, .01 } pigment { srgb 1 } finish { brilliance 8 diffuse .25 phong .4 phong_size 2 metallic specular 1 roughness 1/500 reflection { .2, .5 falloff 5 } } //fake curve, because we're not using a torus any more. normal { pigment_pattern { planar colour_map { [0 srgb 1][1 srgb 0] } } -1 poly_wave 2 scale .01 } texOverride() } difference { box { -1, 1 scale <1.3,.4,3> translate z*1+y*.2 } box { -1, 1 scale <.1,.2,.3> translate <-1.3,.35,-1.65> pigment { srgb <.5,.4,.2> } } box { -1, 1 scale <.1,.2,.3> translate <-1.3,.35,-1.0> pigment { srgb <.5,.4,.2> } } box { -1, 1 scale <.1,.2,.3> translate <-1.3,.35,-.25> pigment { srgb <.5,.4,.2> } } box { -1, 1 scale <.3,.41,2> translate <0,.2,-2> } pigment { srgb .5 } normal { granite -.2 scale 1/100 } texOverride() } box { -1, 1 scale <1.32,.01,3.22> translate z*.8+y*.6 pigment { srgb .1 } texOverride() } difference { box { -1, 1 scale <1.2,.2,2.7> translate z*1.1+y*.8 } box { -1, 1 scale <.1,.15,.3> translate <-1.2,.8,-1.25> pigment { srgb <.5,.4,.2> }} box { -1, 1 scale <.1,.15,.3> translate <-1.2,.8,-.6> pigment { srgb <.5,.4,.2> } } box { -1, 1 scale <.1,.15,.3> translate <-1.2,.8,.15> pigment { srgb <.5,.4,.2> } } box { -1, 1 scale <.2,.21,2> translate <0,.8,-1.6> } pigment { srgb .5 } normal { granite -.2 scale 1/100 } texOverride() } union { #macro win() //smashed window difference { box { -1, 1 } #local s=seed(11); #local i=0; #while ( i<8 ) box { <-1.1,0,-1>, <1.1,1,1> scale <1,rand(s),rand(s)*.5> translate z*(rand(s)-.5)*.2 rotate x*rand(s)*360 } #local i=i+1; #end #end win() scale <.01,.2,.3> translate <-1.28,.35,-1.65> } win() scale <.01,.2,.3> translate <-1.28,.35,-1.0> } win() scale <.01,.2,.3> translate <-1.28,.35,-.25> } win() scale <.01,.15,.3> translate <-1.18,.8,-1.25> } win() scale <.01,.15,.3> translate <-1.18,.8,-.6> } win() scale <.01,.15,.3> translate <-1.18,.8,.15> } pigment { srgb 0 transmit .5 } finish { reflection { .2, 1 falloff 5 } conserve_energy } texOverride() } union { difference { superellipsoid { <1,.15> rotate x*90 } cylinder { -y*2,y*2,.9 pigment { srgb .05 } } translate y scale y*2.3/2 } difference { superellipsoid { <1,.15> rotate x*90 } cylinder { -y*2,y*2,.9 pigment { rgb .05 } } translate y+z*2.5 scale y*2.3/2 } texture { pigment { planar scale .2 translate y*2 colour_map { [.4 srgb .5] [.4 srgb <.01,.1,.2>] [.6 srgb <.01,.1,.2>] [.6 srgb .8] } } normal { dents -1 scale 1/30 } } texture { pigment { srgbt 1 } finish { reflection { .03, .5 falloff 5 } conserve_energy } normal { dents -1 scale 1/30 } } texOverride() Shear_Trans(x/2,y+z/4,z) } box { -1, 1 scale <1.22,.01,2.92> translate z*1+y pigment { srgb .1 } texOverride() } } //object { boat scale 1.5 rotate -z*30 rotate 13*x-y*18 translate <0,-3.2,5> } //closer position //object { boat scale 1 rotate -z*30 rotate 12*x-y*20 translate <3,-2,8> } //-------------------------------------------------------------------------------- //life ring #declare Lifering = torus { .2,.05 texture { pigment_pattern { gradient y translate -.3 scale 2 warp { turbulence .6 lambda 3.3 octaves 3 } scale 1/2 scale .08*2 } #declare ringTex = texture { pigment { checker srgb <.6,.05,.03>, srgb .8 } finish { brilliance 2 phong .1 phong_size 20 } } texOverride() #declare wetRingTex = texture { ringTex } texture { pigment { srgb 0 transmit .9 } //fake up the conserve energy a bit, to make the water line more visible. finish { phong .5 phong_size 200 reflection { 0, 1 fresnel } conserve_energy } normal { pigment_pattern { pigment_pattern { gradient y translate -.3 scale 2 warp { turbulence .6 lambda 3.3 octaves 3 } scale 1/2 scale .08*2 } colour_map { [.45 srgb 0] [.5 srgb 1] } } -.02 poly_wave 2 accuracy 1/100 } } texOverride() texture_map { [.5 //wet bit wetRingTex ] [.5 //dry bit ringTex ] } }// */ interior { ior 1.33 } //for fresnel rotate -y*30 translate y*.02 //float above 1/2 way point, very bouyant when unladen #local norm = <0,0,0>; #local pos = <.4,0,-10.6>; #local pos = trace ( water, pos+y*20, -y, norm ); Reorient_Trans(y,norm) translate pos } //object {Lifering} //-------------------------------------------------------------------------------- light_source { #declare sunDir=<-1,1,-1>; sunDir*1000, srgb <2.2, 2, 1.7>*0.5 } #if (!Rad) light_source { <2,3,-1>*1000, srgb <0.1, 0.2, 0.5> shadowless } light_source { <-1,2,-3>*1000, srgb <0.1, 0.2, 0.5> shadowless } light_source { <-3,2,1>*1000, srgb <0.1, 0.2, 0.5> shadowless } light_source { <1,-2,-1>*1000, srgb 0.2 shadowless } #end sky_sphere { pigment { planar poly_wave 2 colour_map { [0.0 rgb <0.6, 0.7, 1.0>] [0.7 rgb <0.0, 0.1, 0.8>] } } #macro Cloud(c1,c2,s) pigment { pigment_pattern { pigment_pattern { granite turbulence 1 scale 1 poly_wave 1 scale s //fake parallax, squished towards top of dome relative to next layer translate y } pigment_map { [0.0 srgb 0] [0.8 //stick a break in the clouds above, so the ocean's less grey planar poly_wave 2 ] } } cubic_wave colour_map { [0 c1] [1 c2] } } #end #local sh = 0.4; Cloud(srgb <4, 4.2, 5>/3 transmit 1,srgb sh,<1, 0.298, 1>*4) Cloud(srgb <4, 4.2, 5>/3 transmit 1,srgb sh,<1, 0.298, 1>) Cloud(srgb sh transmit 1,srgb sh,<1,.3,1>*4) Cloud(srgb sh transmit 1,srgb sh,<1,.3,1>) pigOverride() } object { water #declare waterOn=1; } //#declare waterOn=0; //plane { y, -1.5 #declare waterOn=1; pigment { srgb <.05,.1,.2> } } //cheaper placeholder #ifdef (waterOn) //this looks dumb if the water's off. //mist from waves cylinder { -y*2, -0.6*y, 50 hollow on no_reflection no_shadow //no time wasting pigment { srgbt 1 } interior { media { emission srgb <0.8, 0.87, 1> //scattering {1, srgb 0.3 extinction 0} absorption 0.5 density { pigment_pattern { pigment_pattern { average pigment_map { [1 planar scale 0.7 //- stop this low quality media interfering with the sky translate -y*0.8 scale 1/3 warp { turbulence .2 octaves 3 } scale 3 poly_wave 3 //cubic_wave ] [1 pigment_pattern { granite scale 8 scale 1/3 warp { turbulence 2 octaves 3 } scale 3 scale 10 warp { turbulence 0.5 } scale 1/10 //scale <1,.2,1> Shear_Trans(x,y/3+x/3,z) colour_map { [0.0 srgb 1] [0.3 srgb 0] } } poly_wave 3 ] } } colour_map { [.5 srgb 0] [1 srgb 1] } } cubic_wave //poly_wave 4 density_map { [0 srgb 0] [1 srgb 8] } translate z*1 } intervals 6 aa_threshold 1/256 } } }// */ #end //general fogging //pov's fog effect is visible under water. turning the water white. //so instead, fill a volume that stops just below the water line intersection { sphere { 0, 200 scale <1, 0.1, 1> } plane { -y, 2 } hollow no_shadow no_reflection pigment { srgbt 1 } interior { media {absorption 0.02 density { planar scale 3 translate 0 poly_wave 2 } intervals 4 } //fog, dark to support godrays media { //"god rays" - fake rays of light shining through gaps in clouds using emissive media and nice pattern emission srgb <1, 1.2, 1.2>*0.12 absorption 0 density { pigment_pattern { #declare light_x = sunDir.x; #declare light_y = sunDir.y; #declare light_z = sunDir.z; function { max(0, 2*f_granite(x-y*light_x/light_y,0,z-y*light_z/light_y) -1 ) } cubic_wave scale 20 } density_map { [-0.0 srgb 0] //-ve indices => don't quite hit black, so we get some overall fog. [1 planar scale 3 translate 0 poly_wave 2] } } intervals 1 samples 10 aa_threshold 1/256 jitter 0.03 } } } //Added by Thomas de Groot #include "VOC ship\VOC ship.pov" object {VOC_Retourschip scale 0.05 rotate 20*x rotate -51*y rotate -5*z #local norm = <0, 0, 0>; //#local pos = <3, 20, 8>; #local pos = <2.5, 20, 3>; #local pos = trace ( water, pos, -y, norm ); translate pos } //object { boat scale 1 rotate -z*30 rotate 12*x-y*20 translate <3,-2,8> } //object { boat scale 1.5 rotate -z*30 rotate 13*x-y*18 translate <0,-3.2,5> } //closer position