POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 : Re: Bathtub - take 2 Server Time
1 Aug 2024 14:33:32 EDT (-0400)
  Re: Bathtub - take 2  
From: Trevor G Quayle
Date: 20 Dec 2008 10:45:00
Message: <web.494d12cf6655db18c67b294d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
>
> > I played around with coming up with a nice water today.
>
> Indeed.
>
> log_E(0.58)
> log(.58)/log(2.7182818284590452353602874713526) =
> -0.544727175441672
> #local FD=-60/ln(0.58); //Fade distance = 110.146882
>
> so what does .58 refer to?

Um, I don't recall off the top of my head.  This was set up over a year ago.  I
think it was to try to correlate with something but the exact reasoning escapes
me at the moment.

>
> #declare WHit=0.45;
> water-height ??? what does 0.45 refer to?

Sorry, I should've explained the variables.

ASiz=250; //~Length/Width of pool object

#declare RHIT=0.25; //Height of ripples (ripples at the sides of the pool)

#declare FREQ=15;   //frequency of ripples actually period or spacing, higher
number means further apart)

#declare WDep=75;   //Total depth of water
#declare WHit=0.45; //Height of main wave pattern

#declare TDep=WDep+WHit+RHIT+1; //Total depth of water with waves/ripples added
  - actually should be #declare TDep=WDep+WHit+RHIT*2;

#declare WCol=rgb <0.51373, 0.70588, 0.70588>; //Water colour
#local FD=-60/ln(0.58);                        //Fade distance

#declare RScal=1/10; //relative overall scaling of wave pattern
#declare RFreq=50;   //frequency of waves (similar to FREQ above but for the
main waves)

#local FTILEA = function {SRip(x,y,z).gray*0.5+SRip(y,x,z).gray*0.5}  //main
wave pattern.  two perpendicular marble patterns with sine_wave and much
turbulence
#local FTILEB = function {pigment{PPIG3 }}  //side ripples
#local FTILEC = function {pigment{PPIG3 rotate z*90}} //side ripples

#declare aaa=WHit/TDep; //proportional height of waves
#declare bbb=RHIT/TDep; //proportional height of ripples


#local FTILE = function
{FTILEA(x,y,z)*aaa+FTILEB(x,y,z).gray*bbb+FTILEC(x,y,z).gray*bbb+(1-aaa-bbb*2)}
//total surface function


Note that when using function patterns/pigments, care must be taken to keep the
maximum total values between 0 and 1 as anything outside that range wraps back
around (ie jumps back down to 0 after 1, etc) and gives wrong and awful
results.

In FTILEA  the two 0.5 values can be altered but make sure they add to 1 (0.4 &
0.6, etc)

In FTILE, the combination of aaa+bbb+bbb+(1-aaa-bbb2) makes the wave pattern
sizing proportional keeping the values between 0 and 1.


>
> I can really appreciate the dimension considerations.
>
> Reflection was unconvincing with 2 light-levels in the BG;
>  still working on a tile pool perhaps.

As I have said, reflection is generally not helped with lighting, but with what
there is to reflect.  Maybe add a sun where your light is and some clouds to
the sky.

Adding a sun is as simple as making a sphere with high ambient values:

within light source
looks_like{
  sphere{0,1  //size and locate accordingly
    pigment{rgb 1} //or use whatever colour you want the sun to be
    finish{diffuse 0 ambient 10}  //it is important to have a high ambient value
here, otherwise it looks like a plain white ball
  }
}

Using it with looks_like within a light source automatically lets light pass
through.  If it is not within a light source, add no_shadow to the object so it
doesn't interfere with the light.



-tgq


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.