POV-Ray : Newsgroups : povray.binaries.images : Inversion : Re: Inversion Server Time
19 May 2024 05:10:58 EDT (-0400)
  Re: Inversion  
From: Jérôme M. Berger
Date: 12 Apr 2016 12:40:51
Message: <570d2513$1@news.povray.org>
On 04/11/2016 11:31 PM, Jaime Vives Piqueres wrote:
> El 11/04/16 a las 23:05, Jérôme M. Berger escribió:
>> 	Well strictly speaking, you're missing a pair of parentheses around t
he
>> 2*EPSILON. They should make it easier to tweak your parameters (for on
e
>> thing you can probably replace the 1000000000 with 10 which makes for
>> less unwieldy values).
> 
> Ouch! Corrected... but now the multiplier has to be around 0.0000005.
> 
	BTW, it would probably be faster to replace your code with:

// Will probably need tweaking
#declare M=0.0000005;

#declare d2xpd2y=function{
   (f_water(x+EPSILON,y,0)+f_water(x-EPSILON,y,0)+
    f_water(x,y+EPSILON,0)+f_water(x,y-EPSILON,0)-
    4*f_water(x,y,0))/
   (EPSILON*EPSILON)
}

#declare selected=function{select(x,abs(x))}

#declare t_ocean=
texture{
  pigment_pattern{
    function{selected(d2xpd2y(x,y,0))*M,0)}
  }
  texture_map{
    [0.0 t_water]
    [0.1 t_foam]
  }
}

	This only calls f_water 5 times where your code called it 16 times...

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

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