ernst_h opened this issue on Apr 20, 2004 ยท 20 posts
ernst_h posted Tue, 20 April 2004 at 1:58 AM
sin(20* sqrt(sqr(2u - 1) + sqr(2v - 1)))
If you want more ripples you can increase the 20 to
a higher value.
This wave, however, is not perfect since its amplitude
remains constant with increasing distance wereas a real
wave decreases.
I hope you can use it for something usefull.
Ernst
c1rcle posted Tue, 20 April 2004 at 3:32 AM
not being a whiz in the material room I don't know, but is there a way with Math function to divide the amplitude by distance from centre? that should decrease the size of the wave as it gets further away from the centre.
ernst_h posted Tue, 20 April 2004 at 5:52 AM
Sure.
I also added another node Math_Functions_11 to
change the phase of the sin. Just enter something
in value_2
By the way, the renderer seems to have an error.
In the middle of the plane there is always this little
tip, no matter how the phase is.
Do you think I should report this to CuriousLabs?
Ernst
c1rcle posted Tue, 20 April 2004 at 6:33 AM
yeah let them know maybe they'll have a way to get round it, there's been no mention of another SR release on the horizon so it's probably unlikely to be fixed before Poser6.
WeirdJuice posted Tue, 20 April 2004 at 7:30 AM
I haven't checked all the way through the shader, but I think that the "tip" at the center is a divide-by-zero effect in the Math_Function_9 node when both the u and v coordinates have values 0.5 where the output from the sqrt (Math_Function_5) is zero. Mathematically, you should test for this value and use the identity sin(x)/x -> 1.0. Bill
WeirdJuice posted Tue, 20 April 2004 at 7:38 AM
More specifically that should have been: sin(x)/x -> 1.0 when x -> 0.0 Rather than a bug report, CL should get a bit of credit for not crashing Poser when the nodes have a divide-by-zero feature. Bill
gmadone posted Tue, 20 April 2004 at 7:50 AM
The tip looks normal to me the wave needs to start somewhere, if you use cos, and start from zero, it should look ok. (You need to rotate turn for sin to start smooth) I recommend using 6.28319 for value 1 in all the trig nodes (sin, cos, tan) this way it will cycle at 1. And I adjust the wave count, on the node before (an add or subtract) (you can also animate the wave from value 2 of this node by attaching the frame number) (node 11). Just to clarify nodes 6 and 7 are the center. Node 5 is the Radius, and node 2 is the Radius squared (I use one or both of these for my dampers). And I am not sure, but I think a multiply might be faster than a POW with value 2 = 2. (When you animate three of these together, and then ray trace through them, all the clock cycles count) Hope this helps, Gary
ernst_h posted Tue, 20 April 2004 at 8:07 AM
Well, it is not. But I did try a divide by zero on purpose
and Poser did not crash!
The wave-shader represents the following formula:
sin(40 * r) / sqr(r+1)
r (the radius) is the value of Math_Function_5.
It goes from 0 to 1. So, r+1 goes from 1 to 2.
But, as mentioned above, even without that shift
Poser doesn't crash, but renders the above picture.
The hole in the center is really a result of a div by 0.
Ernst
gmadone posted Tue, 20 April 2004 at 8:14 AM
From the last post it looks like the displacement is larger than the minimum displacement bounds, just move that up 1 or 2.
ernst_h posted Tue, 20 April 2004 at 8:46 AM
minimum displacement bounds
??? Never heared of that. Where do I find them?
But if you divide by 0 the result is
infinite, anyway.
By the way, you can download this thing and play
around with it yourself now:
http://www.jasms.de/diverses/poser/downloads/wave.mt5
Ernst
gmadone posted Tue, 20 April 2004 at 8:56 AM
In the Render Options. You didn't divide by zero, and as long as the displacement bounds are not to large, poser will ignore it even if you did.
WeirdJuice posted Tue, 20 April 2004 at 9:06 AM
Minimum displacement bounds are a rendering setting that allows the render to account for displacements that cross the boundaries between render buckets, although trying to account for a (possibly near) infinite displacement may not be worth the trouble. You're right about the formula, the additional bias does eliminate the possibility of divide-by-zero problems. On the other hand, it does occur to me that any sinusoidal function (or cosines for that matter) would inherently suffer from discontinuities at a radial center. If you take any cross-section of the curve through the radius, it's obvious that, except when the phase is other than +/-PI/2 (?), there is going to be a sharp peak or trough at the origin with the cross section reflected on both sides. This may be a lot more apparent with displacement, since the accuracy of the sampling is always a pixel or less, than with other (geometrical deformation) techniques where there is an element of mesh smoothing between sample (vertex) points. It may be that you need to add an additional smoothing function to compensate for the discontinuity at the center. Bill
gmadone posted Tue, 20 April 2004 at 9:08 AM
xantor posted Tue, 20 April 2004 at 12:22 PM
How do you animate this effect? I should point out that I don`t know the mathematics. So a simple explanation would be nice :)
gmadone posted Tue, 20 April 2004 at 4:39 PM
xantor posted Tue, 20 April 2004 at 8:00 PM
Thank you, I will wait till they are in freestuff.
ernst_h posted Wed, 21 April 2004 at 12:38 AM
But look: Math_Functions_9 is directly connected to
the displacement. M_F_9 is smooth, the preview and the
final render are not.
M_F_11 (not shown here) can change the phase of the sin.
But this tip remains always, no matter which value I enter
there.
Ernst
bikermouse posted Wed, 21 April 2004 at 4:26 AM
bookmark.
gmadone posted Wed, 21 April 2004 at 8:52 AM
If you change the sin to cos and set the offset to zero, the render will look right, and the preview will have the tip (it does look backwards to me too). If that is not an option try the value .03927 as the offset. The 40 multiplier in the sin node makes that calculation tuff. (I already recommended changing it and using node 11 for the wave count). Hope this helps
WeirdJuice posted Wed, 21 April 2004 at 10:54 AM