POV-Ray : Newsgroups : povray.binaries.images : NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES : Re: NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES Server Time
6 Aug 2024 23:28:23 EDT (-0400)
  Re: NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES  
From: Tek
Date: 28 Nov 2006 19:58:36
Message: <456cdb3c$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.456c6cd0d6d04fcfb5347a330@news.povray.org...
> I could be wrong, but I don't think there is a *particular* controlling
> function at work here.  That is, POV-Ray seems to treat each of the three
> functions "equally," so that the final result is a blending of all
> three...but only where all three functions happen to coincide in space. At
> least, that's what I see from the purely visual evidence.

Well it's not up to pov, it's maths, but yes you're right I used the term 
"controlling" to over-emphasize my point :-D

The point is, no functions can eliminate the underlying hard-edged function, 
but as you rightly demonstrate they can disguise it. It's certainly less 
noticeable in that render than I expected.

Anyway, onto a possible solution I've been toying with in my head, though as 
noted before the hard edges in my scene just don't bug me enough to go to 
the trouble of fixing them! But anyhow, the solution is to smooth out the 
edges in the underlying function itself, which is entirely possible by 
simply creating a function that looks like it everywhere else.

For a general purpose solution, if you have a function f(x,y,z) returning 
values between 0 and 1 and you want sharp edges to fade out as it approaches 
1 you could just do (warning crazy untested maths!):
function { max(min(.9, f(x,y,z)), 1-.1*(pow(f(x,y,z)/(2*.1),2)+.75) ) }
Pretty sure that maths is right... Basically you're substituting a y=x curve 
with a y=x*x, matched up so the transition is at the point where x*x has the 
same gradient... hmm I should probably test that maths but it's late and 
anyway it's no use to me...

You see my problem's more complex, because I have, quite deliberately, made 
the foam occur on a pattern that isn't strictly related to the output of my 
wave function, so I can't simply use my trickery to round off the edges. 
However I could subtract my foam's controlling pattern from my wave pattern, 
since they both have sharp edges that coincide, and hope they cancel out! 
But more likely it would severely alter the shape of the foamy areas and I 
really don't want to do that. I'm very happy with the shape of the foam, so 
if I can't isolate the sharp edges and smooth only them, I'll just have to 
live with them.

-- 
Tek
http://evilsuperbrain.com


Post a reply to this message

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